You need to sign in to do that
Don't have an account?
BeatofHeart
Hyperlink onclick javascript console Problem
Hi ,
I am having an issue with javascript in Console. which is working fine in out of console. below is my code. i am not sure how to pass parameteres in console.
HYPERLINK("javascript:if(typeof(srcUp)=='function') {srcUp('https://imagenow.com/webnow/index.jsp?action=document&folder= {!SUBSTITUTE( Contact.emplid__c , " ", "+") }'); } else { window.open('https://imagenow.com/webnow/index.jsp?action=document&folder= {!SUBSTITUTE( Contact.emplid__c , " ", "+") }'); }
Any help would be appriciated.
I'm going to suggest you check your single and double quotes, it looks like you start with a double and end with a single?
This kind of stuff is always troublesome, if its not the problem above it could be other issues with escaping strings...
Something like this:
HYPERLINK("javascript:alert('Margin: '&Margin__c&'\Margin 2: '&Margin_2__c&'\nPercentile: '&Percentile__c);",'Click for info' , '_blank')
Works fine if you take out the custom fields. I feel like JS can't access the custom fields in the hyperlink. Maybe that's because we need to define the object in JS so the code knows where to pull the fields from?
(...may have just given myself an idea here...)
HYPERLINK("javascript:alert('Margin: "&Text(Margin__c)&"\Margin 2: "&Text(Margin_2__c)&"\nPercentile: "&Text(Percentile__c)&"');",'Click for info' , '_blank')
Hope this helps somebody in the future! VERY helpful for calling JS out of a list view, where you don't want to select multiple records and instead see details for only one record with one click.