You need to sign in to do that
Don't have an account?
Shannon Andreas 21
Javascript button Help - Keeps returning me to Home tab on Save
Hello!
Need help with this button. Keeps returning me to the Home tab. How can I make it return to the case where the button began?
{!REQUIRESCRIPT("/soap/ajax/31.0/connection.js")}
var tskObj = new sforce.SObject("Task");
tskObj.Status = "Not Started";
tskObj.RecordTypeId ="012Q0000000DIKh";
tskObj.OwnerId ="{!$User.Id}";
tskObj.WhoId ="{!Case.ContactId}";
tskObj.WhatId="{!Case.Id}";
tskObj.Priority ="Normal";
tskObj.Subject ="VOC VEP Follow Up Request";
var result = sforce.connection.create([tskObj]);
if (result[0].success=="false") {
alert(result[0].errors.message);
} else {
var newURL = "/" + result[0].id + "/e";
window.top.location = newURL;
}
Thank you!!
Shannon
Need help with this button. Keeps returning me to the Home tab. How can I make it return to the case where the button began?
{!REQUIRESCRIPT("/soap/ajax/31.0/connection.js")}
var tskObj = new sforce.SObject("Task");
tskObj.Status = "Not Started";
tskObj.RecordTypeId ="012Q0000000DIKh";
tskObj.OwnerId ="{!$User.Id}";
tskObj.WhoId ="{!Case.ContactId}";
tskObj.WhatId="{!Case.Id}";
tskObj.Priority ="Normal";
tskObj.Subject ="VOC VEP Follow Up Request";
var result = sforce.connection.create([tskObj]);
if (result[0].success=="false") {
alert(result[0].errors.message);
} else {
var newURL = "/" + result[0].id + "/e";
window.top.location = newURL;
}
Thank you!!
Shannon
Try below JavaScript Code.
Let me know what is the outcome.
Thanks,
AMit Singh.