Question for the SuiteScript gurus: we have a scri...
# suitescript
a
Question for the SuiteScript gurus: we have a scripted process to generate a renewal estimate from an existing sales order. A user clicks a button on the sales order that will open a new estimate form, and pre-populate it with values, including line items, from the sales order. It does this by adding the data
onBeforeLoad
and has worked fine in general. Now, we are trying to do this while also marking
Enable Item Line Shipping
(multiple shipping routes feature) on the Estimate at time of creation - however, this has some weird behavior - basically, the line-level shipping fields are disabled on the existing lines added via the script. Toggling the Enable Item Line Shipping checkbox off and back on doesn't resolve this. We made sure we are setting
shipgroup
on the lines when adding them but that hasn't helped. Has anyone managed to do this successfully? Anyone have a suggestion of something to try?
a
The record is being created in dynamic mode?
I will try: • Create the record and save it to see if you get the expected result, and then redirect the user to that record in
EDIT
mode. • Write the lines data to a hidden field, move the logic to the client side, and make sure I use:
forceSyncSourcing: true
when adding the lines.
a
Thanks! I was thinking about those too as workarounds. I think since we're not creating the record but just loading the page/form and adding values, it's not necessarily dynamic or static mode, but would probably be considered dynamic?
e
Hey @al3xicon I do not have the code anymore but I worked on something like this some time ago and the ship groups (list) is created on the backend side only, so you need to create first the SO and then you will get the lines on the edit mode as @alien4u has pointing you. Note: I did this in a UE script, saving and the loading the SO in the same script, no CE involved at all for the requirement.
a
@eminero thanks so much for confirming that, we will probably go forward with that approach and stop spinning our wheels
🤝 1