Helo,
I have Microsoft CRM 365 on Line, but I need javasript to refresh the page when I click the button, what would be the Javascript I use to refresh the page considering the context?
Tanks
Hello Andrew good morning,
Thanks for the feedback.
I put the code you gave me, it did not present any kind of error, but did not update the page.
Theoretically every time the form is saved, reload the page because I have a javascript that calculates and updates Opportunity's estimated revenue.
Follows code:
function test (executionContext)
{
debugger;
try
{
var formContext = executionContext.getFormContext ();
formContext.data.refresh (true);
}
catch (e)
{
alert ("Error in test function:" + e.message);
}
}
Thank you
Hello Andrew good morning,
Thanks for the feedback.
I put the code you gave me, it did not present any kind of error, but did not update the page.
Theoretically every time the form is saved, reload the page because I have a javascript that calculates and updates Opportunity's estimated revenue.
Follows code:
function test (executionContext)
{
debugger;
try
{
var formContext = executionContext.getFormContext ();
formContext.data.refresh (true);
}
catch (e)
{
alert ("Error in test function:" + e.message);
}
}
Thank you
Hello Andrew good morning,
Thanks for the feedback.
I put the code you gave me, it did not present any kind of error, but did not update the page.
Theoretically every time the form is saved, reload the page because I have a javascript that calculates and updates Opportunity's estimated revenue.
Follows code:
function test (executionContext)
{
debugger;
try
{
var formContext = executionContext.getFormContext ();
formContext.data.refresh (true);
}
catch (e)
{
alert ("Error in test function:" + e.message);
}
}
Thank you
Hello Andrew good morning,
Thanks for the feedback.
I put the code you gave me, it did not present any kind of error, but did not update the page.
Theoretically every time the form is saved, reload the page because I have a javascript that calculates and updates Opportunity's estimated revenue.
Follows code:
function test (executionContext)
{
debugger;
try
{
var formContext = executionContext.getFormContext ();
formContext.data.refresh (true);
}
catch (e)
{
alert ("Error in test function:" + e.message);
}
}
Thank you
Hello Andrew good morning,
Thanks for the feedback.
I put the code you gave me, it did not present any kind of error, but did not update the page.
Theoretically every time the form is saved, reload the page because I have a javascript that calculates and updates Opportunity's estimated revenue.
Follows code:
function test (executionContext)
{
debugger;
try
{
var formContext = executionContext.getFormContext ();
formContext.data.refresh (true);
}
catch (e)
{
alert ("Error in test function:" + e.message);
}
}
Thank you
Hello Andrew good morning,
Thanks for the feedback.
I put the code you gave me, it did not present any kind of error, but did not update the page.
Theoretically every time the form is saved, reload the page because I have a javascript that calculates and updates Opportunity's estimated revenue.
Follows code:
function test (executionContext)
{
debugger;
try
{
var formContext = executionContext.getFormContext ();
formContext.data.refresh (true);
}
catch (e)
{
alert ("Error in test function:" + e.message);
}
}
Thank you
Hello Andrew good morning,
Thanks for the feedback.
I put the code you gave me, it did not present any kind of error, but did not update the page.
Theoretically every time the form is saved, reload the page because I have a javascript that calculates and updates Opportunity's estimated revenue.
Follows code:
function test (executionContext)
{
debugger;
try
{
var formContext = executionContext.getFormContext ();
formContext.data.refresh (true);
}
catch (e)
{
alert ("Error in test function:" + e.message);
}
}
Thank you
Try following:
function test (executionContext)
{
debugger;
try
{
var formContext = executionContext.getFormContext ();
formContext.data.refresh (true);
}
catch (e)
{
alert ("Error in test function:" + e.message);
}
}
Thanks for the reply,
I ran the formContext.data.refresh (save) .then code (successCallback, errorCallback) I'm getting the "save is not defined" error, below is the code I'm running
function test (executionContext)
{
debugger;
try
{
var formContext = executionContext.getFormContext ();
formContext.data.refresh (save) .then (successCallback, errorCallback);
}
catch (e)
{
alert ("Error in test function:" + e.message);
}
}
Hi partner,
Since you want to click a ribbon and then refresh the form, there are 2 steps you need to do.
1.Use Ribbon Workbench to add a custom ribbon on your form.
http://www.develop1.net/public/rwb/ribbonworkbench.aspx
2.Add the js code as a web resource to Dynamics 365 and trigger the js function in your custom ribbon in ribbon workbench.
Hope it helps.
Best Regards,
Leo
Adis
136
Super User 2025 Season 1
Sohail Ahmed
81
Jonas "Jones" Melgaard
77
Super User 2025 Season 1