Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics 365 | Integration, Dataverse...
Suggested answer

Error in Calling Dialog by Javascript

(0) ShareShare
ReportReport
Posted on by 240

I created a custom button in my Phone Call entity and want to call a dialog when that button is clicked. That button would basically prompt the user to create a follow-Up activity if yes is chosen. All the steps are added in the dialog. But my script seems to run into an error whenever I click it. it opens a new page and says page cannot be found - this is so weird since I was expecting  a pop-up. This is the code:

function new_FollowUp(dialogId, entityName, objectId)
{
var url = Xrm.Page.context.getClientUrl() +
7bAD6FCD31-A067-4F43-B4D2-6E8B2A6CBECB +
dialogId + phonecall +
entityName + c24ed9f9-2186-e911-a97d-000d3af45d23 +
objectId;
window.open(url);
}

Can someone please help me with the right code? 

Thank you. 

  • Suggested answer
    Pawar Pravin  Profile Picture
    Pawar Pravin 5,231 on at
    RE: Error in Calling Dialog by Javascript

    Hey ,

    Thanks for update. Even for HTML web resource you can use this method as shown in below code.

    var pageInput = {
                pageType: "webresource",
                webresourceName: "webresourcename.html",
                data: Id
            };
            var navigationOptions = {
                target: 2,
                width: 200,
                height: 300,
                position: 1
            };
            Xrm.Navigation.navigateTo(pageInput, navigationOptions).then(
                function success() {
    			
                },
                function error() {
                }
            );

  • Aneeqa Pervaiz Profile Picture
    Aneeqa Pervaiz 240 on at
    RE: Error in Calling Dialog by Javascript

    Hey @Pravin - thanks for the help. But I am not looking to open a record (either new or existing). I am looking to just get a pop-up which would ask user a question, and then either create a new phone call or not depending on what they choose. I have created my dialogue. I just need to call it by Javascript to a custom button on the ribbon. 

  • Suggested answer
    Pawar Pravin  Profile Picture
    Pawar Pravin 5,231 on at
    RE: Error in Calling Dialog by Javascript

    Hi ,

    You can use "Xrm.Navigation.navigateTo" method to show popup of record. Please refer code mentioned in below url for more details:

    www.inogic.com/.../

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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February 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... 292,516 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,409 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans