Skip to main content

Notifications

Announcements

No record found.

Small and medium business | Business Central, N...
Answered

Related to bussiness central

(0) ShareShare
ReportReport
Posted on by 210

I have a table Purchase Header with Enum field Invoice category with number of options.Now,I need that when i select one option here ,the selected option should be displayed on another page posted invoices.How can i achieve this?I am using this code after pageextension where i want to display but it is not working.

  trigger OnAfterGetCurrRecord()
 var
     RecPurchchaseOrder : Record "Purchase Header";  
     RecPostedInvoice :  Record "Purch. Inv. Header";
 begin
    RecPurchchaseOrder.Reset();
    RecPurchchaseOrder.SetRange("Invoice Category",RecPostedInvoice."Invoice Category");
 RecPostedInvoice."Invoice Category" := RecPurchchaseOrder."Invoice Category";
   
 end;
  • Govinda Kumar Profile Picture
    Govinda Kumar 2,203 Super User 2024 Season 1 on at
    RE: Related to bussiness central

    If my previous reply to your other question worked, you can verify it there if you want.

  • Pragya752 Profile Picture
    Pragya752 210 on at
    RE: Related to bussiness central

    your previous reply worked

  • Verified answer
    Govinda Kumar Profile Picture
    Govinda Kumar 2,203 Super User 2024 Season 1 on at
    RE: Related to bussiness central

    When you say documents are "Invoice" type, not sure if you are referring to the system's fields or your custom fields.

    If you are referring to your custom field, I think same field Id trick won't work here.. so you need to use one of the events when posting the purchase order to modify the values in vendor ledger entries,

  • Suggested answer
    Mohana Yadav Profile Picture
    Mohana Yadav 59,194 Super User 2024 Season 2 on at
    RE: Related to bussiness central

    You have to write code to pass the data from Purchase Header to Vendor Ledger Entry table.

    Ex: community.dynamics.com/.../flow-data-purchase-header-to-detailed-vendor-ledger-entry

  • Pragya752 Profile Picture
    Pragya752 210 on at
    RE: Related to bussiness central

    hello,when i tried the same thing on vendor ledger entry table to get data with same field no. it is not showing any data.In that table only few documents are of Incvoice type where are in purchase header and posted purchase header all were of invoice,does this has something to do with the probelm of data not showing on vendor ledger entry table

  • Pragya752 Profile Picture
    Pragya752 210 on at
    RE: Related to bussiness central

    yes its working now.Thanks

  • Suggested answer
    Govinda Kumar Profile Picture
    Govinda Kumar 2,203 Super User 2024 Season 1 on at
    RE: Related to bussiness central

    Hi Pragya752,

    You can try selecting the ID 50000 range for your invoice category field, as suggested by Nitin Verma. I tested this solution and it worked on my end.

    Please look at the screenshots below

    Here is the screenshot of the Purchase Order with the Invoice category field before posting

    pastedimage1681721449922v3.png

    Posted Purchase Invoice page
    pastedimage1681721093522v2.png

    Regards

  • Pragya752 Profile Picture
    Pragya752 210 on at
    RE: Related to bussiness central

    yes i think the issue was with field id only

  • Suggested answer
    Nitin Verma Profile Picture
    Nitin Verma 21,091 Super User 2024 Season 1 on at
    RE: Related to bussiness central

    Also are you able to define Field id 231 In purchase table?

    I am not sure it will allow you to do that, can you define with custom range started from 50000..99999

    Thanks

  • Suggested answer
    Nitin Verma Profile Picture
    Nitin Verma 21,091 Super User 2024 Season 1 on at
    RE: Related to bussiness central

    Have you posted any invoice after selecting this value on Purch. Header table?

    Thanks

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,391 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,445 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans