Page 1 of 1

ID of record

Posted: September 17th, 2016, 4:16 pm
by hamouda1987
hello good people

I have an ID in my record

PROC ID
preproc

if visualvalue(ID) = notappl then
ID = 1;

else
ID = visualvalue(ID) + 1;

endif;


when i want to modify a record the ID change and take ID=ID+1

i don't want to have this probleme
how can i do ?

kind regards

Re: ID of record

Posted: September 18th, 2016, 10:10 am
by Saint
Hi,
Set the code to work only when in add mode as follows:

Code: Select all

PROC ID
preproc

if demode() = add then
  if visualvalue(ID) = notappl then
    ID = 1;
  else
    ID = visualvalue(ID) + 1;
  endif;
endif;

Re: ID of record

Posted: September 18th, 2016, 10:33 am
by hamouda1987
thank you so much