This topic contains 3 replies, has 0 voices, and was last updated by Olivier Gagnon NC 7 years, 5 months ago.

  • Author
    Posts
  • #5725

    david.mendoza

    Good Morning Team.

    When using nlapiLoadRecord in a script and do not use nlapiSubmitRecord, does this have any negative impact on the record?

    Thanks.
    This is a cached copy. Click here to see the original post.

  • #5726

    david.smith

    No. Unless you want to count the time to execute the load feature. nlapiLoadRecord is one of the most time consuming commands in the API.

  • #5727

    david.mendoza

    Can you elaborate why its one of the most time consuming commands in the API?

    Thanks.


    david.smith replied on 05/24/2017, 11:41 AM: Because it has to load the entire record.

    If you do an nlapiLookupField or nlapiSearchRecord it will be faster because you’re only pulling the data you need, not everything. If you’re not modifying the record, don’t load it unless you need the entire record.

    I had to optimize a very large sales order script (not written by me) once because it was timing out. During this optimization I was able to investigate best methods for retrieving data used. Replacing the load feature with searches significantly improved the scripts response time.

  • #5728

    Olivier Gagnon NC

    Super edge case: if you’re using LoadRecord in a script type that triggers other scripts (ex: scheduled script), and the record loaded as a script deployed on the BeforeLoad trigger point, you could cause something to happen.

    Otherwise, yeah. Like David said, it’s a costly thing to do, performance-wise.

You must be logged in to reply to this topic.