You need to sign in to do that
Don't have an account?

Verifying Record Ownership in S-Control
I have a button that executes an S-Control to create a new record of a custom object. The custom object is a related list of the Account object. I want to allow only owners and admins to create a new record.
Unfortunately the user seems unable to view the Account.OwnerId. The s-control is executing under the users permissions.
Is there another way to get the OwnerId using the user permissions?
var userId = "{!$User.Id}";
var ownerId = "{!Account.OwnerId}";
var profileName = "{!$Profile.Name}";
var ownerId = "{!Account.OwnerId}";
var profileName = "{!$Profile.Name}";
if ((userId != ownerId) && (profileName != "System Administratorx") {
response = false;
}
response = false;
}
Thanks for any help.