Is there a way to exit out of the OnInsert trigger without inserting a record and returning an error condition? What I'd like to do, is that if one of the field's in the record to be inserted is blank, then don't insert the record (ie. just ignore inserting it). I don't want to use ERROR('') because this returns an error condition that prevents further data entry on a form.
If this can't be done in the OnInsert trigger, then perhaps someone can suggest a different solution?
I have a list form with variable fields in a header section that I'm using as filters for fields on the form. My problem is that after entering each field filter, a new blank record is created (that I don't want). This occurs because I have in each fields' OnAfterValidate trigger:
SETFILTER("<fieldname>",<field>);
CurrForm.UPDATE(FALSE);
After entering a field, the form gets re-filtered according to the value entered, but also a new blank record gets inserted after the CurrForm.UPDATE(FALSE) statement. If I remove the CurrForm.UPDATE statement, blank records don't get inserted, but then the form doesn't update with the filtered field, either.
0
Comments
My world: Dynamics NAV,SQL and .NET
CEO at Solving Dynamics
http://www.solvingdynamics.com
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
or without message prompt
This will rollback all, even task completed before .INSERT(TRUE);
Peter Ng