web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

Custom quotation workflow

(0) ShareShare
ReportReport
Posted on by 2,430

Hi experts,

I created custom sales quotation workflow based on total discount percentage criteria.

Now we have requirement to check first Net amount then total discount percentage. I found a method in Salesquotationtable totalInvoiceAmountMST(). but I do not know how to apply.

I created a field (Net Amount) in Salesquotationtable and based on Net Amount I configure workflow but where I can get amount in Net Amount using totalInvoiceAmountMST().

Please help me.

If need more details let me know.

regards,

Faiz

I have the same question (0)
  • Suggested answer
    André Arnaud de Calavon Profile Picture
    304,045 Super User 2026 Season 1 on at

    Hi Faiz,

    You can create calculated fields in the workflow document class. There are examples on the purchase order workflow where e.g. a delta amount is calculated to be used as condition in the workflow configuration.

  • faiz7049 Profile Picture
    2,430 on at

    Thank you André Arnaud de Calavon, I added a method to calculate total Invoice Amount as given below

    public AmountMST parmTotalInvoiceAmountMST(tableId _tableId, RecId _recId )
    
    {
        SalesQuotationTable salesQuotationTable;
        ;
    
        select salesQuotationTable where salesQuotationTable.RecId ==_recId;
    
    
      return salesQuotationTable.totalInvoiceAmountMST();
    }

    under class SalesQuotationApprdocument.

    578801.jpg

    When I run workflow I am getting error as given below.

    01737.jpg

    Please help me 

  • André Arnaud de Calavon Profile Picture
    304,045 Super User 2026 Season 1 on at

    Hi Faiz,

    Did you compile the objects? Is the CIL created correctly or did the build give some errors? If you have multiple AOS machines, try to restart them all (if the CIL is correctly built).

  • faiz7049 Profile Picture
    2,430 on at

    Hi André Arnaud de Calavon,

    Yes I complied and restarted AOS but still getting same error.

    Please help me.

    Regards,

    Faiz

  • André Arnaud de Calavon Profile Picture
    304,045 Super User 2026 Season 1 on at

    Hi Faiz,

    I'm not able to check your environment. How did you use this calculated field in the workflow configuration? Can you share a screenshot of the WF configuration?

  • faiz7049 Profile Picture
    2,430 on at

    Hi André Arnaud de Calavon ,

    In WF , I am checking total discount in % and total amount.

    2703.Untitled.jpg

  • André Arnaud de Calavon Profile Picture
    304,045 Super User 2026 Season 1 on at

    Hi faiz,

    Anyhow, I think it is related to the CIL build. Is this the development environment or was the coding already moved to another environment? Can you check the latest CIL status?

  • faiz7049 Profile Picture
    2,430 on at

    Hi André Arnaud de Calavon,

    Yes, this is development environment . I have checked CIL status looks fine.

    8306.Capture.JPG

    Regards,

    Faiz

  • André Arnaud de Calavon Profile Picture
    304,045 Super User 2026 Season 1 on at

    Hi Faiz,

    This is weird. You are able to select and configure the fields in the workflow, but you still get the runtime error.

  • Verified answer
    faiz7049 Profile Picture
    2,430 on at

    Hi André Arnaud de Calavon,

    I have been updated paramenters in method parmTotalInvoiceAmountMST() and classDeclaration definition as given. Workflow now working perfectly and error disappeared.

    classDeclaration

    class SalesQuotationApprDocument extends WorkflowDocument
    {
    
        SalesQuotationTable salesQuotationTable;
        AmountMST   amountMST;
    }

    parmTotalInvoiceAmountMST

    public AmountMST parmTotalInvoiceAmountMST(CompanyId _companyId,tableId _tableId, RecId _recId )
    
    {
        select salesQuotationTable where salesQuotationTable.RecId ==_recId;
        {
    amountMST = salesQuotationTable.totalInvoiceAmountMST();
        }
    
      return amountMST;
    }

    Thanks,

    Faiz

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 738

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 453 Super User 2026 Season 1

#3
Syed Haris Shah Profile Picture

Syed Haris Shah 286 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans