mig28mx
20th August 2008, 02:32
Hello all,
I´m facing with the following problem:
I have a maintenance session, that insert data to a table.
The table have the fields:
conc (enumerated)
year
prod
iaaj (tfgld.amnt domain) Import (display only)
imaj (tfgld.amnt domain) Adjustment
idaj (tfgld.amnt domain) Import after adjustment (display only)

I need that, when I insert a record, the field iaaj, shows the balance of a ledger account (already done).
Then, put an ammount on Adjustment field, and the field idaj shows the operation idaj = iaaj + imaj

The problem is, when I delete one record, the iaaj and idaj stills on scren even if I insert a new record!

I need that all the fields must be initialized before I add a new set.

Here is my code.
Any sugestions?
Thank you in advance.

field.all:
before.input:
refresh()

field.tfcmg883.peri:
when.field.changes:
if tfcmg883.conc = tfgld.conc.iva.retenido then
cta.debe = 0
cta.haber = 0
cre = 0
deb = 0
tot = 0
saa = 0

select tfcmg877.*
from tfcmg877
| where tfcmg877._index1 = {" "}
as set with 1 rows
selectdo

select tfgld206.year, tfgld206.leac, tfgld206.fobh, tfcmg877.leac
from tfgld206, tfcmg877
where tfgld206.year = :tfcmg883.year
and tfgld206.leac = tfcmg877.leac
selectdo
saa = saa + tfgld206.fobh
selectempty
saa = saa + 0
endselect

select tfgld201.year, tfgld201.prno, tfgld201.ptyp, tfgld201.leac, tfgld201.fdah, tfgld201.fcah
from tfgld201
where tfgld201.year = :tfcmg883.year
and tfgld201.prno inrange 1 and :tfcmg883.peri
| and tfgld201.prno = :tfcmg883.peri
and tfgld201.leac = :tfcmg877.leac
and tfgld201.ptyp = tfgld.ptyp.financial
selectdo
cre = cre + tfgld201.fcah
deb = deb + tfgld201.fdah

endselect


endselect
tot = cre - deb - saa
tfcmg883.iaaj = tot
display.all()
refresh()
tot = 0
endif

manish_patel
20th August 2008, 07:53
Field Type of the fields iaaj and idaj should be "Display". Change the Field Type to "Display" from "Display only" in the maintain Form Fields session. That will solved your problems.

-Manish

vaishali_sftdev
20th August 2008, 10:01
Hi!
Although, this post is an older one. But it would be helpful if someone explains that how Display only and Input only are different than Display and Input resp..
Thanks.

kaukul
20th August 2008, 11:51
Hi!
Although, this post is an older one. But it would be helpful if someone explains that how Display only and Input only are different than Display and Input resp..
Thanks.

Hi,

Please refer BaaN inbuilt help for the same. Following is its extract:

Display only: Only when the 4GL function display("<field name>") is used in a program script, this field will be displayed.
Input only: Only when the 4GL function input("<field name>") is used in a program script, user will be allowed to input in this field.

ranjankool
20th August 2008, 14:53
Hi,

I think you should try db.set.to.default(long table_id) for set to default values defined in the data dictionary.

manish_patel
21st August 2008, 06:20
Hi,

I think you should try db.set.to.default(long table_id) for set to default values defined in the data dictionary.

No, I don't think so. When user click insert option; system makes it defaults but that value is not getting display on the form as field type is defined as "Display Only". As suggest by kaukul we have to use the 4GL function display("<field name>") in a program script to display this field. Otherwise simply make field type to "Display".

-Manish

sambhajidg
21st August 2008, 11:58
field.tfcmg883.peri:
before.field:
if db.update = add.set or delete.set the
inintialize your varibles
endif


good luck.
Sambhaji

vaishali_sftdev
21st August 2008, 12:26
Thank u kaukul. It was quite helpful.

mig28mx
21st August 2008, 17:16
Hello All,
Thank you very much for all your suggestions. With them, I was able to fix the problem and obtain the desired result.

Again, thank you all.