This topic contains 6 replies, has 0 voices, and was last updated by jatm@cm 6 years, 12 months ago.

  • Author
    Posts
  • #21498

    jatm@cm

    Have a fairly simple script setting the line level location on items within a transaction based on a few parameters (example of the line set below but it is simple).

    This is triggered by an on entry workflow action. Which is absolutely fine for the main subsidiary (UK), however for the other subsidiary (US) the script runs (and logs and returns a value) however the lines are not set.

    I cannot understand how the script runs fine for one subsidiary but for the other seemingly it just doesn't commit the lines?

    Is there some quirk I am missing ?

    Code:

    for(i=1; nlapiGetLineItemCount('item')>=i;i++)
    {
    nlapiSelectLineItem('item',i);
    nlapiSetCurrentLineItemValue('item', 'location', loc , false, true );
    nlapiCommitLineItem('item');
    }
    This is a cached copy. Click here to see the original post.

  • #21499

    mwhite@hgyp.com

    Is it running as Administrator? I had this problem when the user's permissions didn't allow them to see the location or subsidiary in question.

  • #21500

    jatm@cm

    Yes it is running as Admin, and audience is set to all Subsidiaries.

    Oddly I have noticed similar behavior on another workflow action, it executes without issue for the main subsidiary but does not run properly for the other subsidiaries.

    Feel like there is either something odd about the behaviour for a non main subsidiary or I am missing something blindingly obvious…

  • #21501

    mwhite@hgyp.com

    I'm doing this with a user event script (no workflow) that fires on field change. It's been pretty solid.

  • #21502

    jatm@cm

    There is a backup to set the lines but the issue is that there is further automation on the orders and the location needs to be set on creation.

  • #21503

    pcutler

    Is the line-level location field applied to the custom form used by one subsidiary and not the other?

  • #21504

    jatm@cm

    Originally posted by pcutler

    View Post

    Is the line-level location field applied to the custom form used by one subsidiary and not the other?

    Yes but they each have their own locations, with the location variable being determined by the subsidiary.

    What I am seeing is if a script is run on the non main subsidiary during creation it doesn't set the values, if the same script is run either; not during creation (eg Schedule or UI) or during creation but on the main subsidiary it does work as expected.

You must be logged in to reply to this topic.