Bhubaneswar, Odisha, India
+91-8328865778
support@softchief.com

Open custom page as modal pop-up from dynamics 365 power apps

Open custom page as modal pop-up from dynamics 365 power apps

You can open custom pages as a modal pop from Dynamics 365 form custom command button click.

Step 1 : Create a Custom Page inside a Solution ( Read here how to add custom page )

Add a custom page inside a solution. The page contains a textbox and a button. on button click we want to send an email to selected student.

In the OnStart property of custom page add Powerfx to read parameter from Command button.

Set(RecordItem, If(IsBlank(Param(“recordId”)),”admin@sh034.global.temp.domains”,Param(“recordId”)));

Add Gmail connector and in the button OnSelect property add following PowerFx.

Gmail.SendEmail(RecordItem,{Subject:”Notification from Softchief”,Body:txtemail.Value});Notify(“Message Sent.”,NotificationType.Success);

Save the custom page and publish it.

Step 2 – Add custom page in Model driven app

Add model driven app to the solution. Click on Edit in Preview for the model driven app. Add new custom page inside model driven app edit preview window. do not select add navigation option.

Step 3 – Add a JS Web resource

Add a JavaScript Web Resource and add following code.

function quickSendMessge(context)
{
var email= context.getAttribute("soft_email").getValue();
var pageInput = {
    pageType: "custom",
    name: "soft_sendmessagequick_fe339",
    recordId: email
};
var navigationOptions = {
    target: 2, 
    position: 1,
    width: {value: 50, unit:"%"},
   height:500,
    title: "Send Quick Message"
};
Xrm.Navigation.navigateTo(pageInput, navigationOptions)
    .then(
        function () {
            // Called when the dialog closes
        }
    ).catch(
        function (error) {
            // Handle error
        }
    );
}

make sure the name of custom page is correct you can check the name of custom page inside solution.

Step 4 – Add command button on form

Edit command bar of student and add new button and choose properties as explained in below screenshot. Select JS library and method.

Now save and publish the entire solution.

If you go to form and refresh, you will see a new button and by clicking the button new modal will open which is the custom page and by specifying a message and clicking send button will send an email to the student.

Hope this helps.

Follow my blog for more trending topics on Dynamics 365, Azure, C#, Power Portals and Power Platform. For training, Courses and consulting, call to us at +91 832 886 5778 I am working more for community to share skills in Dynamics 365 and Power Platform. Please support me by subscribing my YouTube Channel. My YouTube Channel link is this : https://www.youtube.com/user/sppmaestro

You can enroll now !We are giving 30% discount on our Internship Program

Don’t miss the chance to participate in the upcoming Internship Program which will be done using Microsoft Dot Net Web Development Full Stack Technology. The new batch will be starting from May 20, 2024.  We will have most experienced trainers for you to successfully complete the internship with live project experience.

Why to choose Our Internship Program?

Industry-Relevant Projects
Tailored Assignments: We offer projects that align with your academic background and career aspirations.
Real-World Challenges: Tackle industry-specific problems and contribute to meaningful projects that make a difference.

Professional Mentorship
Guidance from Experts: Benefit from one-on-one mentorship from seasoned professionals in your field.
Career Development Workshops: Participate in workshops that focus on resume building, interview skills, and career planning.

Networking Opportunities
Connect with Industry Leaders: Build relationships with professionals and expand your professional network.
Peer Interaction: Collaborate with fellow interns and exchange ideas, fostering a supportive and collaborative environment.

Skill Enhancement
Hands-On Experience: Gain practical skills and learn new technologies through project-based learning.
Soft Skills Development: Enhance communication, teamwork, and problem-solving skills essential for career success.

Free Demo Class Available