function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
RockjackRockjack 

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}";
 
if ((userId != ownerId) && (profileName != "System Administratorx") {
 response = false;
}
 
Thanks for any help.