This commit is contained in:
@@ -1267,7 +1267,7 @@ namespace AyaNova.Biz
|
||||
bool isNew = currentObj == null;
|
||||
|
||||
WorkOrder oProposed = (WorkOrder)proposedObj;
|
||||
|
||||
|
||||
|
||||
//STANDARD EVENTS FOR ALL OBJECTS
|
||||
await NotifyEventHelper.ProcessStandardObjectEvents(ayaEvent, proposedObj, ct);//Note: will properly handle all delete events and event removal if deleted
|
||||
@@ -2223,16 +2223,7 @@ namespace AyaNova.Biz
|
||||
if (proposedObj.WorkOrderId == 0)
|
||||
AddError(ApiErrorCode.VALIDATION_REQUIRED, "WorkOrderId");
|
||||
else if (!await WorkOrderExistsAsync(proposedObj.WorkOrderId))
|
||||
{
|
||||
AddError(ApiErrorCode.VALIDATION_INVALID_VALUE, "WorkOrderId");
|
||||
}
|
||||
|
||||
//summary is required now, this is a change from v7
|
||||
//I did this because it is required in terms of hiding on the form so it also
|
||||
//is required to have a value. This is really because the form field customization I took away the hideable field
|
||||
//maybe I should add that feature back?
|
||||
if (proposedObj.WorkOrderId == 0)
|
||||
AddError(ApiErrorCode.VALIDATION_REQUIRED, "WorkOrderId");
|
||||
|
||||
//Check restricted role preventing create
|
||||
if (isNew && UserIsRestrictedType)
|
||||
@@ -2254,7 +2245,7 @@ namespace AyaNova.Biz
|
||||
}
|
||||
}
|
||||
|
||||
if (string.IsNullOrWhiteSpace(proposedObj.Notes))//negative quantities are not allowed
|
||||
if (string.IsNullOrWhiteSpace(proposedObj.Notes))
|
||||
AddError(ApiErrorCode.VALIDATION_INVALID_VALUE, "Notes");
|
||||
|
||||
//Any form customizations to validate?
|
||||
@@ -4878,7 +4869,7 @@ namespace AyaNova.Biz
|
||||
var wid = await GetWorkOrderIdFromRelativeAsync(AyaType.WorkOrderItem, oProposed.WorkOrderItemId, ct);
|
||||
var WorkorderInfo = await ct.WorkOrder.AsNoTracking().Where(x => x.Id == wid.ParentId).Select(x => new { Serial = x.Serial, Tags = x.Tags }).FirstOrDefaultAsync();
|
||||
proposedObj.Tags = WorkorderInfo.Tags;
|
||||
|
||||
|
||||
proposedObj.Name = WorkorderInfo.Serial.ToString();
|
||||
|
||||
//STANDARD EVENTS FOR ALL OBJECTS
|
||||
|
||||
Reference in New Issue
Block a user