cancel
Showing results for 
Search instead for 
Did you mean: 

generate number

ahmedelgammal5334
Participant
0 Kudos

hi, is there another way to generate number for instances instead of NumberRange library ?

View Entire Topic
former_member210407
Active Participant
0 Kudos

Hello Ahmed,

What are you trying to achieve that can not be achieved with NumberRange RL?

Best regards,
Ben

ahmedelgammal5334
Participant
0 Kudos

Hi Ben,

NumberRange is fine but when i update any instance the counter is incremented automatically i want to keep the original value.

Best regards,

Ahmed

former_member210407
Active Participant

You only have to call NumberRange if your external key is not set yet.
Adding something like bellow snippet could be enough.

if(this.ID.IsInitial())
{
this.ID = NumberRange.DrawNumber("MyNumberRange");
}
ahmedelgammal5334
Participant
0 Kudos

fine, I'll try it.

another thing .. i have another field but it's manually the user have to enter the value but i want to make it 4 digits only .. do you know how to do it ?

(update) it works just fine, thanks ... if you know how to do the 4 digits thing that would be perfect.