function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
RufussRufuss 

s-control content syntax issue

Hi all,

Sorry - stupid question probably but syntax below doesnt work - clicking the link in Contacts page simply takes me to a dead end, rather than an Event linked to the contact and the Location field pre-populated with the contact mailing street and city.  I have stripped this thing down and it is the first three lines of the function that are causing the problem.  If I were to set var loc = 1; then all works fine.

Any ideas would be most appreciated. This is meant to be a quick link!


<script language="JavaScript">
function redirect() {
var loc1 = "{!Contact.MailingStreet}";
var loc2 = "{!Contact.MailingCity}";
var loc = loc1 + ", "+ loc2;
parent.frames.location.replace("/00U/e?retURL=%2F{!Contact.Id}&who_id={!Contact.Id}&evt12="+loc+"")
}
redirect();
</script>

Regards,
Rufuss.

michaelforcemichaelforce

I'm not sure if this will fix it or not... but to aim the browser to a URL through an sControl, I typically go with this syntax:

top.window.location = "whateverURL";

Give it a whirl and see if it makes a difference.

RufussRufuss
Thanks for the input.  I've used your frames suggestion and pre-built the address string in a formula field. Now works fine.

Thanks again,
Rufuss.