This topic contains 3 replies, has 0 voices, and was last updated by erictgrubaugh 7 years, 8 months ago.
-
AuthorPosts
-
February 24, 2017 at 8:05 am #21816
jerry.jalenakIs there a client event equivalent to nlapiGetCurrentLineItemValues for returning the values of a multiselect field? nlapiGetCurrentLineItemValues is only supported in user event; we have a need to access a mutliselect field in a sublist from a client event method. If there isn't an equivalent, what's the best way (if there is one) for accessing this data? We need to get the internal ID's of the selected options in the field….
Thanks!
This is a cached copy. Click here to see the original post. -
February 24, 2017 at 8:19 am #21817
erictgrubaughYou can still use `nlapiGetCurrentLineItemValue` (singular) to get the value of a multi-select, but then you will need to do some extra processing of the value. When you use the singular get method on a multi-select field, instead of returning the selected values in an array, it returns them all in a single string where the IDs are separated by a non-printing character x05. To get the values as an array, you split the resulting string on x05:
Code:
var selectedValues = nlapiGetCurrentLineItemValue("custcol_multiselect").split("x05"); -
February 27, 2017 at 12:49 pm #21818
jerry.jalenakEric – Thanks! That seemed to have gotten us past our first issue.
Follow on – it seems that SETTING a multiselect field in a custom sublist is causing the line to be 'committed' before we are ready for that to happen. My first thought was that the 'fieldChanged' event was picking the change up, so we set the fireFieldChanged parameter to false – no difference. Any idea on why this would be happening?
-
February 27, 2017 at 1:43 pm #21819
erictgrubaughWhat behaviour are you seeing that leads you to believe this? I'm not sure why setting a multi-select would behave any differently than any other field type, but that doesn't mean that's not the case.
-
AuthorPosts
You must be logged in to reply to this topic.