Hi Team,
We are working with 24R2 (Build version) and created a custom processing screen to create Sales Order but during processing we are getting an error like: 'Another process has updated the 'SOContact' record. Your changes will be lost'. But the same is working in previous build (Build version)
On further verification we identified the issue occurs while updating Sales Order Contact and on executing Save action getting another process error, without this code block order created successfully.
Please find the below sample code for your verification and review:
public static void SetBillingContact(SOOrderEntry graph, ItemResult OrderDetails)
{
graph.Billing_Contact.Current = (SOBillingContact)graph.Billing_Contact.Select();
if (graph.Billing_Contact.Current != null && OrderDetails != null && OrderDetails.BillingAddress != null)
{
graph.Billing_Contact.Current.OverrideContact = true;
graph.Billing_Contact.Update(graph.Billing_Contact.Current);
graph.Billing_Contact.Current.FullName = OrderDetails.BillingAddress.FirstName + " " + OrderDetails.BillingAddress.MiddleInitial + " " + OrderDetails.BillingAddress.LastName;
graph.Billing_Contact.Current.Phone1 = OrderDetails.BillingAddress.PhoneNumber;
graph.Billing_Contact.Current.Email = OrderDetails.BillingAddress.EmailAddress;
graph.Billing_Contact.Current.Attention = OrderDetails.BillingAddress.CompanyName;
graph.Billing_Contact.Update(graph.Billing_Contact.Current);
}
}
Also attached the full code file for reference.
Thank you in advance !