Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Suggested answer

Retain Purchase Line Description after changing vendor name in Purchase Header

(0) ShareShare
ReportReport
Posted on by 130

Hi All,

We ask employees to use purchase quotes to submit requests for non-inventory related items. When an employee needs something from a vendor that is not in our BC system, we ask them to use a generic vendor No. 0000 (Vendor Not Listed).

When they use this vendor, in the purchase lines, we ask them to use the Description to include some details about the item they are purchasing.

After the approval process is completed - and the Purchase Header is set to Released - our finance goes in, opens the Purchase Header and updates the No. 0000 with an actual vendor name (after we identify one). When this happens, the purchase line Descriptions get reset and the user entered description is erased, and overwritten by the default description value.

So my question is, how do I retain the original purchase line description, and maintain it even after the vendor name has been changed? 

Thank you

  • Suggested answer
    Mohana Yadav Profile Picture
    60,232 Super User 2025 Season 1 on at
    RE: Retain Purchase Line Description after changing vendor name in Purchase Header

    try this code. you can add additional conditions if you want.

       [EventSubscriber(ObjectType::Table, Database::"Purchase Header", 'OnRecreatePurchLinesOnBeforeInsertPurchLine', '', false, false)]

       local procedure OnRecreatePurchLinesOnBeforeInsertPurchLine(var PurchaseLine: Record "Purchase Line"; var TempPurchaseLine: Record "Purchase Line"; ChangedFieldName: Text[100]);

       begin

           PurchaseLine.Description := TempPurchaseLine.Description;

       end;

  • Dynamics 365 Profile Picture
    2 on at
    RE: Retain Purchase Line Description after changing vendor name in Purchase Header

    Hey Sammy,

    Sorry but I would help only in Functional Side.

  • SammySevens Profile Picture
    130 on at
    RE: Retain Purchase Line Description after changing vendor name in Purchase Header

    Thank you Aman, and yes I would like to customize it - do you have a suggestion on some methods I could try. I am comfortable in AL programming - but stuck at this problem :S

  • Dynamics 365 Profile Picture
    2 on at
    RE: Retain Purchase Line Description after changing vendor name in Purchase Header

    Hi Sammy

    As per Microsoft base functionality,If you changed the vendor at purchase order then system will refresh the Line details as well.

    Without any customisation, you can go with comments.

    But if you want to follow same process then you need to customise it with Technical end.

    Thanks

    Aman

  • SammySevens Profile Picture
    130 on at
    RE: Retain Purchase Line Description after changing vendor name in Purchase Header

    Hi Inge,

    I am looking for some guidance on customization. I am comfortable in AL programming already and have done various customizations (events, reports, flowfields, codeunits) - but can not identify an appropriate method

    Do you have some suggestions?

    • I thought of using xRec and Rec on the page view - but I can not complete it
      • If Xrec = 0000 and Rec <> 0000 then.... - but how do I retain the xRec of the purchase line? 
    • Looking at event subscriber with codeunit is a similar issue - as I do not have an xRec or Rec value to reference - so not sure what to do there

    Appreciate some guidance, think I can do this - just not sure on what methods to use.

    Thank you and Merry Christmas

  • SammySevens Profile Picture
    130 on at
    RE: Retain Purchase Line Description after changing vendor name in Purchase Header

    Thank you for the suggestion - and appreciate the screenshots. Yes this is my understanding as well, but I still need to find a means to persist the description instead of changing the current process. Thank you anyway.

  • Suggested answer
    Dynamics 365 Profile Picture
    2 on at
    RE: Retain Purchase Line Description after changing vendor name in Purchase Header

    Hello Sammy,

    You Can add those details in Comments Action at Purchase Quote header Level.

    pastedimage1671981769700v2.png

    pastedimage1671981784170v3.png

    pastedimage1671981793922v4.png

    pastedimage1671981806582v5.png

    pastedimage1671981819606v6.png

    pastedimage1671981829851v7.png

    Why it's happening ?

    Because when you changed the Vendor at Purchase order header level, System will update the Line Details also and it will take form Item card.

    pastedimage1671981904206v8.png

    Hope it will help you.

    Please Verify my answer if you found this relevant and it will help to other Community member also.

    Thanks

    Aman

  • Suggested answer
    Inge M. Bruvik Profile Picture
    1,025 Moderator on at
    RE: Retain Purchase Line Description after changing vendor name in Purchase Header

    Maybe you should look into the catalogue items functionality in Business Central and consider using that instead of the procedure you use now.

    learn.microsoft.com/.../inventory-how-work-nonstock-items

    To retain the description and continue using the procedure you use now you will have to do customization to your system.

  • Suggested answer
    Manan_Shah Profile Picture
    1,459 on at
    RE: Retain Purchase Line Description after changing vendor name in Purchase Header

    Hi,

    As you mention 1st user create a Purchase Quote on that time they pick non-Inventory Item. Once Purchase Quote is approved and Then they create a Actual Item & Pick correct or Final Vendor on Purchase Order, In this case you change the Item no. as you create a new Item. So system will pick it's description from item card and delete the old one. which is added on Purchase Quote. I suggest instead of description create a new field for notes enter it to Purchase quote and once quote convert to order transfer it to Order. In my suggestion this how you can fulfil your requirement. 


    Many Thanks,
    Manan


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

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
Sohail Ahmed Profile Picture

Sohail Ahmed 1,200

#2
YUN ZHU Profile Picture

YUN ZHU 1,006 Super User 2025 Season 1

#3
Mansi Soni Profile Picture

Mansi Soni 864

Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans