- if (scriptContext.type == scriptContext.UserEventType.CREATE), then check whether it is a vendor bill.
- Get the values of vendor and reference number from the current record.
- Create search to get the count of reference number which is entered in the vendor bill. Return the count.
var searchBillResultCount = vendorbillSearchObj.runPaged().count;
return searchBillResultCount;
- If count is greater than zero, then throw an error in the csv response file.
- Otherwise, if count equals to zero then record is imported successfully.