Hi Experts,
On button click on an entity , open a dialog with custom HTML controls (drop down and comments fields) . Save the dialog and capture the fields details on a entity . This is the requirement am working on . To achieve this i have used Xrm.Internal.openDialog method in classic form which works fine but on UCI form it did not worked as this method is unsupported . Do we have alternate method for Xrm.Internal.openDialog on UCI form ?
I have tried xrm.navigation.openwebresource method on UCI form . But this method does not has callback function parameters. Hence want to know if there is similar method that supports on UCI form as below one . Appreciate your help on this .
Xrm.Internal.openDialog(Xrm.Page.context.getClientUrl() + "/WebResources/ipx_Lead/DisqualifyLead", DialogOption, null, null, callbackFunction);
Hi,
Use below code to pass the data
var pageInput = {
pageType: "webresource",
webresourceName: "new_sample_webresource.htm",
data: params
};
Parse the data in html page which was passed as Data parameter
function getUrlParameters() {
var queryString = location.search.substring(1);
var params = {};
var queryStringParts = queryString.split("&");
for (var i = 0; i < queryStringParts.length; i++) {
var pieces = queryStringParts[i].split("=");
params[pieces[0].toLowerCase()] = pieces.length === 1 ? null : decodeURIComponent(pieces[1]);
}
return params;
}
Hy, Bipin
Thanks,Ya it's working now..i did the same way you mentioned but can you guild me how can i pass parameters along with open webresourece becasue first i have did it using "Xrm.Utility.openWebResource" for different example and it's worked for passing parameter to that web resource...
i have also try above reference give by Andrew..but i don't know where am i doing mistake...can you please guide me.
Hi,
You should only pass name of the webresource instead of passing with URL. See below example.
var pageInput = {
pageType: "webresource",
webresourceName: "new_sample_webresource.htm"
};
var navigationOptions = {
target: 2,
width: 500, // value specified in pixel
height: 400, // value specified in pixel
position: 1
};
Xrm.Navigation.navigateTo(pageInput, navigationOptions).then(
function success() {
// Run code on success
},
function error() {
// Handle errors
}
);
Get the we resource name from html web resource page as shown in below image.
Hello Andrew,
i did same thing which you mentioned above here is my code can you please correct me? where am i doing mistake.
it give me page not found 404 error i don't know where am i wrong? because with same url when i am try to open in other tab it is opening without any error.
code:
function qualifyLead(primaryControl)
{
debugger;
//Passing parameters to webresource
var leadId =Xrm.Page.data.entity.getId().replace("{", '').replace("}", '');
//var addParams = "Param1=" + leadId + "&Param2=" + primaryControl;//custom parameter that you need in the modal dialog
Xrm.Navigation.navigateTo({pageType:"webresource", webresourceName:"">xxx-dev.crm.dynamics.com/.../xxx_QualifyLead_Model"}, {target: 2, position: 1, width: {value: 50, unit:"%"}});
}
thanks & regards
Hello,
You can check Xrm.Navigation.navigateTo instead of Xrm.Internal.openDialog. Here is my post on that - butenko.pro/.../
Try:
Please create a canvass app with appropriate fields (drop downs and comments) and use it as dialog
(docs.microsoft.com/.../replace-dialogs
No more custom dialog
Some instructions in this link also might help: https://readyxrm.blog/2019/02/24/replacing-a-dynamics-365-dialog-with-an-embedded-canvas-powerapp/
This is the way forward
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,240 Super User 2024 Season 2
Martin Dráb 230,149 Most Valuable Professional
nmaenpaa 101,156