+ Start a Discussion
Rick RollRick Roll 

N>Help [Stop Batch.Execute and Jump to Batch.Finish if Condition in Execute is Met]

I have a batch class which we use to save data from csv to different objects. In the batch.execute, I put a condition to check if a data to be inserted meets the data type of the field its going to save. It returns a value (true or false). My problem is how do I jump from batch.execute to batch.finish if the condition returns false to prevent from inserting all other data.

How do I jump from Batch.Execute to Batch.Finish?​