[Salesforce][ENG]Get Prefix from ObjectName

Share to get the Prefix from Salesforce’s ObjectName.

Execute the following on the “Open Execute Anonymous Window” screen of the “Debug” tab on the development console screen.

    String objName ='Account';	
    schema.sObjectType sObjType = Schema.getGlobalDescribe().get(objName);
    system.debug('prefix:'+(sObjType.getDescribe().getKeyPrefix()));

The DebugLog result is below.

prefix:001

投稿者: kinkun

保有資格 Salesforce Certified Platform App Builder T Salesforce Certified Platform Developer I Salesforce Certified Platform Developer II Salesforce Certified Administrator

コメントを残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です