Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics NAV (Archived)

Warning message on Purchase Order

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hello Experts,

Stuck in one scenario need your help i am using NAV 2009 R2  in it  have added one Boolean field in Purchase Header and another Boolean filed in Purchase Line.

If Boolean filed from Header is (ticked) Yes then updating all Boolean filed in Purchase line.

Functionality working fine but when i am clicking on Boolean filed from header one warning message comes up as "Do you want to Rename the record?" if i click on Yes getting error as "You cannot rename a purchase line. (select refresh to discard errors) " and if i click on No then my functionality works properly.

Have googled for this issue and found that if we are trying to update primary key filed from table this warning message comes up. but here i am not updating primary key.

Anyone can suggest solution for this please. Thanks in advance

*This post is locked for comments

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Warning message on Purchase Order

    Thanks for update

    I have resolved the issue by writing Function on Purchase line table instead of Purchase Order Subform page. :)

    Regards,

    Aditi

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Warning message on Purchase Order

    Hi Mahesh,

    Thanks for your reply.

    Requirement is user will tick filed form PH and if it is tick then only lines from PL would update.

    Can you please let me know issues form the code, so i can correct and check.

    Thanks

    Regards,

    Aditi

  • Verified answer
    mmv Profile Picture
    mmv 11,465 on at
    RE: Warning message on Purchase Order

    Hi,

    The above code has few issues.  My suggestion is why don't you use a Flow Field in the Purchase Line? As you are updating all the lines, it's better to use a flow field to know the Status on the Purchase Header (whether it's updated).

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Warning message on Purchase Order

    Hi Mahesh,

    Thanks for the reply.

    Filed from Purchase line is not included in primary key

    PH Boolean filed name - Edit PO Update

    PL Boolean filed name - PO Updated

    Purchase Header page (50) code as below

    Edit PO Updated - OnValidate()

    IF CONFIRM('Do you want to update all PO Updated Lines?') THEN

    CurrPage.PurchLines.FORM.ManagePOUpdate("No.", TRUE);

    Purchase Order Subform page(54) code as below

    ManagePOUpdate(PONO : Code[10];Check : Boolean)

    IF Check = TRUE THEN

    BEGIN

      SETRANGE("Document No.",PONO);

      IF FINDSET THEN

      REPEAT

       "PO Updated":= TRUE;

       MODIFY(TRUE);

      UNTIL NEXT=0;

      CurrPage.UPDATE;

    END;

  • mmv Profile Picture
    mmv 11,465 on at
    RE: Warning message on Purchase Order

    Hi Aditi,

    Is your Boolean field in the Purchase Line a part of the Purchase Line table's primary key?

    Could you paste your code of updating Purchase Line Boolean field?

  • Verified answer
    Mohana Yadav Profile Picture
    Mohana Yadav 59,194 Super User 2024 Season 2 on at
    RE: Warning message on Purchase Order

    Please check the code you have added for above functionality.

    it seems something to do with customized code only.

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 Verified Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,503 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans