What do u want to do on the basis of the profile Id ? I am not sure if its viable for your requirement but u cn try to assign a vf page to ur component and do all the stuff there.
Well creating a formula field and accessing the same wont work via homepage component. Home page component is just a place holder for HTML content and is different from VF pages.
The HTML area doesnt allow anytype of merge fields.
Can you elaborate your requirement lil bit ? You can do one thing, You can create a VF page and host the same from Homepage component using a HTML iframe. In this will you will get access to MergeFields as well as Controller.
Use '{!$Profile.Name}' within quotes wherever u need the profile name in javascript.
No..this did not work...
Can you paste your code please. The following works.
I want to fetch logged inuser's profile Id in home page component, no code as such
I used this in the home page component
alert('Profile: {!$Profile.Id}'); } </script>
and it display profile {!profile.Id} as it is..
I had pasted that code before i knew dat u r tryng it in a home page component. This works on a vf page actually.
That's why I have mentioned No page.. well do you know whether it can be achieved in Home page component ?
What do u want to do on the basis of the profile Id ? I am not sure if its viable for your requirement but u cn try to assign a vf page to ur component and do all the stuff there.
I just want to fetch the profile Id and if that profileId matches what I want then just bypass else nothing
I don't think you can get Profile Id without any CODE.
There is no way you can access API without the code, you will need either JS or VF page for this.
If you want to see the logged in uer's profile on aclick of a button say on account just do following;
1. Create a formula field : $Profile.Name (api name of formula field: .profile_name__c)
2. Your java script as below:
{!REQUIRESCRIPT("/soap/ajax/22.0/connection.js")}
var accountonwerid = '{!Account.profile_name__c}';
alert(accountonwerid);
Hit kudos and mark this answer if it helps you in any way.
Thanks
The HTML area doesnt allow anytype of merge fields.
You can do one thing, You can create a VF page and host the same from Homepage component using a HTML iframe. In this will you will get access to MergeFields as well as Controller.