hey all - we have a custom clone process for quote...
# suitescript
a
hey all - we have a custom clone process for quotes - a button is clicked on a Quote which brings up a new quote form, and a script onbeforeload pulls in the relevant data from the source quote - works great, but running into issues with Item Groups - has anyone had success adding item groups (including components) to a new sales transaction record in a server script (beforeload)? wondering if it's even possible, and seeing things like
ingroup
,
includegroupwrapper
, and
groupsetup
in the XML of a proper transaction that makes me thing we need to mimic this - ultimately it may need to be a client script, but trying to avoid that
ok, found this article which is what we'll try next: https://suiteanswers.custhelp.com/app/answers/detail/a_id/72050/loc/en_US
one day i'll learn to suiteanswer before i post here
e
Posting here and following up with the solution helps more people see and learn though 👍
a
For sure! And for the record, that absolutely did the trick. Nice that we won't have to resort to a client script here!
e
So you basically have to explode the group yourself then? Rather than just adding the item group? Am I reading that SuiteAnswer correctly?
It would be helpful if that sample code had comments about what each internal ID is
a
yes basically - useful to do if, say, you have custom fields on the components that you care about setting properly
in our case we're literally taking an existing quote with its lines and pre-populating a new quote form w/ the same line items in the beforeload
e.g. prior to setting the group-specific fields properly, the lines weren't linked such that deleting the item group header would remove the components/endgroup line.
(also we were getting an unexpected error upon saving - likely due to the naked endgroup line)
Item Groups are often such a pain, it's nice to get this as a bit of a "win" in terms of dealing w/ them in a customized setting