mmtmalone
8th January 2015, 21:51
I need to perform a certain function but only if the user is in insert mode. How do I check to see if they are insert/add mode to determine if I need to do the function?????

Can I just do: if add.set????

sachinbaan
9th January 2015, 05:15
Hi,

you can use if choce = add.set then
...
endif

jayugandhi
9th January 2015, 07:45
Hi,

you can use if choce = add.set then
...
endif

if choice = add.set then
...
endif;)

soumya093
9th January 2015, 08:10
You can do update.status = add.set also

bhushanchanda
9th January 2015, 11:08
Another way is:-


main.table.io:

before.write:
|* place 'insert' related actions here.
|* example, increase first free number count.

before.rewrite:
|* place 'update' related actions here.

You don't need to add a commit.transaction() as the save button will do that for you. Also, if on LN, you can use DAL/before.new.object section in UI Script.

Related Thread (http://www.baanboard.com/baanboard/showthread.php?t=63698) for more ideas.

mmtmalone
9th January 2015, 23:38
i'm using the if choice = add.set then
perform the function.
my problem seems to be that the user wants the field on the form to reflect the value that was updated if the function was performed. So when the user tabs through all the fields then it should pick up the value when it is an insert.
in some cases, that doesn't seem to be working right.
Here is where I've put the if statement but when I put it in debugger, it doesn't seem to be hitting this at the appropriate time.
Any suggestions?????

field.aditm999.cmrq:
before.display:
if choice = add.set then
check.conflict.reqd()
refresh()
endif

mmtmalone
10th January 2015, 00:35
I just realized that I should have put this under before.field instead of before.display

bhushanchanda
10th January 2015, 04:02
Hi,

Yes. before.display and refresh cannot go together. Also, you can try writing it in

choice.update.db:
before.choice:

Or, when.field.changes or check.input or after.input. Whatever works for you.