You need to sign in to do that
Don't have an account?
Gdickens3
I have a custom java script button that I need to modify to look at the user; is that possible?
My code below is the one I'd like to modify - it works fine for looking at fields on the account, but I am trying to use something similar but looking at the user clicking the button. I gett an error using userid or username.
Current Code (working):
{!REQUIRESCRIPT("/soap/ajax/20.0/connection.js")};
{!REQUIRESCRIPT("/soap/ajax/20.0/apex.js")};
if('{!Account.RecordType}' == "Unitrends - End User" || '{!Account.Account_Status__c}'=="Prospect")
alert ("Cases should be created from the Asset for current customers or from an Opportunity for Prospects");
else
open('500/e?retURL=%2F500%2Fo&RecordType=012300000000Xth&ent=Case');
NEW CODE for USER:
{!REQUIRESCRIPT("/soap/ajax/20.0/connection.js")};
{!REQUIRESCRIPT("/soap/ajax/20.0/apex.js")};
if('{!User.Id}'= "00540000001sVhY" )
alert ("Cases should be created from the Asset for current customers or from an Opportunity for Prospects");
else
open('500/e?retURL=%2F500%2Fo&RecordType=012f0000000D63a&ent=Case');
Current Code (working):
{!REQUIRESCRIPT("/soap/ajax/20.0/connection.js")};
{!REQUIRESCRIPT("/soap/ajax/20.0/apex.js")};
if('{!Account.RecordType}' == "Unitrends - End User" || '{!Account.Account_Status__c}'=="Prospect")
alert ("Cases should be created from the Asset for current customers or from an Opportunity for Prospects");
else
open('500/e?retURL=%2F500%2Fo&RecordType=012300000000Xth&ent=Case');
NEW CODE for USER:
{!REQUIRESCRIPT("/soap/ajax/20.0/connection.js")};
{!REQUIRESCRIPT("/soap/ajax/20.0/apex.js")};
if('{!User.Id}'= "00540000001sVhY" )
alert ("Cases should be created from the Asset for current customers or from an Opportunity for Prospects");
else
open('500/e?retURL=%2F500%2Fo&RecordType=012f0000000D63a&ent=Case');
Do try using {!$User.Id}
Regards,
Lakshmi.
Also: