Netsuite Tutorials: Do you know interesting fact about Employee, Contacts , Groups, vendors , customers , Partners, Other Name ?
Hi All,
I have very interesting things to share with you related to Prospects , Customers, Contacts, Projects, Vendors , Employee and few more.
Many People do not notice but these belong to same table called entity. What it means is that there will no 2 similar record. It means There will be no 2 same internal id , For Example : if we already have customer with internal id 2 then there will be no other entity with internal id 2. It can be 3 , 4 ,5 etc but not 2.
I have very interesting things to share with you related to Prospects , Customers, Contacts, Projects, Vendors , Employee and few more.
Many People do not notice but these belong to same table called entity. What it means is that there will no 2 similar record. It means There will be no 2 same internal id , For Example : if we already have customer with internal id 2 then there will be no other entity with internal id 2. It can be 3 , 4 ,5 etc but not 2.
Why this is important to understand?
At Many places we use Vendor , employees and customer in same drop down. Developer have to write logic to get details from vendor , employee , customer etc . Logic include making a function and then search which kind of entity it is and then load or search record's data.
We can also use try catch to load or look up entity's data and use try catch inside catch also load or look up if another type of entity drop down have .
Let me explain with example:
Requirement: If Check is for Employee then get Data from Employee record.
Solution:
Here if we know that what ever is coming in field Payee , if it is employee then only we need data .
One way is to write a search on employee and check if employee with internalid (from payee dropdown) exist then proceed .
Another way is that simply load employee record inside try and inside catch return null in function .
If it is employee then script will get details else it will throw error and we can neglect :)
This is not a very good way to code but one of the way to code.
Best way to do is search first for type and then proceed.
Thanks
Abhi
Comments
Post a Comment
Thanks for you message, please join us on Facebook and Linkedin