You need to sign in to do that
Don't have an account?
sasayong
Button in S-control to call another S-control
I have a form in SControl A and after submitting the form, a bunch of codes kick in and insert some entries into the database. How can i let the button or call SControl B after we have run the script correctly?
I managed to do it by using this
--------------
if(result[0].getBoolean("success"))
{
alert("new report request created with id " + result[0].id + " - " + result[0].name);
var returl ="{!$SControl.Subject_Selection}&rptid=" + result[0].id;
alert(returl);
this.parent.location.href = returl;
}
--------------
the returned url is correct but missing the usual salesforce header(menus etc). I'm new to this so learning trigger would be another challenge. am reading the trigger help currently and is abit lost....
i managed to get to this though
--------------
trigger t on Report_Request__c (isAfter) {
}
--------------
does this mean i have to put what i suppositely wants SControl.Subject_Selection into this Trigger?
http://community.salesforce.com/sforce/board/message?board.id=ajax_toolkit&message.id=5317
but i still couldnt get this loaded properly with
window.parent.location.href = returl;
as per salesforce design one should execute his code inside body iframe try to open your new url inside the body iframe. hope it will solve your issue
var returl = "{!URLFOR($Action.ObjectName.ButtonName)}";
URLfor tag is the best option, you can also try with
window.parent.parent.location.href = returl; instead of window.parent.location.href = returl;
Thanks & Regards,
SFGeek