Joy Conner
7th July 2003, 16:15
I have placed a button on the Maintain Item Master form. When the user presses the button a function is called to recalculate the weight. Consider the following code...

choice.user.3:
on.choice:
tiitm001.wght = 20
update.occ()

My understanding is that the system will save the new value but when I navigate to the next record, then back to the record I changed, the data is not saved.

Thanks in advance for any help.

mark_h
7th July 2003, 16:23
I have not done something like that before, but wouldn't you needed to use EXECUTE(UPDATE.DB) after the update.occ?

Mark

Joy Conner
7th July 2003, 16:35
I just tried adding the execute(update.db) and there is no change in the program's behavior.

I am running IVc3. Could this make a difference?

mark_h
7th July 2003, 18:10
I was just reading the help for update.occ (http://www.baanboard.com/programmers_manual_baanerp_help_functions_form_and_form_field_operations_update_occ). I am not even sure you need the update.occ for the item master. I wonder if in debug mode when you execute(update.db) if something does not reset the weight.

Mark

dorleta
7th July 2003, 18:55
I`d do of the next way:

main.table.io:
after.rewrite:
tiitm001.wght = 20

choice.update.db:
after.choice:
display.all()

For example. Update.occ() is used in forms of type 3 , when you modify some field of the table and you want to avoid one message "modified by another user " (or somethingseemed I use the spanish version).

Joy Conner
7th July 2003, 19:23
Thank you Dorleta. I suspected that the command was limited to Type 3 forms given it's name *.occ .

But in previous postings about update.occ() it was inferred that the update.status value can be manipulated using this command. Is there a similar command that enables manipulation of the update status value for Type1 or Type2 forms?

wgarcia
26th July 2003, 20:06
for type 1 form you must work with do.all.occ(), create a new function in wich you must use update.occ() command. In this function the [execute(update.db)] clause must been execute.

example:

baan code:

choice.cont.process:
after.choice:
do.all.occ(update.rec)


functions:

function update.rec()
{
update.occ()
tccom000.nama = "new value "
execute(update.db)
}