jojovalenton
13th August 2015, 13:43
hi,
ask for your advise on how i can refresh the total in the subform bec. i when the click next or previous button in the mainform and details doesn't have data, total of previous data still on display. thanks.
regards,
jojo
bhushanchanda
13th August 2015, 14:44
Hi,
In your choice.prev.set: and choice.next.set: after.choice: section, you can initialize the field. Or even in before.display.object section you can initialize the fields and then call display.total.fields() function.
jojovalenton
13th August 2015, 14:57
hi Bhushan,
thanks for the reply. your suggestion is exactly what i did already but how to address the exact location of the field in the satellite form is the problem that is why i think it's not changing because the function display.total.fields doesn't have parameter to read which form the field is belong. is there other way?
choice.next.set:
after.choice:
if not fas.exist() then
display.total.assets(emno.empty, cwoc.empty, total.qty)
display.total.fields(
"tfnpc151.aqty", total.qty)
endif
regards,
jojo
bhushanchanda
13th August 2015, 15:56
Hi,
Skip my first advice. Do this -
You can use section on.display.total.line:
Now, for every event, this section is executed. Every time you this section is called, you can calculate the totals and display it.
e.g. Sample piece of my code -
on.display.total.line:
calc.total()
display.total.fields("tdxyz002.quan",total.line)
functions:
function calc.total()
{
if (year = tdxyz002.year and month = tdxyz002.month and cpcl = tdxyz002.cpcl and cpln = tdxyz002.cpln) then
total.line=0
else
total = 0
year = tdxyz002.year
month = tdxyz002.month
cpcl = tdxyz002.cpcl
cpln = tdxyz002.cpln
endif
select tdxyz002.*
from tdxyz002
where tdxyz002.year = {:year}
and tdxyz002.month = {:month}
and tdxyz002.cpln = {:cpln}
selectdo
total.line = total.line + tdxyz002.quan
endselect
}
If your session is MMT session, then you might need prcm.* functions. If this doesn't work, please post the screen shot of your session.
jojovalenton
13th August 2015, 16:23
hi Bhushan,
thanks again. now ok. really nice.
regards,
jojo
dharmendrayadav
2nd May 2016, 09:39
hi Bushan
i am facing same problem as above my satellite session commands are not enable while click on next and previous please help, i have MMT session
dharmendrayadav
2nd May 2016, 09:43
i written enable disable command on before.display.object and before.program both
but when satellite session have no records and if i click on previous and next it commands are disable as per previous record status.
But why are you disabling the previous and next commands? Do you really want to disable it?