Skip to main content

Notifications

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

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

(1) ShareShare
ReportReport
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,272 Super User 2024 Season 1 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 12,290 Most Valuable Professional on at
    New to business central, how to modify Currency Code in Requisition Line
    Hi
    As our colleague Yun has indicated, you could rely on validations. Here is some interesting information.
    Best
    GR
  • Suggested answer
    YUN ZHU Profile Picture
    YUN ZHU 74,036 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

News and Announcements

Announcing Category Subscriptions!

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,370 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans