Skip to main content
Solved

Error when add FSSODet

  • December 9, 2025
  • 1 reply
  • 18 views

Forum|alt.badge.img+2

FSServiceOrder fsServiceOrderRow = new FSServiceOrder();
                    fsServiceOrderRow.SrvOrdType = group.Key.ServiceOrderType;
                    fsServiceOrderRow = serviceOrderEntry.ServiceOrderRecords.Current = serviceOrderEntry.ServiceOrderRecords.Insert(fsServiceOrderRow);
                    fsServiceOrderRow.BranchID = group.Key.UsrServiceBranchID;
                    fsServiceOrderRow.BranchLocationID = group.Key.UsrBranchLocationID;
                    fsServiceOrderRow.CustomerID = group.Key.OwnerID;
                    fsServiceOrderRow.ProjectID = group.Key.UsrServiceProjectID ?? ProjectDefaultAttribute.NonProject();
                    fsServiceOrderRow.LocationID = group.Key.CustomerLocationID;
                    fsServiceOrderRow.DocDesc = group.Key.DescrEqType;
                    fsServiceOrderRow.ContactID = group.Key.UsrContactID;
                    serviceOrderEntry.ServiceOrderRecords.Update(fsServiceOrderRow);

                    foreach (FSEquipmentRowProcess item in group.Items)
                    {
                        FSSODet det = new FSSODet();
                        det.LineType = INItemTypes.ServiceItem;
                        det = serviceOrderEntry.ServiceOrderDetails.Insert(det);
                        det.InventoryID = item.ServiceID;
                        serviceOrderEntry.ServiceOrderDetails.Update(det);
                        det.SMEquipmentID = item.SMEquipmentID;
                        det.ProjectID = item.UsrServiceProjectID ?? ProjectDefaultAttribute.NonProject();
                        det.ProjectTaskID = item.UsrServiceProjectTaskID;
                        det.CostCodeID = item.UsrServiceCostCodeID;
                        serviceOrderEntry.ServiceOrderDetails.Update(det);
                    }

                    serviceOrderEntry.Save.Press();

Error: An error occurred during processing of the field Inventory ID value INST AC    The specified inventory ID or alternate ID "INST AC   " cannot be found in the system. Please verify whether you have proper access rights to this object. But this inventory i can add if create document by manual. I have this error with all other inventory ID

Best answer by aleksandrsechin

Hi ​@bihalivan15 
The INItemTypes.ServiceItem constant has the value "S", but the target field uses a ListAttribute with a length of 5 characters. Therefore, the correct value for the Service type is "SERVI".

Replace this line:

det.LineType = INItemTypes.ServiceItem;

with the following:

det.LineType = "SERVI";

Additionally, consider moving "SERVI" into a constant, or you can refer to this core constant:
PX.Objects.FS.ID.LineType_ALL.SERVICE;

1 reply

Forum|alt.badge.img+3

Hi ​@bihalivan15 
The INItemTypes.ServiceItem constant has the value "S", but the target field uses a ListAttribute with a length of 5 characters. Therefore, the correct value for the Service type is "SERVI".

Replace this line:

det.LineType = INItemTypes.ServiceItem;

with the following:

det.LineType = "SERVI";

Additionally, consider moving "SERVI" into a constant, or you can refer to this core constant:
PX.Objects.FS.ID.LineType_ALL.SERVICE;