Insert quote lines (products or services) into quote - custom page- power automate



Recently I have come across a unique requirement to generate the quote from my business team. 

The current process for generating quotes is time-consuming due to the need for selecting each product individually and adding it to the quote line by line. This involves multiple clicks and significant manual effort, which is inefficient and impacts productivity.

To Objective of this process to enhance the efficiency of the quoting process by enabling users to insert a list of products into the quote in one action, rather than selecting products one at a time.

Quote template and Template lines


Lets start the process by creating 2 entities

Create custom page to select the template to insert the lines into quote

Custom page screen which opens as a popup to select the customer and contact once you select we will show some waiting screen to the user while the new record is getting created. 

create a new button by using ribbon workbench to create a new button and open the custom page.

Custom button on the Quote ribbon:

Custom page


Waiting screen for the user to wait while the quote lines are getting created
Note: Please add this custom page to Modern driven app you want to use. 

Put the below on app on start properties of the custom page

Set(varRecordQuoteId1, If(
    IsBlank(Param("recordId")),
    GUID("ec337351-5510-eb11-a813-00224806a2ff"),
    GUID(Param("recordId"))
    ));
Set(varSelectedQuoteRecord1, LookUp(Quotes , Quote = varRecordQuoteId1));

Put the below in on select properties of submit button
If(
    !IsBlank(txtLabname),

        Navigate('Waiting Screen');
                Set(VarQuote,QuoteTemplate.Run(txtOriginalQuoteGUID.Value,glLabTemplate.Selected.'Lab Template'));
                  Launch(VarQuote.quotelink,{},LaunchTarget.Replace);
                       
               
);

Now lets start build the flow to insert the new quote lines by using the template

Create a manually trigged flow



Compose Quote QUID

Get Original Quote ID

List Quote template lines
Check the length of quote template lines

Create quote lines from Template lines

Create environment variables

Environment URL

App ID

Now finally send the response to power apps, which will redirect to the newly created cloned quote record. 



Thank you for visiting the blog. 🙏






Comments

Popular posts from this blog

How to update 100000(hundred thousand) records with power automate flow by using chunk expression, Split the list and pass onto child flows.

How to keep flows remain on if the flows don't run for 90 days

D365 CRM-Change Entity translations(Sub area) in Modern driven app.