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

Related to bussiness central

(0) ShareShare
ReportReport
Posted on by 234

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;
I have the same question (0)
  • Suggested answer
    Nitin Verma Profile Picture
    21,698 Moderator on at
    RE: Related to bussiness central

    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
    234 on at
    RE: Related to bussiness central

    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,698 Moderator on at
    RE: Related to bussiness central

    see my answer

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

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

  • Suggested answer
    Nitin Verma Profile Picture
    21,698 Moderator on at
    RE: Related to bussiness central

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

    Thanks

  • Suggested answer
    Nitin Verma Profile Picture
    21,698 Moderator 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

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

    yes i think the issue was with field id only

  • Suggested answer
    Govinda Kumar Profile Picture
    2,304 Moderator 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
    234 on at
    RE: Related to bussiness central

    yes its working now.Thanks

  • Pragya752 Profile Picture
    234 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

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…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 3,377

#2
Jainam M. Kothari Profile Picture

Jainam M. Kothari 2,696 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 1,512 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans