Customer Card - Implementing Mandatory Fields

Gon_M.Gon_M. Member Posts: 34
Hi experts:

I'm trying to implement mandatory fields in customer card. I chose this alternative:

- DelayedInsert = Yes, in Customer Card Form
- Validate code into the customer card

it worked fine, but I have a problem because I have to validate the contact field, which insert the new contact as a contact of the new customer, but this new customer don't have "No.", because new customer was not be inserted yet, so I obtain an error who say that doesn't exist the customer No.=''.

Someone have a symilar problem?

Thanks in advance.

Answers

  • ara3nara3n Member Posts: 9,256
    Yes.
    I would suggest to set the customer by default to blocked. Add your logic on the validate of the blocked field. And remove the delayed insert property.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • David_CoxDavid_Cox Member Posts: 509
    One way to do this is on the form triggers, test the Contact No. field.

    Allow the user to Insert without the Check but not close or move the record navigation

    Form - OnQueryCloseForm() : Boolean
    IF "Contact No." = '' THEN
    EXIT(FALSE);

    You will also need it on some of these
    Form - OnNewRecord(BelowxRec : Boolean)
    Form - OnInsertRecord(BelowxRec : Boolean) : Boolean
    Form - OnNextRecord(Steps : Integer) : Integer
    Form - OnModifyRecord() : Boolean
    Analyst Developer with over 17 years Navision, Contract Status - Busy
    Mobile: +44(0)7854 842801
    Email: david.cox@adeptris.com
    Twitter: https://twitter.com/Adeptris
    Website: http://www.adeptris.com
  • Gon_M.Gon_M. Member Posts: 34
    Thank you for reply .

    I'm going to try ara3n's solution because is more compatible with my scenario.

    Thank you again.
Sign In or Register to comment.