chethu4u143
22nd June 2011, 17:56
Hi Baan Gurus,

I am seeing some strange thing with my multi-occurnce maintain session, I am using baan IV b2, I have to make sure sure that if there are any changes made on 3rd and 4th field then i have to make to 5th field to yes. snapshot of the session attached, I have written code for this in when.field.changes, but when we use "Extend field" options on this field, only sometimes the when.field.change get triggered and update the 5th field to yes.

Can anyone tell me why is it happening?

below is the field validation on one email field

field.iscom118.emi1:
before.input:
old.email1 = iscom118.emi1

when.field.changes:
if strip$(old.email1) <> strip$(iscom118.emi1) then
iscom118.chpd = tcyesno.yes
display("iscom118.chpd")
else
iscom118.chpd = tcyesno.no
display("iscom118.chpd")
endif

check.input:
if not before.update.check and strip$(iscom118.emi1) <> strip$(old.email1) then
iscom118.chpd = tcyesno.yes
display("iscom118.chpd")
endif


thanks in advance

mark_h
22nd June 2011, 19:35
What do you mean by extend field option? Someone can correct me if I am wrong, but the when.field.changes should only get activated when something changes in the field.

sameer.don
23rd June 2011, 08:38
"when.field.change" will be triggered every time the value input in the field differes from its original value (i.e. value before input)

Hence in your code there is no use of statement:
if strip$(old.email1) <> strip$(iscom118.emi1) then

Every time you reach the even of when.field.change, this statement will always be true.

I think this code will never change the value of field 5 to "NO"
Either try using the same code (written in when.field.change) in after.input section,
OR
Get the value of variable old.email1 from table:

field.iscom118.emi1:
before.input:
select iscom118.emi1:old.email1
from iscom118
where ...<compare index1>


I hope this might help you.

chethu4u143
23rd June 2011, 11:42
Hi Mark,

I was asking about the extend field at multi-occurrence session, only when we use extend sometimes the flag get changed to Yes. i have attached the snapshot of extend field options. have a look.

chethu4u143
23rd June 2011, 12:26
Sameer,

Thanks for your input, your point is right i have corrected it now. I wanted to know the is there any restrictions on the usage of Extend field in the Multi occurrence maintain session.

mark_h
23rd June 2011, 17:05
I have not been able to find any help on the extend field and what it does. Have to do some more poking around. I did notice on the sessions I have looked at they all have this enabled. My first thought is if you make a change in the field make sure you hit the tab key.

Hitesh Shah
25th June 2011, 07:17
Check input code is not required for setting the value of other field , though it does not do any wrong now . Redundant check in when.field.changes is already removed. Following can be situations .
1. Field order could be wrong . Field being changed (iscom118.chpd) should be subseqent to input field iscom118.emi1 .

2. before input/display of iscom118.chpd has some other code changing it or some other code in overall code changes it to other or program never reaches the field being changed.e.g User changes the record occurrence by up/down arrow key immediately after field change .

3. Ideally changes to other field in current record should be done through a function in a pattern like do.occ(actual.occ,functionname) . This w