RE: Error de Script- Where it's?
So in my script I must do this Change? (yeah... I repply before but I didn't see that your answers was charging yet...)
Actual Script:
if (Xrm.Page.ui.getFormType() == 1 && status == "invalid")
{
function successCallback()
{
Xrm.Utility.openEntityForm(Xrm.Page.data.entity.getEntityName(), Xrm.Page.data.entity.getId());
}
function errorCallback()
{
console.log("error");
}
Xrm.Page.data.entity.save().then(successCallback, errorCallback);
}
----------------------
function successCallback()
{
if(Xrm.Page.ui.getFormType() == 1 && status == "invalid") //You can add condition here
{
Xrm.Utility.openEntityForm(Xrm.Page.data.entity.getEntityName(), Xrm.Page.data.entity.getId());
}
}
function errorCallback()
{
if(Xrm.Page.ui.getFormType() == 1 && status == "invalid") //You can add condition here
{
console.log("error");
}
}
if(Xrm.Page.ui.getFormType() == 1 && status == "invalid")
{
Xrm.Page.data.entity.save().then(successCallback, errorCallback);
}
All in the same sentence? (Inside of "If (StageName === "Etapa 1-...")??
Or I must do what? (Two Option)
1)Add Outside the If Stages Sentence : Success and Error CallBacks functions and Inside the If Stage Sentence: Xrm.Page.data.entity.save()....
2)Add Inside the If Stages Sentence : Success, Error and Xrm.Page.data.entity.save().....