This topic contains 6 replies, has 0 voices, and was last updated by sveselinovic2621 7 years, 11 months ago.

  • Author
    Posts
  • #6301 Score: 0

    sveselinovic2621
    • Contributions: 0
    • Level 1

    Hi all,

    I have a requirement where I need to trigger some code when a record is created via the nlapiTransformRecord call. This in particular applies to the ‘Item Fulfillment’ record.

    I apologize if this is a duplication post, which i’m sure it is. Any advice on how to achieve this? The typical user event to create event is not triggering, like it does on other records.

    For example:

    var itemFulfillment = nlapiTransformRecord(‘salesorder’, recordId, ‘itemfulfillment’);

    nlapiSubmitRecord(itemFulfillment); // < --- This does not execute my user event script attached to it
    This is a cached copy. Click here to see the original post.

  • #6302 Score: 0

    Olivier Gagnon NC
    • Contributions: 0
    • Level 1

    You need to execute the nlapiSubmitRecord from either a Scheduled Script or a Suitelet/Restlet. User Event and client scripts do not trigger scripting on the target record when they submit.


    sveselinovic2621 replied on 07/25/2016, 11:32 AM: Thank you Oliver,

    Unfortunately we are not the ones performing this call, our warehousing software provider, WMS, is. Are there any workarounds to this?

    /sv

  • #6303 Score: 0

    khultquist
    • Contributions: 0
    • Level 1

    One workaround idea: if you can wait up to 15 minutes, you can run a scheduled script and get the trigger to fire.

    You might also be able to deploy/schedule a scheduled script from your user event.

  • #6304 Score: 0

    Olivier Gagnon NC
    • Contributions: 0
    • Level 1

    Yeah I agree with khultquist, that’s the only workaround I see. You’ll need to have a schedule script edit/save all your records. It’s a really, really bad workaround, but if that’s all you got to work with, it’ll do. You may need to recode some of your script though, for example if you have logic that needs to run on create only. Technically while coming in as an edit, the scheduled script would be the first execution for these records and so should be considered a ‘create’. So, you’ll need to consider that.

  • #6305 Score: 0

    pcutler
    • Contributions: 0
    • Level 1

    Since this is third party code, check if the third party code is taking any other actions that trigger other UE scripts. If so, you may be able to piggy-back off of those.

    Also, if the 15 minute wait time is unreasonable, you can have an external process that calls a restlet at the frequency of your choosing.

  • #6306 Score: 0

    david.mendoza
    • Contributions: 0
    • Level 1

    I have a similar problem with WMS, in which workflows or user events are not firing after the Item Fulfillment record is created.

    When the Item Fulfillment record is created via WMS, the context is “Script (Suitelet).”

    Any inputs?

  • #6307 Score: 0

    sveselinovic2621
    • Contributions: 0
    • Level 1

    Originally posted by david.mendoza

    View Post

    I have a similar problem with WMS, in which workflows or user events are not firing after the Item Fulfillment record is created.

    When the Item Fulfillment record is created via WMS, the context is “Script (Suitelet).”

    Any inputs?

    Hey David,

    Interestingly enough, I ended up piggybacking off of the actual Ship Manifest Record. The item fulfillment record we needed was created after the ‘PACK’ procedure, if you’re outside of the ERP system. I was able to accomplish what i needed doing the following.

    Upon WMS Ship Manifest After Submit (post-committal), find all of the item fulfillment records I need to work with

    Build an object containing my data points

    Do stuff [for the lack of a better term]

    Best of luck

You must be logged in to reply to this topic.