You need to sign in to do that
Don't have an account?
hideawayguy
pass variables to home page component
hello,
is there anyway to pass variables to a home page component from data on the usr record? or from a url? i'm have an iframe on a home page component that displays an s control that displays a calendar for a certain group, and based on which group it needs a different id in the url for the iframe to render the proper data.
thank you.
dustin
Hi,
You cannot pass variables. But What you can do is, using javascript u can query the desured values from the user record.
Find the sample code below. You can use this in your page component.
<SCRIPT type=text/javascript src="/soap/ajax/28.0/connection.js"></SCRIPT>
<SCRIPT type=text/javascript>
function getProfileId(){
sforce.connection.sessionId = window.ApiUtils.getSessionId();
sforce.connection.query(
"SELECT ProfileId FROM User WHERE Id = '" + window.UserContext.userId + "'",
{
onSuccess:
function(result){
document.getElementById('lblProfileId').innerHTML = result.records.ProfileId;
var profId= result.records.ProfileId;
alert('Profile Id: ' + profId);
},
onFailure:
function(){
document.getElementById('lblProfileId').innerHTML = '#ERROR';
}
}
);
}
getProfileId();
</SCRIPT>
Regards,
Arun
All Answers
Hi,
You cannot pass variables. But What you can do is, using javascript u can query the desured values from the user record.
Find the sample code below. You can use this in your page component.
<SCRIPT type=text/javascript src="/soap/ajax/28.0/connection.js"></SCRIPT>
<SCRIPT type=text/javascript>
function getProfileId(){
sforce.connection.sessionId = window.ApiUtils.getSessionId();
sforce.connection.query(
"SELECT ProfileId FROM User WHERE Id = '" + window.UserContext.userId + "'",
{
onSuccess:
function(result){
document.getElementById('lblProfileId').innerHTML = result.records.ProfileId;
var profId= result.records.ProfileId;
alert('Profile Id: ' + profId);
},
onFailure:
function(){
document.getElementById('lblProfileId').innerHTML = '#ERROR';
}
}
);
}
getProfileId();
</SCRIPT>
Regards,
Arun
thank you very much arun, i'll give it a shot...
dustin