Update Through Script Editor Customization

Customization to an existing form through the script editor.

We are trying to update the PartPlant LeadTime field through the New Po Suggestions Form using the script editor. We were trying to access the lead time through
partPlant = Ice.Lib.Framework.WCFServiceSupport.CreateImpl<Erp.Proxy.BO.PartPlantSearchImpl>(epiConnect, ImplBase<Erp.Contracts.PartPlantSearchSvcContract>.UriPath);

We get an error that just says unable to update.

That won’t be the right Business Object.
The best bet is to run a trace when performing the task manually in Part Entry.
Then use that to write your code.
In this case it would be Part.GetByID, change the value, and Part.Update.
There is a wizard that will build a simple code block so you have better example code.

Thanks for the respone, Now there is a new problem.

We got the right object. It is partImpl. When we try to update the LeadTime it says that column doesn’t exist in the table, which is right. How do we get to the lower levels of the partImpl to get to the lead time. This lead time exists in the PartPlant table, but we can’t get to it and the only business object related to the PartPlant is PartImpl.

We figured it out. Thanks for the help! The previous error was because you need to go to the place you want in the dataset for the update (ie PartPlant). Will post a screenshot soon of the final working code for anyone who needs it once we get the user entries to work.

Yes. The Part Business Object contains a dataset of many tables (Part, PartPlant, etc). You would update PartPlant by getting the Part first.

The current working code.

1 Like

Good job! FYI, if you use the Customization Wizard next time it would have written 90% of this code for you.