indian_sumesh
24th June 2009, 09:23
Baan Friends

I have multi occ form with non table fields

Problem is when i add/insert a record all the previous values of non table field
changes to newly entered value and same at the tome of read records from table last value is populated in all non table field occurances

main.table.io:
after.read:
if prsl = tdtbwilc.prsl.project then
cprj = tdtbw103.cprj
else
sono = val(tdtbw103.cprj)
endif

Pls. help.

Regards
Sumesh

mark_h
24th June 2009, 14:41
I do not think you can do this for a multi-occurance form, well unless they are display only fields. If these are display only fields then you can use the after field to populate the value. Below is a sample of how I populate item description. Remember this gets run for each occurance as it is displayed.

field.tdexi010.item:
after.display:
select tiitm001.dsca
from tiitm001
where tiitm001._index1 = {:tdexi010.item}
as set with 1 rows
selectdo
endselect

You have to remember the form only knows about sono - you must determine the value as each record is displayed. This only works for display fields.

loveneesh
26th June 2009, 09:31
Update your variable in before.display

Change you code as given below
field.cprj:
before.display:
if prsl = tdtbwilc.prsl.project then
cprj = tdtbw103.cprj
else
| otherthan cprj value
endif

field.sono:
before.display:
if prsl <> tdtbwilc.prsl.project then
sono = val(tdtbw103.cprj)
else
| sone value
endif