Where is the code of the form field?

navvynavvy Member Posts: 79
On the "Customers" form is a text field called "Contact". When a user enter a name in this field, NAV creates (automatic) a new "Contacts" row and show the new Contact No. in the form field "Primary Contact No."

To see what's happened in the "background" (which code / triggers will be executed ?) I opened the form "Customers" with the "Designer", selected the field "Contact" and choose "C/AL Code" from the right-click menu. But there is no relevant code :?: :!: #-o

Here is a screenshot

Where is the code of this field? :-k
navvy
Freelance Developer

Answers

  • MP_NAVMP_NAV Member Posts: 42
    The code is within the Customer table...the majority of the NAV code is within the table as opposed to the forms.

    Code from Customer table Contact field (NAV 5.0):


    Contact - OnValidate()
    IF RMSetup.GET THEN
    IF RMSetup."Bus. Rel. Code for Customers" <> '' THEN
    IF (xRec.Contact = '') AND (xRec."Primary Contact No." = '') THEN BEGIN
    MODIFY;
    UpdateContFromCust.OnModify(Rec);
    UpdateContFromCust.InsertNewContactPerson(Rec,FALSE);
    MODIFY(TRUE);
    END
    -MP
  • navvynavvy Member Posts: 79
    Well, that was a fast answer! :D Thanks you MP_NAV :)
    That's exactly what I'm looking for.
    navvy
    Freelance Developer
  • MP_NAVMP_NAV Member Posts: 42
    No problem, glad to contribute :)
    -MP
Sign In or Register to comment.