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

Notifications

Announcements

No record found.

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,382

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
    301,049 Super User 2025 Season 2 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,382 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
    301,049 Super User 2025 Season 2 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,382 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
    301,049 Super User 2025 Season 2 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,382 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
    301,049 Super User 2025 Season 2 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,382 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
    301,049 Super User 2025 Season 2 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,382 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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

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

#1
Martin Dráb Profile Picture

Martin Dráb 544 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 450 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 250 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans