You need to sign in to do that
Don't have an account?
MikeMike
Need assistance with an S-Control that can branch to 2 separeat URL's based on a test
Here's my situation, I have a Custom button that points to and runs an executable and returns a value in a separate window. It currently is listed as Content Source: URL a lists a single URL.
I need to make the process conditional. I would like to test whether a field is populated. If it is not, the existing URL process is valid. I created a URL pointing to '.txt' file with an Error Message and would like to display message if the field to be tested has a value.
I changed the Content Source of the button from URL to OnClick JavaScript. After several attempts, here's what I have:
<script type="text/javascript">
//determine if a license key already exists
IF ISNULL( Asset.Station_License_Key__c )
// NO - go ahead and create one
{
"http://zugiis01/LicenseEXE/lgen.dll?ID={!Asset.Id}&USER={!User.Email}"
}
ELSE
// ALREADY EXISTS - display "no-go" message
{
"http://zugiis01/_index.php3?path=/MR_test"
}
</script>
//determine if a license key already exists
IF ISNULL( Asset.Station_License_Key__c )
// NO - go ahead and create one
{
"http://zugiis01/LicenseEXE/lgen.dll?ID={!Asset.Id}&USER={!User.Email}"
}
ELSE
// ALREADY EXISTS - display "no-go" message
{
"http://zugiis01/_index.php3?path=/MR_test"
}
</script>
This gives me a vague message, something about mixing scripts.
Please help. Thanks in advance,
if ('{!Asset.Station_License_Key__c}'=='') {
// go to one URL
location.replace('URL here');
} else {
// go to the other URL
location.replace('other URL here');
}
Possible cross site scripting attempt detected.
//determine if a license key already exists
// IF ISNULL( Asset.Station_License_Key__c )
// NO - go ahead and create one
// {
// "http://zugiis01/LicenseEXE/lgen.dll?ID={!Asset.Id}&USER={!User.Email}"
// }
//ELSE
// ALREADY EXISTS - display "no-go" message
// {
// http://zugiis01/_index.php3?path=/MR_test
}
if ('{!Asset.Station_License_Key__c}'=='') {
// go to one URL
location.replace('http://zugiis01/LicenseEXE/lgen.dll?ID={!Asset.Id}&USER={!User.Email}');
}
else
// go to the other URL
{
location.replace('http://zugiis01/_index.php3?path=/MR_test');
}