Skip to main content

Notifications

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

Custom fields from Purchase order to Item Ledger Entries

Posted on by 54

Hello

I want to add PO number in Item Ledger Entry when we post the PO. In Item ledger entry there is an Order no. field but it is empty in case of sales order and Purchase order.

Any suggestion on how I can bring PO number in Item ledger Entry

pastedimage1680867014650v1.png

  • aryaps Profile Picture
    aryaps 151 on at
    RE: Custom fields from Purchase order to Item Ledger Entries

    Okay...

    this is the only way option to bring those details right. but this has this type of issues.

    But bringing Purchase number details their won't be any issue like this, right?

    apart from this if any other option available pls guide me...

    thankyouu soo much for time and consideration.

  • Suggested answer
    YUN ZHU Profile Picture
    YUN ZHU 72,941 Super User 2024 Season 2 on at
    RE: Custom fields from Purchase order to Item Ledger Entries

    You didn't do anything wrong, I mentioned above, there is a one-to-many situation, not just multiple invoicing, your second line should come from the cost adjustment.
    So I don't recommend directly displaying the Document No. here………

  • aryaps Profile Picture
    aryaps 151 on at
    RE: Custom fields from Purchase order to Item Ledger Entries

    Hi

    But here we will get the count, but when go insdie same number is displaying over there.

    in your screenshot it is displaying the if there is 2 diff sales inv number exist.

    is anything i did wrong

    saleile.jpg

    ile2.jpg

  • aryaps Profile Picture
    aryaps 151 on at
    RE: Custom fields from Purchase order to Item Ledger Entries

    Thankyouu Soo much.

    So, we can bring both Purchase and sales Numbers like you explained. is there any other technical difficulties if we face later if bring both in the mentioned way.

    is reflect on future entries or it will reflect on all the existing entries also

    Really appreciate your kind support and help

  • Suggested answer
    YUN ZHU Profile Picture
    YUN ZHU 72,941 Super User 2024 Season 2 on at
    RE: Custom fields from Purchase order to Item Ledger Entries

    Yes, because using Flowfield, only one invoice number can be displayed. According to my practice, click on the number behind to view all invoice numbers.

    pastedimage1681293782886v1.png

    pastedimage1681293794196v2.png

    Thanks

    ZHU

  • aryaps Profile Picture
    aryaps 151 on at
    RE: Custom fields from Purchase order to Item Ledger Entries

    Thankyou soo much for your time and response.

    just one more query, if there is two invoices count will be shown only like 2, 3 etc .we have to go and check what will be other number. pls correct if i understood is wrong.

    if am wrong could pls add some screenshots pls..

    i really appreciate your kind support

  • Suggested answer
    YUN ZHU Profile Picture
    YUN ZHU 72,941 Super User 2024 Season 2 on at
    RE: Custom fields from Purchase order to Item Ledger Entries

    Emmm, the easiest way is to use Flowfield. In fact, the standard Sales Amount does the same.

    For example, for Sales, you can add a Count in addition to the Invoice number. If it is not 1, you can click to confirm whether there are multiple invoices.

    tableextension 50112 MyExtension2 extends "Item Ledger Entry"
    {
        fields
        {
            field(50100; InvoiceNumber; Code[20])
            {
                Caption = 'Sales Invoice Number';
                FieldClass = FlowField;
                CalcFormula = lookup("Value Entry"."Document No." where("Item Ledger Entry No." = field("Entry No."), "Document Type" = const("Sales Invoice")));
            }
    
            field(50101; InvoiceCount; Integer)
            {
                Caption = 'Sales Invoice Count';
                FieldClass = FlowField;
                CalcFormula = count("Value Entry" where("Item Ledger Entry No." = field("Entry No."), "Document Type" = const("Sales Invoice")));
            }
        }
    }
    
    pageextension 50113 MyExtension extends "Item Ledger Entries"
    {
        layout
        {
            addafter("Item No.")
            {
                field(InvoiceNumber; Rec.InvoiceNumber)
                {
                    ApplicationArea = All;
                }
                field(InvoiceCount; Rec.InvoiceCount)
                {
                    ApplicationArea = All;
                }
            }
        }
    }

    pastedimage1681292620980v1.png

    Hope this helps.

    Thanks.

    ZHU

  • aryaps Profile Picture
    aryaps 151 on at
    RE: Custom fields from Purchase order to Item Ledger Entries

    Okay thanks for Detail Reply Zhu.

    is there any other option to achieve those result in item led entry.

    right now its very difficult to go inside each time and check the details.

  • Suggested answer
    YUN ZHU Profile Picture
    YUN ZHU 72,941 Super User 2024 Season 2 on at
    RE: Custom fields from Purchase order to Item Ledger Entries

    Hi, It is not recommended to do this, because there is a one-to-many situation in the system.

    For example,

    Post Ship first in the Sales order.

    pastedimage1681288704350v1.png

    pastedimage1681288718627v2.png

    Then use Get Shipment Lines... in the sales invoice to post in two invoices.

    pastedimage1681288766583v3.png

    pastedimage1681288775705v4.png

    pastedimage1681288788249v5.png

    pastedimage1681288815005v6.png

    pastedimage1681288824254v7.png

    In this way, when you click Sales Amount in Item Ledger Entries, you will find that there will be two invoices with different invoice numbers.

    pastedimage1681288951464v8.png

    pastedimage1681288959816v9.png

    Not only in this case, for example, when there is an Item Charge, or when the cost is adjusted, new Value Entries will also be generated, so I personally do not recommend this.

    Hope this helps.

    Thanks.

    ZHU

  • aryaps Profile Picture
    aryaps 151 on at
    RE: Custom fields from Purchase order to Item Ledger Entries

    its superb.

    if we want to bring posted sales invoice number also there how it will be. right now for entry type sales, Posted sales shipment number which means delivery note number is coming as EDN. so next to it

    how can we bring postesd sales invoice number if entry type is sales then posted sales inv and if entry type is purchase then pur order number

    ilee.jpg

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

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Complete!

🔔 Be sure to subscribe to the new forums you are interested in to stay up to date! 🔔

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,113 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 229,918 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans