Redirect on Save in dialog
Posted: 12 Oct 2017
I have a scenario where I want to open a New form in a dialog and on submission of that form depending on certain criteria redirect to another new form again ideally in a dialog.
The first section of this I have working no problem in that I can open the initial new form in a dialog, my criteria at the moment for then opening another new form on submit is that the users completes the form and chooses a follow up action of "Create a Task" in this scenario on submission the New Task form should open, I also want to pass through a number of parameters. I have tried many different versions of code, my current one is
This just doesn't do anything.
Any help appreciated.
Thanks
The first section of this I have working no problem in that I can open the initial new form in a dialog, my criteria at the moment for then opening another new form on submit is that the users completes the form and chooses a follow up action of "Create a Task" in this scenario on submission the New Task form should open, I also want to pass through a number of parameters. I have tried many different versions of code, my current one is
Code: Select all
fd.onsubmit(function() {
if (followUpAction == "Create a Task") {
var CompanyNameId = fd.field('Company_x0020_Name').value();
var CompanyName = fd.field('Company_x0020_Name').control('data')['Title'];
var ContactNameId = fd.field('Contact_x0020_Name').value();
var ContactName = fd.field('Contact_x0020_Name').control('data')['Title'];
var OpportunityNameId = fd.field('Opportunity_x0020_Name').value();
if (OpportunityNameId != "") {
var OpportunityName = fd.field('Opportunity_x0020_Name').control('data')['Title'];
}
var AddressNameId = fd.field('Address_x0020_Name').value();
if (AddressNameId != "") {
var AddressName = fd.field('Address_x0020_Name').control('data')['Title'];
}
var source = location.pathname + "?CompanyNameId="+CompanyNameId+"&CompanyName=" + CompanyName + "&ContactNameId=" + ContactNameId + "&ContactName=" + ContactName + "&OpportunityNameId=" + OpportunityNameId + "&OpportunityName=" + OpportunityName + "&AddressNameId=" + AddressNameId + "&AddressName=" + AddressName;
$("fd_Task_73de5f08-25d4-4396-a6fd-9d276f3945fc_NewForm.aspx").attr('action', location.pathname + '?Source=' + encodeURIComponent(source));
}
return true;
});
Any help appreciated.
Thanks