Search record or look up record or load record.Which is better?

Hi All,

Most people don't know but "Search Record", "Lookup Record" and "Load Record" do almost similar task, I am not saying exactly same but we can use any one of 3 for getting data. They all require record type and record id. I already explained Usage related to each Here.

nlapiLoadRecord or equivalent in Suitescript 2.0 

when we use this API , it actually load everything including all related sublists also. Now only object which is visible to us , it also load many values which is not accessible to script . So when we use this API we actually load every thing unnecessarily. We should use this only if we need this api or we have to Submit after making change. Developers should avoid using Load API inside loop if possible and it will slow down the process.


nlapiLookupField or equivalent in Suite Script 2.0:

This API is like a search for body field, Performs a search for one or more body fields on a record.  You can join records using "join_id.field_name". There is limitation on long text field and other limitation is that you can only get body field. This api is best to use if you need only few fields. 


nlapiSearchRecord or Equivalent in Suite Script 2.0

This is the best API to use if you want to get some data from other record, Search usually provide access all body field and line item fields too. You can write formula, join records, use PL/SQL inside Search, you can even add more filter if needed. In this Approach we are only getting data which we need for our use, it will take less time to process and increase efficiency. Do not forget to consider Local and Global variable concept when you do search record .

Please let me know if you have any query or have something to add .

Thanks
Abhishek


Comments