tnzabo
11th November 2005, 15:50
Hello -

I'm having some difficulty displaying a value in the correct record on a multi-occurence form. I'm customizing the Enter Hours Accounting form tihra1101m0002. When I click on the insert button on the toolbar I run a function that gets the next dsrn value and I want to display it on the form on the line for the new record. In my function I do a display(tihra100.dsrn) so it does display it but it will also display it on the first line.

i.e. I have four records already for a certain person and day. The next dsrn should be 5, the function goes and gets the 5 then displays it in the dsrn field of record 1, or whichever record happens to be active, then it will display it in the dsrn field of the new record for insertion. I've attached a screen shot of what's happening.

Also - once I've inserted my entire record I may want to enter another. Since I'm doing the function to get the next dsrn on the choice.add.set it doesn't execute except if I click the insert button. What do I need to do to execute it automatically when it goes to the next record?

Thanks!

mr_suleyman
11th November 2005, 16:32
Hi , In fact you did right things but change your solution like this. In your session you
should try following things for tihra101.DSRN field events.

field.tihra101.DSRN:
before.input:
if (update.status = add.set ) then
tihra100.DSRN = CALCULATE_DSRN_number()
endif



GOOD LUCK !!!!!!!!

mark_h
11th November 2005, 16:33
Typically we do it this way:


field.tppro603.csp1:
before.zoom:
tpptc100.cprj = tppro603.nprj

before.input:
if update.status = add.set then
serial.number = read.serial.number()
search.last.used.seqn.on.screen()
tppro603.seqn = serial.number + 1
display("tppro603.seqn")
update.occ()
endif

We do this on the first multi-occurance input field. The above code goes with this post (http://www.baanboard.com/baanboard/showthread.php?t=23205&highlight=serial). Hope this helps.

tnzabo
11th November 2005, 17:25
Thanks so much for the code - it worked great!!!!