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

  • Author
    Posts
  • #21658 Score: 0

    david.mendoza
    • Contributions: 0
    • Level 1

    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.

  • #21659 Score: 0

    david.smith
    • Contributions: 0
    • Level 1

    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.

  • #21660 Score: 0

    david.mendoza
    • Contributions: 0
    • Level 1

    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.

  • #21661 Score: 0

    Olivier Gagnon NC
    • Contributions: 0
    • Level 1

    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.