Accessing inventory detail on the parent record Assembly Build in create mode

Viewed 33

Goal: Fill in the inventory details on the Assembly Build transaction without users entering those values.

I am trying to access the inventory detail of the Assembly Build transaction in create mode.

When I click the build button on the work order it will open the Assembly Build transaction which is a standard flow, but I am trying to fill the inventory detail through the script.

I tried the user event before-load on Assembly Build and the client script on the Assembly Build transaction both are throwing errors.

1 Answers

I tried this a few weeks ago in order to pre-fill the inventory detail of the completed assembly, on loading the form. I couldn't find a way of pre-propulating the assembly build inventory detail, neither in the user-event, nor the client-script events, so the user could edit it before performing the commit.

The only way I could it do anything with the inventory detail work was by creating the assembly build using an indirect script event such as a workflow action on a work order triggered via a button, that creates the assembly build, i.e. :

var r = context.currentRecord.transform({...});

var sr = r.getSubrecord({...}).

// Do things with sr...
// Issue all Lot/serial components etc....

r.save({...});

Unfortunately the assembly build needs to have all the inventory detail for all components checked and entered before it will save.

Related