nolihayati isma
17th June 2013, 07:33
Hi All

field.tsrep124.plan is last input field. So in after.field, i execute(update.db) or execute(start.set).Both executes save the record but the cursor moved to seq no 2 which already in table.
Cursor should move to new record and ready for new record.

1) field.tsrep124.plan:
after.input:
execute(update.db) or execute(start.set)
=> record save but cursor moved to seq 2.

2) Also try to use execute(add.set), but error recursion not implemented pop up.

If I added to.field after the update.db, cursor will moved to tsrep124.prin but at 1st seqn record.

field.tsrep124.plan:
after.input:
execute(update.db)
to.field("tsrep124.prin")

current record save but cursor moved to field prin at 1st seqn record

I need cursor moved to next seqn and save previous record.

Please assist me.

i attached the code in attachment.

bartman
18th June 2013, 10:30
Hi,
as I understand your problem, you will force your session to save data on every change in occurrence.

Following code might be right for you:

after.form.read:
enable.save.on.occ.change()

Regards

nolihayati isma
18th June 2013, 11:23
Hi,

Thank you for your feedback but there still no luck of me.
may be this suggestion option not available in Baan IV. I having compilation error.

The error is:
Unresolved reference to function 'enable.save.on.occ.change'

nolihayati isma
18th June 2013, 11:58
Hi,

Thank you for your feedback but there still no luck of me.
may be this suggestion option not available in Baan IV. I having compilation error.

The error is:
Unresolved reference to function 'enable.save.on.occ.change'

nolihayati isma
18th June 2013, 16:09
Hi,

problem resolved by myself by using db.insert and refresh.cur.occ in the after field.

The issue rectified as per code below:

field.tsrep124.plan: | This is last input field
after.input:
if tsrep124.plan = tcyesno.yes then
refresh.curr.occ()
tracking()
db.insert(ttsrep124)
commit.transaction()
endif

Special thanks to Bhushan Chanda & Bartman for your help and give me the idea to resolved it.

mark_h
18th June 2013, 16:41
Thanks for posting the solution. What does the tracking routine do?

The reason I ask is because I have a situation where moving between forms is not to clean. Even the baan standard sessions don't work the way they want me to code it - so anything might give me something else to try.

bhushanchanda
18th June 2013, 18:09
Glad to see this. Finally you managed to solve it! :)

nolihayati isma
19th June 2013, 05:40
Hi Bhushan,
Thank you to you too.

Hi Mark,
The requirement is to block duplicate serial number during data entry. The problem is this serial no not defined as index.

What i do is, i create function to check the existing serial number entered.
and the last of input field, i code as above code.

Before i added refresh.curr.occ(), when the cursor move into the last field(in current seqn), I get message "record already exist (Ok/help) and when i clicked ok, cursor moved to next seqn ready for new data entry but prev seqn which just entered, not display. I just get to see the prev seqn by click edit, fresh.

Bartman advise me to add after.form.read: enable.save.on.occ.change() but this not available in Baan IV c4. and found this refresh.curr.occ in google.

With this stamement, the message disappear, record displayed and new entry not able to enter the same duplicate serial number.

Waiting customer to test hope not other impact to other module since this screen having a lot of 6 subsession/link.

Thank you to all.