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
Ranu JainRanu Jain 

Profile id in Java script

How to get profile id ot Name in java script ?


I am using java script in home page component.


Hi Ranu Jain,

Just try this

var result = sforce.connection.query("select id from profile where Name='System Administrator'");

var records = result.getArray("records");
if (records.length != 1) throw "unable to find id";
var id = records[0].Id;

the Var id will contains profile id.