OnlookUp trigger In Navision

I have written some code in Onlookup trigger and Lookup functionality is working fine but Value is not assigning to field.

The base Tables are Contact Business Relation And Contact

Code is

ContactBussinessRelation.SETRANGE(ContactBussinessRelation."Link to Table",ContactBussinessRelation."Link to Table"::Customer);
ContactBussinessRelation.SETRANGE(ContactBussinessRelation."No.","Bill-to Customer No.");
IF ContactBussinessRelation.FINDFIRST THEN
    Contact.SETRANGE(Contact."Company No.",ContactBussinessRelation."Contact No.");
    //Assigning Value to field 
    "Participant contact No.":=Contact."No.";

Does the form have the Ok button? Is it opening in the correct lookup mode?

What is the context you are calling this from? Have you ran it with the debugger, to see if it execute your assignment line? Depending on the context, you may need a modify.

I am also moving this question from the DUG Membership Question forum (questions about your DUG membership), into the Developer forum, in what is now called Dynamics 365 Business Central/NAV user group.

There was something that make me make damn last classic NAV versions… when I designed a table and programed some code in OnLookUp, it looked like not work when I tested it. I don’t know why but this don’t work if you run a table directly from object designer, but if you run this through a form, yes, it works as expected!!! Try to test your code in a form.