This topic contains 3 replies, has 0 voices, and was last updated by erictgrubaugh 7 years, 8 months ago.

  • Author
    Posts
  • #21816

    jerry.jalenak

    Is 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.

  • #21817

    erictgrubaugh

    You 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");

  • #21818

    jerry.jalenak

    Eric – 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?

  • #21819

    erictgrubaugh

    What 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.

You must be logged in to reply to this topic.