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

AL CalcFields Not working in page function

(0) ShareShare
ReportReport
Posted on by 1,159

Hi All,

I'm trying pull item table inventory field to a page similar to sales line, but its not working and CalcFileds giving an error "Cannot Implicitly convert type boolean to decimal"

    procedure GetItemSOH()Decimal
    var
        Item: Record Item;
        ItemSOH: Decimal;
    begin
        Item.Reset;
        Item.SetRange("No.", Rec."No.");
        
        if Item.FindFirst() then
            
            ItemSOH := Item.CalcFields(Inventory);
        exit(ItemSOH);
    end;
I have the same question (0)
  • Suggested answer
    JAngle Profile Picture
    113 on at
    RE: AL CalcFields Not working in page function

    Need to be on separate lines. Do calcfields after findfirst and then set the variable before exit

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…

Andrés Arias – Community Spotlight

We are honored to recognize Andrés Arias as our Community Spotlight honoree for…

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

#1
Sumit Singh Profile Picture

Sumit Singh 2,708

#2
Sohail Ahmed Profile Picture

Sohail Ahmed 2,675 Super User 2025 Season 2

#3
Jeffrey Bulanadi Profile Picture

Jeffrey Bulanadi 2,203

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans