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

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

  • Verified answer
    faiz7049 Profile Picture
    2,238 on at
    RE: Custom quotation workflow

    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

  • André Arnaud de Calavon Profile Picture
    294,261 Super User 2025 Season 1 on at
    RE: Custom quotation workflow

    Hi Faiz,

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

  • faiz7049 Profile Picture
    2,238 on at
    RE: Custom quotation workflow

    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
    294,261 Super User 2025 Season 1 on at
    RE: Custom quotation workflow

    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,238 on at
    RE: Custom quotation workflow

    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
    294,261 Super User 2025 Season 1 on at
    RE: Custom quotation workflow

    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,238 on at
    RE: Custom quotation workflow

    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
    294,261 Super User 2025 Season 1 on at
    RE: Custom quotation workflow

    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,238 on at
    RE: Custom quotation workflow

    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 

  • Suggested answer
    André Arnaud de Calavon Profile Picture
    294,261 Super User 2025 Season 1 on at
    RE: Custom quotation workflow

    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.

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Jonas ”Jones” Melgaard – Community Spotlight

We are honored to recognize Jonas "Jones" Melgaard as our April 2025…

Kudos to the March 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... 294,261 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 233,017 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,158 Moderator

Leaderboard

Product updates

Dynamics 365 release plans