Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Answered

Possible bug when using Sales Line in CalcFormula, it skips the OnAssistTrigger

(1) ShareShare
ReportReport
Posted on by 9
Hey guys,
I've encountered a problem when I base a CalcFormula on Sales Lines, where it no longer triggers OnAssistEdit() on Page fields that referer to this value.
The value shown on the field of the Page is correct, but when I click it to open an Assisted Edit Page it skips the trigger OnAssistEdit(), and instead just opens the standard List Page Sales Lines (516, List)
 
Can anyone help me confirm that this is an actual issue?
 
Here's some sample code:
 
tableextension 50305 SalesLineExtension extends /Sales Line/
{
    fields
    {
        field(5030590; Fees; Decimal)
        {
            CalcFormula = Sum(/Sales Line/./Unit Price/ where(/Document No./ = field(/Document No./), /Line No./ = field(/Line No./), /Sell-to Customer No./ = field(/Sell-to Customer No./)));
            Caption = 'Fees';
            FieldClass = FlowField;
            Editable = false;
        }
    }
}
pageextension 50405 SalesInvoiceSubformExtension extends /Sales Invoice Subform/
{
    layout
    {
        addafter(/No./)
        {
            field(Fees; Rec.Fees)
            {
                Caption = 'Fees';
                Editable = false;
                ApplicationArea = All;
                Width = 7;
                trigger OnAssistEdit()
                begin
                    Message('OnAssistEdit hit!');
                end;
            }
        }
    }
}
 
  • Community member Profile Picture
    9 on at
    Possible bug when using Sales Line in CalcFormula, it skips the OnAssistTrigger
    You are absolutely right ZHU, I was mistakenly using the wrong trigger.

    Thank you so much, and thank you for all your BC guides. I use them alot, and they are a godsend!
     
    Regards,
    Henrik
  • Verified answer
    YUN ZHU Profile Picture
    79,097 Super User 2025 Season 1 on at
    Possible bug when using Sales Line in CalcFormula, it skips the OnAssistTrigger
    If you are referring to the trigger of clicking the flowfield, this is not the OnAssistEdit trigger, but the Ondrilldown trigger.
    However, please note that this will prevent the flowfield page from opening.
     
    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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

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

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 293,209 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,923 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156 Moderator

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans