Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics NAV (Archived)

Creating New Record from OnClosePage

Posted on by Microsoft Employee

On the OnClosePage of the customer card I have code which should check a table to see if the Customer No. Exists and if not create a record in the table with the details below.

However It doesn't appear to work, how can I amend the code?
RESET;
IF Rec.FINDSET THEN BEGIN
recmanufacturer2.RESET;
recmanufacturer2.SETRANGE(Code, "No.");
IF NOT recmanufacturer2.FINDFIRST THEN BEGIN
recmanufacturer2.Code := Rec."No.";
recmanufacturer2.Name := Rec.Name;
recmanufacturer2.INSERT;
END;
END;

Thanks!

*This post is locked for comments

  • Verified answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Creating New Record from OnClosePage

    Resolved!

    Soloution....

    recmanufacturer2.RESET;

    recmanufacturer2.SETRANGE(Code, "No.");

    IF NOT recmanufacturer2.FINDFIRST THEN BEGIN

    recmanufacturer2.Code := Rec."No.";

    recmanufacturer2.Name := Rec.Name;

    recmanufacturer2.INSERT;

    END;

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans