This topic contains 4 replies, has 1 voice, and was last updated by nikhil 6 years, 9 months ago.

  • Author
    Posts
  • #5920 Score: 0

    jerry.jalenak
    • Contributions: 0
    • Level 1

    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.

  • #5921 Score: 0

    erictgrubaugh
    • Contributions: 0
    • Level 1

    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”);

  • #5922 Score: 0

    jerry.jalenak
    • Contributions: 0
    • Level 1

    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?

  • #5923 Score: 0

    erictgrubaugh
    • Contributions: 0
    • Level 1

    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.

  • #16414 Score: 0

    nikhil
    Member
    • Contributions: 1
    • Level 1
    @nikhil_jain

    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>

You must be logged in to reply to this topic.