rduncan10
18th October 2011, 16:57
I have a type 3 display form and I want to add column that will do a column that will do a calculation for each row.

My problem is that with the code below, the value for the calcualted fields is the same for all the occurances of that field on the screen. I will get something like:

Item:ABC123 Stock: 123
Date Trans Expected Inv [Should be]
10-18 5 128 [128]
10-19 6 128 [134]
10-20 7 128 [141]

My code looks something like this (This is Baan IVc4, so no query extensions).

main.table.io:
read:view:
exp.inv = tiitm001.stoc

before.read:
exp.inv = exp.inv + tdinv150.qana

I tried putting the calculation in before.field too, but then the number keeps changing as I scroll through the records.

This is similar to tdinv1550m000, Display Planned Inventory by Item, where the expected inventory is calculated for each line.

Thanks,
Rob

Hitesh Shah
18th October 2011, 19:16
In tdinv1550m000 , the value is calculated for date and not line . So for a given date , all lines will have same value . If u set exp.inv in before.read do.occ.without.update(actual.occ , function) , it may work . U may also try before.display for actual.occ = 1 when choice is in one of following - next.set,prev.set , half , first , last etc . And for other occurrence , use ur method .

Also before display is excuted in mark.occur or do.occ or do.all.occ etc which need to be taken care off also.