They are explained in the forms builder online help.
This is a pure forms issue. No difference to look for in EBS.
When-New-Form-Instance: This trigger is called just after form is called. So you can do everything you need to do before the form starts. Be careful that this trigger is called only when the form is opened.
WHEN-VALIDATE-RECORD: This trigger is called when cursor is relocated out of current record of specified block to another record. This trigger can be very useful while trying to insert or update a record under some costraints. If the conditions are checked at this trigger and form_trigger_failure will be raised under the situation of failing validation, record will not be saved. So, everything works just fine.
When-New-Record-Instance: This trigger is called when cursor enters to a new record in specified block. This trigger may be useful when it is needed to set calculated value to an item at every record.
When-New-Item-Instance: This trigger is called when any of the items in the forms is entered.
Hope this helps,
Please mark replies "Correct" or "Helpful" as applicable to facilitate solutions to other community participants
Thanks for your reply
I have few more doubts here.
1. For example, I have to create a supplier (Say for example, I am creating from Payables Manager - US Resp.). But, only few users have access to create a Supplier from this Resp. So, this can be restricted by using the 'When-New-Form-Instance' right (Because, what I understood from your reply is that this trigger is fired before the form opens)?
2. I have a requirement(consider the same Supplier Creation) where Special Characters are not allowed in Supplier Alternate Name field. So here, which trigger I have to use? WHEN-VALIDATE-RECORD, When-New-Record-Instance or When-New-Item-Instance? If any of these 3 can be used, then exactly where is the difference?
Thanks in Advance,
1 person found this helpful
At 1) If you want to restrict access you should create a menu with and without this function and assign one menu to one responsibility and the other to the other responsibility. That would make a lot more sense.
That said, usually when you want to avoid the form to open on some kind of reason the PRE-FORM would make more sense. That fires BEFORE the form actually opens.
At 2) You would use when-validate-item (when the item itself is validated) or when-validate-record (when the whole record is validated). The latter fires a little later than the first of course. The first fires as soon as you navigate out of the field. The latter when you navigate to the next record or commit.
The when-new-item-instance fires BEFORE you are in the item, so you can't do a check on your item. You could use that however on the field after the field you are validating. For example when you enter the supplier name and after that the system navigates to the address, you can build logic in the when-new-item-instance on the address to check the supplier name. Why would you do that?? Because not all events actually trigger in eBS and when-validate-item may not fire in your specific form. However, your check would fail if you navigate somehwere else then from supplier to address.
Then the when-new-record-instance .. that would fire as soon as you navigate to a new record. So you have not entered anything usually or you are navigating to a record that has already been entered previously. No sense in doing validation in that case (most of the time).
I usually use
- WHEN-VALIDATE-ITEM (when the specific item is validated, so when you leave the item to go somewhere else).
- WHEN-VALIDATE-RECORD (when you save the record, it validates the whole record).
if you want to do some extra logic when you navigate to a record that has already been entered (or you query here). So open another form depending on whatever you have queried.
Hope this helps!
Hi Darwish, PamNL,
Thanks for your replies
Both are really helpful for me to understand
Thank you Bommi.
If you do not have any further questions ,please close this discussion by marking appropriate answers as Correct or Helpful.