public override void OnNew(OnNewContext context, DataMap dataMap) { base.OnNew(context, dataMap); var sequence = context .MetadataRepository .LoadAndIncrementSequenceAsync(context.Application, "wonum") .Result; var statusField = context.Application.Fields.First(f => f.Attribute == "status"); if (statusField.DefaultValue == null) { statusField.DefaultValue = "WAPPR"; } //TODO: review hardcoded values // Upon adding new field initializers, consider // also changing the work order follow-up command. dataMap.Value("wonum", sequence.Format()); dataMap.Value("woclass", Class); dataMap.Value("status", statusField.DefaultValue); dataMap.Value("synstatus_.maxvalue", "WAPPR"); dataMap.Value("synstatus_.description", statusField.DefaultValue == "OPEN" ? "Work Request Open" : "Waiting on Approval"); dataMap.Value("reportdate", DateTime.Now); dataMap.Value("changeby", context.User.UserName); }
public override void OnNew(OnNewContext context, DataMap dataMap) { base.OnNew(context, dataMap); dataMap.Value("transdate", DateTime.Now); dataMap.Value("refwo", context.Composite.Composite.Value("wonum")); }
public override void OnNew(OnNewContext context, DataMap dataMap) { base.OnNew(context, dataMap); dataMap.Value("class", WorkOrderBehavior.Class); dataMap.Value("createby", context.User.UserName); dataMap.Value("createdate", DateTime.Now); dataMap.Value("recordkey", context.Composite.Composite.Value("wonum")); }
public override void OnNew(OnNewContext context, DataMap dataMap) { base.OnNew(context, dataMap); dataMap.Value("transtype", Type); dataMap.Value("refwo", context.Composite.Composite.Value("wonum")); dataMap.Value("enterdate", DateTime.Now); dataMap.Value("enterby", context.User.UserName); }