You need to sign in to do that
Don't have an account?

is it possible to create a trigger that allow a custom number field go in only consecutive order?
Hello,
I want to know if it's possible to create a trigger that let a number field goes only in a consecutive order,
this custome field must not be Auto-Number field because it has to be entered
Example:
the user entered a value in the number field PRE_IMPRESO__c between 001 to 100
PreImpreso: 001
PreImpreso: 002
If I try to enter 004 and 003 was not entered yet, I get the error "Pre-Impreso isn't going in consecutive order"
I would really appreciate any kind of example
thanks
I want to know if it's possible to create a trigger that let a number field goes only in a consecutive order,
this custome field must not be Auto-Number field because it has to be entered
Example:
the user entered a value in the number field PRE_IMPRESO__c between 001 to 100
PreImpreso: 001
PreImpreso: 002
If I try to enter 004 and 003 was not entered yet, I get the error "Pre-Impreso isn't going in consecutive order"
I would really appreciate any kind of example
thanks
All Answers
Put rule like below.
You can use Auto Number type for this type of requirement.
-Thanks
Ashlekh
ravi your code works perfect =)
This may not work if you are inserting records in bulk using data loader. Please test it for bulk mode once. Thanks.