I get it. This part is not in this plant, so no rows are in the tableset.
But how do I make the function not crash when this happens? If there are no rows, I still want the function to keep processing (I’ll set the variable to false in that case).
@Evan_Purdy Perhaps that answers your question also, but I tried tsPartPlant.Count and I get errors. (Expand the arrow.) I may have the syntax wrong.
Pics of errors
I looked at GetRows. That is intimidating. GetByID has a nice simple 3 parameters to deal with. GetRows has 26… You just do “ignore” for like almost everything?
The error is coming from the GetByID call itself nothing after it is causing it. If you don’t want the error you need to stop using GetByID (or check if the record exists and skip the GetByID all together if it doesn’t)
To use GetRows you need to pass in a whereClause in your case for the PartPlant WhereClause you can leave the rest of the whereClauses as ignore that’s fine
Perhaps the easiest thing to do for you since you are taken a back by GetRows, is check if the record exists (yourself) by using a condition Query and if the record doesn’t exist then skip around the logic.
Gotcha, I see that now. If GetByID will fail then using it will always crash the function, game over. I need to use it correctly or skip it altogether.