Quantcast
Channel: Microsoft Dynamics CRM Forum - Recent Threads
Viewing all articles
Browse latest Browse all 82002

Javascript, run code after save

$
0
0

Hi!

We have the following code that runs when we click a button: 

function followUpTask(duration) {
debugger;
//check for not saved form

if (Xrm.Page.ui.getFormType() == 1 && followup == false) {
Xrm.Page.data.entity.save(true);
followupduration = duration;
followup = true;
return;
}
else if (Xrm.Page.data.entity.getIsDirty()) {

Xrm.Page.data.entity.save(true);
followupduration = duration;
followup = true;
return;
}

If the else if (Xrm.Page.data.entity.getIsDirty()) statement is true the form saves but following code

followupduration = duration;
followup = true;

will not run... We have to click the button once more for the code to run. Is there a way we can change this so the code runs after the form is saved?

Thanks for help! 


Viewing all articles
Browse latest Browse all 82002

Latest Images

Trending Articles



Latest Images