I am working on purchase order automation. So, I am reading data from excel and entering the data into Netsuite the issue I want to put an exception if I enter the wrong entry in the NetSuite and it will stop that entry and move forward to the next entry.
After entering the purchase order, use element exists activity (variable name boolresult) and Indicate the wrong purchase order message and after that use an if activity and give condition as not boolresult,in the then part do your process and in else it will skip the process.
or put an try catch inside for each row and catch any exception and continue with the next iteration
please check that excel sheet first I am reading data from the excel sheet.
first entry is successfully saved in Netsuite.
while entering the second entry it gives me the popup No match you can check the snapshot.
So, what I need here is it stops here and writes a log message that PO is not generated and goes forward for the next entry.
Any solution for that because i tried lot but not getting any solution
You don’t specifically need try catch solutions for this, although they are usefull.
If your exception comes at a predictable point in your process you can use things like find element or element exists to detect if a specific error popup occurs. If no, just continue. If yes log your message, cleare the popup and continue.
Try catch can do the same, but is better for more… unexpected or complicated errors.
As stated in previous posts: your try block is your set of regular steps if all goes well. Your catch block are the steps that you undertake if it goes wrong. In your case the activities to log the exception. What I suspect, based on your description, is that you do not reset your UI for the next transaction. (Clicking the popup, making sure you can continue with the next order line)
But using try catch or element exists it comes down to 1) detecting your error, 2) handling the error and 3) making sure your UI is set for the next steps again.