Hi guys,
I created a custom page and after published, I'm planning to call this page (entry form) from a Main Grid of my Model-driven menu.
Following Reza's video -> https://www.youtube.com/watch?v=XMopL0r8k3k especially on minute 25:40 for the command designer, also this Microsoft Doc https://docs.microsoft.com/en-us/power-apps/developer/model-driven-apps/clientapi/navigate-to-custom-page-examples#open-as-an-inline-full-page-without-context here is my step :
function OpenCanvasExpense()
{
var pageInput = {
pageType: "custom",
name: "new_newexpensecustom_e990e",
};
var navigationOptions = {
target: 1
};
Xrm.Navigation.navigateTo(pageInput, navigationOptions)
.then(
function () {
{
).catch(
function (error) {
}
);
}
The new button appear in my App, but nothing showing when I click the button.
Anyone can help what did I missed ?
Thanks
Man just wanted to thank you, you saved my life. I had the very same experience (but with Ribbon Workbench for parameters management), and struggled a lot to make it work. Cheers!
Yeah, actually curios why the script not working. As those two thing you're pointed out, I can confirmed I already did. And since all the related object are in my Solution, I did using the Publish all customization to make sure nothing left behind.
FYI, after the re-create and succeeded with other script, I tried to re-do again and this time still using the non-working script, but it turns out still not working.
I will close it after a while later.
Thanks
Hi @Axal ,
Glad to see the issue has been solved.
You could mark the correct reply to close the case.
Besides, I think the error may be caused by the following points:
1\ After you have applied the js for your mda, you may need to refresh the page a few times for it to work due to the cache.
2\ Maybe you didn't publish all your components correctly, like your js resources...
Best Regards,
Wearsky
Hi,
Not sure what happened, but I re-do all my work again including create new Custom Page and Web Resource, but I changed the script with the one with the context ->
function openPageInlineWithContext(selectedItems)
{
var selectedItem = selectedItems[0];
if (selectedItem) {
let pageInput = {
pageType: "custom",
name: "new_expensecustom_09d77",
entityName: selectedItem.TypeName,
recordId: selectedItem.Id,
};
let navigationOptions = {
target: 1
};
Xrm.Navigation.navigateTo(pageInput, navigationOptions)
.then(
function () {
// Handle success
}
).catch(
function (error) {
// Handle error
}
);
}
}
This one is working.
Since the previous script is actually for testing only so probably I can say it is solved. Although I'm still curios why it is not working.
@Mira_Ghaly Thanks for your help.
Hi @Mira_Ghaly
I think there is no such question a silly question to me, in fact I did remember there was once we need to register first the Web Resource in the related Model-driven form, do I still need that ? For the "edit main grid" it self, I can't see any register except the "+ Add Library" button which the place I select my newly created Web resources.
For the solution, I add the new Web resources from my solution, so it already inside my solution. And I also try to "Publish all customization" from the solution, just to try my luck, but none of this work. It seems the new button really do nothing.
Appreciate any help and suggestion, so feel free to ask anything as I ran out of idea now. It is very easy if looking at Reza's video or other same video about this "commanding"
Thanks
It might be a silly question have you added the Javascript as a web resource first to the solution?
Thanks, I changed the script accordingly, It looks like the script has never been called as the alert not shown.
Anything wrong with step ?
I tried to just change the command (button) text to just make sure this Model-driven is published and it is opened the new one, which it did. But the button still nothing when it is click.
I noticed a syntax error and add a bit of modification as well as the Alert so that you can try at your side and trouble shoot it a bit further
function OpenCanvasExpense()
{
alert("Function Open Canvas App Called");
var pageInput = {
pageType: "custom",
name: "new_newexpensecustom_e990e"
};
var navigationOptions = {
target: 1,
width: 800, // value specified in pixel
height: 700, // value specified in pixel
position: 1
};
Xrm.Navigation.navigateTo(pageInput, navigationOptions)
.then(
function () {
{
).catch(
function (error) {
}
);
}