Skip to main content

Notifications

Announcements

No record found.

Business Central forum
Answered

New to business central, how to modify Currency Code in Requisition Line

Posted on by 6

 
I added a Currency Code field to the Item Vendor table so that when this field is changed (e.g., to USD), it also updates in the Requisition Line table. This allows a vendor to use a different currency code for an item without changing their default currency code. My question is how to implement this, as I'm very new to this environment and missing the underlying logic.
  • Verified answer
    DAnny3211 Profile Picture
    DAnny3211 9,217 Moderator on at
    New to business central, how to modify Currency Code in Requisition Line
    hi,
     
    see this
     
    tableextension 50100 "Item Vendor Extension" extends "Item Vendor"
    {
        fields
        {
            field(50100; "Currency Code"; Code[10])
            {
                trigger OnValidate()
                begin
                    UpdateRequisitionLineCurrencyCode("No.", "Currency Code");
                end;
            }
        }
        local procedure UpdateRequisitionLineCurrencyCode(ItemNo: Code[20]; CurrencyCode: Code[10])
        var
            RequisitionLine: Record "Requisition Line";
        begin
            //INSERT YOUR FILTER
            if RequisitionLine.FindSet() then
                repeat
                        RequisitionLine."Currency Code" := CurrencyCode;
                        RequisitionLine.Modify();
                until RequisitionLine.Next() = 0;
        end;
    }
     
    regards
     
  • gdrenteria Profile Picture
    gdrenteria 9,635 Most Valuable Professional on at
    New to business central, how to modify Currency Code in Requisition Line
  • Suggested answer
    YUN ZHU Profile Picture
    YUN ZHU 69,933 Super User 2024 Season 2 on at
    New to business central, how to modify Currency Code in Requisition Line
    Hi, Just add the update logic in the OnValidate (Field) Trigger of this new field.
    OnValidate (Field) Trigger
     
    Hope this helps.
    Thanks.
    ZHU

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

Anton Venter – Community Spotlight

Kudos to our October Community Star of the month!

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Dynamics 365 Community Newsletter - September 2024

Check out the latest community news

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,554 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,588 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans