ID of record

Discussions about CSEntry
Post Reply
hamouda1987
Posts: 9
Joined: June 14th, 2016, 7:16 am

ID of record

Post 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
Saint
Posts: 63
Joined: November 22nd, 2013, 4:59 am

Re: ID of record

Post 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;
hamouda1987
Posts: 9
Joined: June 14th, 2016, 7:16 am

Re: ID of record

Post by hamouda1987 »

thank you so much
Post Reply