Skip to main content

Notifications

Announcements

No record found.

Customer experience | Sales, Customer Insights,...
Answered

Open custom email template from BPF stage based on option selection

Posted on by 100
Hello,
 
i am looking to open custom email template from Business process flow. i have a stage where Take action field has options set, when they select "Pending for Additional info" it will open custom email template and allow users to update the template if they want to. is it possible to open the Template in another window or as modal dialog? please suggest best way to achieve.
 
Thanks
  • Rakki Profile Picture
    Rakki 100 on at
    Open custom email template from BPF stage based on option selection
    got it.
  • Verified answer
    Dengliang Li Profile Picture
    Dengliang Li Microsoft Employee on at
    Open custom email template from BPF stage based on option selection
    Hi,
     
    This can be achieved by registering a custom JavaScript on the On Change event of the option set field.
     
    Add an option set field to the form that contains the option /Pending for Additional info/.
     
    Register a custom JavaScript for the On Change event of this field.
     
    The code is below.
    function onchange(executionContext){
        var formContext = executionContext.getFormContext();
     
        //Gets the option set field value.
        var optionsetValue = formContext.getAttribute("cr0d6_customchoices").getValue();
     
        //If 1 (Pending for Additional info), a new email template record is opened in a dialog.
        if(optionsetValue==1){
            var pageInput={
                pageType: "entityrecord",
                entityName: "template",
            };
            var navigationOptions={
                //Open in dialog
                target:2
            };
            Xrm.Navigation.navigateTo(pageInput,navigationOptions);
        }
    }
     
     
    If my answer was helpful, please click Like, and if it solved your problem, please mark it as verified to help other community members find more.
    If you have further questions, please feel free to contact me .
     
    Best Regards,
    Dengliang Li
     

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans