You need to sign in to do that
Don't have an account?
Error when overriding Activity Log a Call or Send an Email
I need to pre-default the Related To field in tasks and events to the Contact's Account Id.
It's working when I've overridden 'New Task' and 'New Event', however when I try much the same thing with the 'Log a call' and 'Send an Email' functions my s-control has an error.
Successful s-control for overriding 'New Task' making use of URLFOR functionality.
Unsuccessful s-control for overriding 'Log a Call' making use of URLFOR functionality.
This causes the s-control to run twice? and the browser URL ends up with an error: https://cs2.salesforce.com/servlet/servlet.Integration?lid=01NR00000004SFO&ic=1#Error! that seems to thankfully prevent it from looping infinitely.
Any suggestions about what I should try?
Note: the Send an Email s-control is almost the same as above but with the different action of course.
Message Edited by manu on 08-13-2008 04:05 PM
Message Edited by manu on 08-13-2008 04:05 PM
It's working when I've overridden 'New Task' and 'New Event', however when I try much the same thing with the 'Log a call' and 'Send an Email' functions my s-control has an error.
Successful s-control for overriding 'New Task' making use of URLFOR functionality.
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<script type="text/javascript" src="/js/functions.js"></script>
<script src="/soap/ajax/13.0/connection.js"></script>
<script type="text/javascript" >
function redirectToRecord() {
var newURL = "{!URLFOR($Action.Task.NewTask, null, [who_id=Contact.Id, what_id=Account.Id, retURL=URLFOR($Action.Contact.View, Contact.Id)], true)}";
parent.frames.location.replace(newURL);
}
</script>
</head>
<body onload="redirectToRecord();">
</body>
</html>
Unsuccessful s-control for overriding 'Log a Call' making use of URLFOR functionality.
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<script type="text/javascript" src="/js/functions.js"></script>
<script src="/soap/ajax/13.0/connection.js"></script>
<script type="text/javascript" >
function redirectToRecord() {
var newURL = "{!URLFOR($Action.Activity.LogCall, null, [who_id=Contact.Id, what_id=Account.Id, retURL=URLFOR($Action.Contact.View, Contact.Id)], true)}";
parent.frames.location.replace(newURL);
}
</script>
</head>
<body onload="redirectToRecord();">
</body>
</html>
This causes the s-control to run twice? and the browser URL ends up with an error: https://cs2.salesforce.com/servlet/servlet.Integration?lid=01NR00000004SFO&ic=1#Error! that seems to thankfully prevent it from looping infinitely.
Any suggestions about what I should try?
Note: the Send an Email s-control is almost the same as above but with the different action of course.
Message Edited by manu on 08-13-2008 04:05 PM
Message Edited by manu on 08-13-2008 04:05 PM
however the who_id and what_id fields are not populated.
Am wondering if it has something to do with the format of the URL string as this does not populate the fields:
whereas this does:
Do I need to somehow change the URL characters back to '=' and '&' before redirecting the page??
Also, the what_id is included in the inputs for URLFOR but does not show here, whereas it works for 'New Task'?
Message Edited by manu on 08-14-2008 08:56 AM
I have tried passing "subject=", "subject_id=", "Subject=" as a URL parameter, but it did not work.
Ciao
Stefano
thanks :)
manu