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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

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

Related to bussiness central

(0) ShareShare
ReportReport
Posted on by 236

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;
  • Suggested answer
    Nitin Verma Profile Picture
    21,812 Moderator on at

    Hi,

    If you want to see that field from Purchase header to your Posted Purchase tables, just create that same field with same id in Purch. Invoice Header table, no need to write any code.

    Thanks.

  • Pragya752 Profile Picture
    236 on at

    This is my table ext. for purchase inv header

    tableextension 90124 PostedInvoiceExt extends "Purch. Inv. Header"

    {

       fields

       {

           field(231; "Invoice Category"; Enum InvoiceCategory)

           {

           }

       }

    }

    This is my tablext for purchase header.....

    tableextension 90133 PurchaseOrderExtention extends "Purchase Header"

    {

       DataCaptionFields = "Free Text";

       fields

       {

           field(231; "Invoice Category"; Enum InvoiceCategory)

           {

               Caption = 'Invoice Category';

               InitValue = " ";

               NotBlank = true;

    }

    I want that whatever value i select in purchase header through the purchase invoice page.It should come statically on posted invoice page through purch. invoice table

  • Suggested answer
    Nitin Verma Profile Picture
    21,812 Moderator on at

    see my answer

  • Pragya752 Profile Picture
    236 on at

    I did the same just see my code.I am not getting the output

  • Suggested answer
    Nitin Verma Profile Picture
    21,812 Moderator on at

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

    Thanks

  • Suggested answer
    Nitin Verma Profile Picture
    21,812 Moderator on at

    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

  • Pragya752 Profile Picture
    236 on at

    yes i think the issue was with field id only

  • Suggested answer
    Govinda Kumar Profile Picture
    2,310 Moderator on at

    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
    236 on at

    yes its working now.Thanks

  • Pragya752 Profile Picture
    236 on at

    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

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the August Top 10 Community Leaders

These are the community rock stars!

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 753 Super User 2026 Season 2

#2
YUN ZHU Profile Picture

YUN ZHU 583 Super User 2026 Season 2

#3
AndrewThomas81 Profile Picture

AndrewThomas81 302 Super User 2026 Season 2

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans