Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics NAV (Archived)

Create a Record for Each Customer

Posted on by Microsoft Employee

I Have a Table Called "Manufacturer " With two Fields,  "Code" and "Name". 

Within the Job Queue Management I want to essentially create a record for each Customer. The Code would be the Customer "No." and the name would be the Name of the Customer's "Name". 

Customer No. = Code

Customers name = Name

How would this be written? Thanks 

Variables*

recCustomer

recManufactuer

*This post is locked for comments

  • Verified answer
    Binesh Profile Picture
    Binesh 7,885 on at
    RE: Create a Record for Each Customer

    Hello,

    Follow the polo solution, you can also use my solution, this has little bit fast.

    RCustomer -> Record -> Customer

    RManufacturer-> Record -> Manufacturer

    RCustomer.RESET;

    RCustomer.SETCURRENTKEY("No.");

    IF RCustomer.FINDFIRST THEN

    REPEAT

    IF NOT RManufacturer.GET("RCustomer."No.") THEN

    BEGIN

     RManufacturer."Customer No.":=RCustomer."No.";

     RManufacturer."Customers name":=RCustomer."Name";

     RManufacturer.INSERT;

    END;

    UNTIL RCustomer.NEXT = 0;

  • Verified answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Create a Record for Each Customer

    Hi,

    probably a codeunit  (run frequency / condition as you like)

    RCustomer -> Record -> Customer
    RManufacturer-> Record -> Manufacturer

    RCustomer -> Record -> Customer
    RManufacturer-> Record -> Manufacturer
    
    RCustomer.RESET;
    IF RCustomer.FINDSET THEN REPEAT
     RManufacturer.RESET;
     RManufacturer.SETFILTER("Customer No.",RCustomer."No.");
     IF NOT RManufacturer.FINDFIRST THEN BEGIN
      RManufacturer."Customer No.":=RCustomer."No.";
      RManufacturer."Customers name":=RCustomer."Name";
      RManufacturer.INSERT;
     END;
    UNTIL RCustomer.NEXT = 0;



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