web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

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

How to bring a new added field from Sales Order to Purchase Order

(0) ShareShare
ReportReport
Posted on by

Hi experts,

pastedimage1609145759584v1.png

I have a new added field called 'Comments (NEW)' in both Sales Line and Purchase Line located in the corresponding subform (Sales Order Subform & Purchase Order Subform). My issue is that when I want to get the Sales Order in the Purchase Order, all information will be there expect for the 'Comments (NEW)', it will be blank even though the 'Comments (NEW)' has the value in Sales Order.

How can I get the value 'Comments (NEW)' being transferred from Sales Order to Purchase Order as well? Please help me with this, thanks a lot!

**the action I did to transfer the information from SO to PO is (Purchasing > Purchase Order > Actions > Functions > Special Order > Get Sales Order)

I have the same question (0)
  • Suggested answer
    Bilal Haider Profile Picture
    408 on at
    RE: How to bring a new added field from Sales Order to Purchase Order

    Please give the Field ID same in both tables.

  • Community Member Profile Picture
    on at
    RE: How to bring a new added field from Sales Order to Purchase Order

    Yes, I did put the same field ID in both tables but still not working.. any other approaches I can try? please advise me

  • Verified answer
    Suresh Kulla Profile Picture
    50,233 Super User 2025 Season 2 on at
    RE: How to bring a new added field from Sales Order to Purchase Order

    You need to subscribe to the event in the codeunit 6620 called OnAfterTransfldsFromSalesToPurchLine(FromSalesLine,ToPurchLine); then assign the new field value to PurchLine from the FromSalesLine.

  • Community Member Profile Picture
    on at
    RE: How to bring a new added field from Sales Order to Purchase Order

    Hi Suresh, I've found the codeunit and also the procedure you mentioned. But where should I locate this codeunit after I assigned the new field value?

  • Suggested answer
    Suresh Kulla Profile Picture
    50,233 Super User 2025 Season 2 on at
    RE: How to bring a new added field from Sales Order to Purchase Order

    What is your BC version?  you need to create a new codeunit and subscribe to the above event.

    Check this example and let me know if you have any other questions

    docs.microsoft.com/.../devenv-subscribing-to-events

  • Community Member Profile Picture
    on at
    RE: How to bring a new added field from Sales Order to Purchase Order

    Yes, it works! Thanks a lot!

  • Community Member Profile Picture
    on at
    RE: How to bring a new added field from Sales Order to Purchase Order

    Hi Suresh, I have another problem now, how about when Sales Order to Posted Sales Invoice? which codeunit is involved that I need to subscribe to the event?

  • Verified answer
    Suresh Kulla Profile Picture
    50,233 Super User 2025 Season 2 on at
    RE: How to bring a new added field from Sales Order to Purchase Order

    For transferring values from Sales Order to Posted Sales Invoice you don't need to add any code just make sure you add those fields to Sales Invoice Header table with the same Field No.

  • Community Member Profile Picture
    on at
    RE: How to bring a new added field from Sales Order to Purchase Order

    Hi Suresh, the new field is not transfer to the Posted Sales Invoice when I do the prepayment. What can I do for this, any codeunit involved here I can subscribed to?

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

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

#1
Rishabh Kanaskar Profile Picture

Rishabh Kanaskar 4,327

#2
Sumit Singh Profile Picture

Sumit Singh 2,734

#3
Nimsara Jayathilaka. Profile Picture

Nimsara Jayathilaka. 2,599

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans