This topic contains 4 replies, has 1 voice, and was last updated by nikhil 6 years, 11 months ago.
-
AuthorPosts
-
February 24, 2017 at 8:05 am #5920
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 #5921
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 #5922
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 #5923
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.
-
November 29, 2017 at 8:10 pm #16414
Hi Eric
<span style=”color: #606060; font-family: Montserrat;”><span style=”font-size: 12px; background-color: #fbfbfb;”>the values are not splitting withย </span></span><span style=”background-color: #fbfbfb; color: #606060; font-family: Montserrat; font-size: 12px;”>x05 is there ant other solution</span>
-
AuthorPosts
You must be logged in to reply to this topic.