text
stringlengths
24
5.1k
apex reference guide version 58.0, summer ’23 @salesforcedocs last updated: june 15, 2023© copyright 2000–2023 salesforce, inc. all rights reserved. salesforce is a registered trademark of salesforce, inc., as are other names and marks. other marks appearing herein may be trademarks of their respective owners.contents ...
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46 lockresult class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46 processrequest class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49 processre...
115contents jwt class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118 jwtbearertokenexchange class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123 lightninglogineligibility enum . . . . . . . . . . . . . . . . . . . . . . . ...
class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 199 session class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 214 sessionpartition class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ....
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 273 authorizationreversalrequest class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 274 authorizationreversalresponse class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 278 authorizationrequest class . . . . . ...
333 paymentgatewayasyncadapter interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 334 paymentgatewaycontext class. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 337 paymentgatewaynotificationcontext class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ...
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 401 cdpidentityresolution class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 407 cdpquery class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 410 cdpsegment class . ...
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1111 contenthub class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1140 conversationapplicationdefinition class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1214 datacloud clas...
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1333 omnichannelinventoryservice class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1339 orchestration class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1346 orderpaymentsummary class...
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1461 surveys class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1472 taxplatform class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1473 t...
dmloptions.emailheader class. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2044 duplicateerror class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2047 emptyrecyclebinresult class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ....
. . . . . . . . . . 2086 findduplicatesresult class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2088 matchrecord class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2091 matchresult class. . . . . . . . . . . . . . . . . . . . . . . . ....
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2136 order class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2137 orderdirection enum . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2139 provider class . . . ...
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2171 document class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2171 xmlnode class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2174 eventbus names...
. . . . . . . . . . . . . . . . . . . . 2214 functioninvokemock interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2215 mockfunctioninvocationfactory class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2218 invocable namespace. . . . . . . . . . . . . . . . . ....
. . . . . . . . . . . . . . . . 2278 serviceresourceschedule class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2281contents unavailabletimeslot class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2282 messaging namespace . . . . . . . . . . . . . . . ....
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2328 singleemailmessage methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2329 metadata namespace . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2341 a...
class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2387 feedlayoutfilterposition enum. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2389 feedlayoutfiltertype enum . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2...
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2423 relatedcontent class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2424 relatedcontentitem class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2425 relatedli...
. . . . . . . . . . . 2460 tokentype enum . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2461 tokenutility class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2462 validationresult class . . . . . . . . . . . . . . . . . . ...
. . 2512 quickactionresult class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2515 sendemailquickactiondefaults class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2517 reports namespace . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ...
. . . . . . . . . . . . . . 2551 groupinginfo class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2553 groupingvalue class. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2554 notificationaction interface . . . . . . . . . . . . . . ...
. . . . 2591 reportresults class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2611 reportscopeinfo class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2613 reportscopevalue class . . . . . . . . . . . . . . . . . . . . . . . . . . ...
. . . . . . . . . . . . . . . . . 2640 authrequestresponse class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2643 authrequestresult class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2645 authrequestresultstatus enum . . . . . . . . . . . . . . . ...
. . . . . . . . . . . . 2711 picklistentry class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2713 recordtypeinfo class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2715 soaptype enum . . . . . . . . . . . . . . . . . . . . ...
bcheckoutcontroller class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2744 integrationinfo class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2745 integrationstatus class. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ....
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2776 assert class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2788 asyncinfo class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2801 asyncoptions c...
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2998 domaincreator class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3001 domainparser class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3005 domaintype enum . . . . . . ...
. . . . 3056contents ideas class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3063 installhandler interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3068 integer class. . . . . . . . . . . . . . . . . . . . . . . . . ....
. . . . . . . . . . . . . . . . . . . 3205 orglimit class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3210 orglimits class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3213 pagereference class . . . . . . . . . ...
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3265 security class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3271 selectoption class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32...
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3493 usermanagement class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3502 version class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 352...
. . . . . . . . . . . . . . . . . . . . . . . . 3574 dynamicpicklist class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3576 dynamicpicklistrows class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3579 wave namespace . . . . . . . . . . . . . ...
cache namespace contains methods for managing the platform cache. canvas namespace the canvas namespace provides an interface and classes for canvas apps in salesforce. chatteranswers namespace the chatteranswers namespace provides an interface for creating account records. commercepayments namespace use the commercepa...
notes. for new and changed apex classes, methods, exceptions and interfaces, see apex: new and changed items in the salesforce release notes. 3apex reference guide apex dml operations apex dml operations you can perform dml operations using the apex dml statements or the methods of the database class. for lead conversi...
matched once, the existing object record is updated. • if the key is matched multiple times, an error is generated and the object record isn’t inserted or updated. example this example performs an upsert of a list of accounts. list<account> acctlist = new list<account>(); // fill the accounts list with some accounts tr...
knowledgearticleversionstandardcontroller objects offer article-specific functionality in addition to what is provided by the standardcontroller. message class contains validation errors that occur when the user saves the page that uses a standard controller. standardcontroller class use a standardcontroller when defin...
, contact your salesforce representative. in addition to the methods listed in this class, the ideastandardcontroller class inherits all the methods associated with the standardcontroller class. instantiation an ideastandardcontroller object cannot be instantiated. an instance can be obtained through a constructor of a...
ideasetcontroller.getidealist(); // modify ideas here return ideas; } } the following visualforce markup shows how the ideastandardsetcontroller example shown above and the <ideas:profilelistoutputlink> component can display a profile page that lists the recent replies, submitted ideas, and votes associated with a user...
x:pageblock> </apex:page> 16apex reference guide ideastandardsetcontroller class in the previous example, the <ideas:detailoutputlink> component links to the following visualforce markup that displays the detail page for a specific idea. this page must be named viewpage. <!-- page named viewpage --> <apex:page standard...
tenance'); } } /** test class for the custom extension controller. */ @istest private class agentcontributionarticlecontrollertest { static testmethod void testagentcontributionarticlecontroller() { string casesubject = 'my test'; string casedesc = 'my test description'; case c = new case(); c.subject= casesubject; c.d...
apexpages.message mymsg = new apexpages.message(apexpages.severity, summary, detail); where apexpages. severity is the enum that determines how severe a message is, summary is the string used to summarize the message, and detail is the string used to provide more detailed information about the error. apexpages.severity...
(sobject); 25apex reference guide standardcontroller class example the following example shows how a standardcontroller object can be used in the constructor for a standard controller extension: public class mycontrollerextension { private final account acct; // the extension constructor initializes the private member ...
type: string getrecord() returns the record that is currently in context, based on the value of the id query string parameter in the visualforce page url. signature public sobject getrecord() return value type: sobject usage note that only the fields that are referenced in the associated visualforce markup are availabl...
standardsetcontroller constructors the following are constructors for standardsetcontroller. in this section: standardsetcontroller(querylocator) creates an instance of the apexpages.standardsetcontroller class for the list of objects returned by the query locator. standardsetcontroller(controllersobjects) creates an i...
apex reference guide standardsetcontroller class example list<account> accountlist = [select name from account limit 20]; apexpages.standardsetcontroller ssc = new apexpages.standardsetcontroller(accountlist); standardsetcontroller methods the following are methods for standardsetcontroller. all are instance methods. i...
ords() return value type: sobject[] 36apex reference guide standardsetcontroller class getresultsize() returns the number of records in the set. signature public integer getresultsize() return value type: integer getselected() returns the list of sobjects that have been selected. signature public sobject[] getselected(...
�s default sort order for the app launcher based on a list of app menu item ids in the desired order. signature public static void setusersortorder(list<id> appids) parameters appids type: list<id> a list of application id values. for more information, see the appmenuitemid field for userappmenuitem in the salesforce o...
when they access the experience cloud site. samlid type: string unique identifier of the saml provider. return value type: string getsamlssourlnocache(starturl, samlid) returns the url to the saml provider for the experience cloud site, without caching the url. calling this method also initiates a backend call. signatu...
returns the id of the sobject you are trying to lock. issuccess() a boolean value that is set to true if the lock operation is successful for this object, or false otherwise. geterrors() if an error occurred, returns an array of one or more database error objects, providing the error code and description. signature pub...
: database.error[] getinstanceid() the id of the approval process that has been submitted for approval. signature public string getinstanceid() return value type: string getinstancestatus() the status of the current approval process. valid values are: approved, rejected, removed or pending. signature public string geti...
(string recordid) parameters recordid type: string return value type: void setprocessdefinitionnameorid(nameorid) sets the developer name or id of the process definition to be evaluated. signature public void setprocessdefinitionnameorid(string nameorid) parameters nameorid type: string the process definition developer...
approval request that is being approved, rejected, or removed. signature public void setworkitemid(string id) parameters id type: string return value type: void 58apex reference guide unlockresult class unlockresult class the result of a record unlock, returned by a system.approval.unlock() method. namespace approval u...
instead of their salesforce credentials. the authentication provider can be any authentication provider that supports the openid connect protocol, such as google, facebook, or twitter. users log in to either an experience cloud site (https://mydomainname.my.site.com) or your my domain login url (https://mydomainname.my...
flow provides a refresh token that can be used to get a new access token. access tokens have a limited lifetime as specified by the session timeout value. when an access token expires, use a refresh token to get a new access token. registrationhandler interface salesforce provides the ability to use an authentication p...
the list of authentication providers available for an experience cloud site or salesforce my domain subdomain. getauthproviderssodomainurl(communityurl, starturl, developername) returns the single sign-on url for an experience cloud site subdomain. getauthproviderssourl(communityurl, starturl, developername) returns th...
s) for the experience cloud site or my domain subdomain. getauthproviderssodomainurl(communityurl, starturl, developername) returns the single sign-on url for an experience cloud site subdomain. note: for better performance, we recommend using this method instead of getauthproviderssourl. if the authentication provider...
this class instead. signature public boolean getheadlessfrgtpswenabled() return value type: boolean getheadlessregistrationenabled() determines if the headless registration flow is enabled. signature public boolean getheadlessregistrationenabled() return value type: boolean returns true if headless registration is enab...
. authprovidercallbackstate(headers, body, queryparameters) creates an instance of the authprovidercallbackstate class using the specified http headers, body, and query parameters of the authentication request. signature public authprovidercallbackstate(map<string,string> headers, string body, map<string,string> queryp...
signature public auth.authprovidertokenresponse handlecallback(map<string,string> authproviderconfiguration, auth.authprovidercallbackstate callbackstate) parameters authproviderconfiguration type: map<stringstring> the configuration for the custom authentication provider. when you create a custom metadata type in sale...
-based authentication provider for single sign-on to salesforce. signature public string getcustommetadatatype() return value type: string the custom metadata type api name for the authentication provider. usage the getcustommetatadatype() method returns only custom metadata type names. it does not return custom metada...
apex reference guide authproviderpluginclass class usage as of api version 39.0, use this method when extending auth.authproviderpluginclass to create a custom authentication provider. refresh(authproviderconfiguration, refreshtoken) returns a new access token, which is used to update an expired access token. signature...
map<string,string> authproviderconfiguration, auth.authprovidertokenresponse response) { //here the developer is responsible for constructing an //auth.userdata object string token = response.oauthtoken; httprequest req = new httprequest(); userapiurl = authproviderconfiguration.get('api_user_url__c'); userapiversionur...
_url); authproviderconfiguration.put('api_user_url__c',api_user_url); authproviderconfiguration.put('api_user_version_url__c', 86apex reference guide authproviderpluginclass class api_user_version_url); authproviderconfiguration.put('redirect_url__c',redirect_url); return authproviderconfiguration; } static testmethod ...
equals(expecteduserdata.locale, actualuserdata.locale); system.assertequals(expecteduserdata.provider, actualuserdata.provider); system.assertequals(expecteduserdata.siteloginurl, actualuserdata.siteloginurl); } // implement a mock http response generator for concur. public class concurmockhttpresponsegenerator impleme...
authtoken. all methods are static. in this section: getaccesstoken(authproviderid, providername) returns an access token for the current user using the specified 18-character identifier of an authprovider definition in your org and the proper name of the third party, such as salesforce or facebook. note that querying t...
string, string> refreshaccesstoken(authproviderid, providername, oldaccesstoken) returns a map from the third-party identifier containing a refreshed access token for the currently logged-in salesforce user. note that querying the providertype field on the authprovider object sometimes returns a value that differs from...
and authenticated users of the experience cloud site’s parent organization to another page. if (auth.communitiesutil.isguestuser()) // redirect to the login page if user is an unauthenticated user return new pagereference(login_url); if (auth.communitiesutil.isinternaluser()) // redirect to the home page if user is an ...
reghandler. in this section: createuser(accountid, profileid, registrationattributes, password) create a community member from the information that the visitor provided on your community’s self-registration page. createuser(accountid, profileid, registrationattributes, password) create a community member from the infor...
u); generatecontact(u, accountid); if (string.isblank(password)) { password = generaterandompassword(); } site.validatepassword(u, password, password); if (u.contactid == null) { return site.createexternaluser(u, accountid, password); } u.languagelocalekey = userinfo.getlocale(); u.localesidkey = userinfo.getlocale(); ...
// default implementation to try to provide uniqueness. private string generateusername() { return 'externaluser' + current_time + '@company.com'; } // default implementation to try to provide uniqueness. private string generateemail() { return 'externaluser' + current_time + '@company.com'; } // default implementation...
= data.attributemap.get('language'); u.localesidkey = data.locale; u.emailencodingkey = 'utf-8'; u.timezonesidkey = 'america/los_angeles'; u.profileid = p.id; return u; } global void updateuser(id userid, id portalid, auth.userdata data) { user u = new user(id=userid); u.username = data.username + '@salesforce.com'; 10...
) { // create a custom boolean field hasachievedquota__c on the user record // and then uncomment the block below // user u = [select id, hasachievedquota__c from user where id =: userid].get(0); // return u.hasachievedquota__c; return isadminapproved; } // call a flow during refresh global override void refresh(id use...
. authorize(userid, connectedappid, isadminapproved, context) authorizes the specified user to access the connected app. if the connected app is set for users to self-authorize, this method isn’t invoked. signature public boolean authorize(id userid, id connectedappid, boolean isadminapproved, auth.invocationcontext co...
in. the plug-in must include validation and error handling. if the plug-in throws an exception, catch it, log it, and stop the process. don’t send anything to the target service provider. refresh(userid, connectedappid) deprecated and available only in api versions 35.0 and 36.0. as of version 37.0, use refresh(userid,...
.isempty()) { a = new account(name = social_account); insert(a); }else a = accounts[0]; generatecontact(u, a.id); u.languagelocalekey = userinfo.getlocale(); u.localesidkey = userinfo.getlocale(); u.emailencodingkey = 'utf-8'; u.timezonesidkey = userinfo.gettimezone().getid(); return u; } private user handleunsetrequir...
certdevname type: string the unique name for a certificate stored in the salesforce org’s certificate and key management page to use for signing the jwt bearer token. usage calls the tojsonstring() method in auth.jwt and sets the resulting string as the payload of the jwt bearer token. alternatively, you can specify th...
of additional claims in the jwt, where the key string contains the name of the claim, and the value contains the value of the claim. signature public map<string,any> getadditionalclaims() return value type: map<string,any> getaud() returns the audience claim that identifies the intended recipients of the jwt. signature...
pgzhq ukxnvjzrgsuqqgn75nl7yfkqcyy7'); //additional claims to set scope 123apex reference guide jwtbearertokenexchange class map<string, object> claims = new map<string, object>(); claims.put('scope', 'scope name'); jwt.setadditionalclaims(claims); //create the object that signs the jwt bearer token auth.jws jws = new a...
wt-bearer. signature public string getgranttype() return value type: string gethttpresponse() returns the full system.httpresponse token response to the jwt bearer token request. signature public system.httpresponse gethttpresponse() 126apex reference guide jwtbearertokenexchange class return value type: system.httpres...
handler, the login page doesn't show a password field. however, you can use site.passwordlesslogin to then prompt for a password. from the user perspective, the user enters an identifier at the log in prompt. then the user completes the login by entering a pin or password. or, if sso-enabled, the user bypasses login. f...
pagereference login(string identifier, string starturl, map<string, string> requestattributes) { if (identifier != null && isvalidemail(identifier)) { // search for user by email. list<user> users = [select id from user where email = :identifier and isactive = true]; if (!users.isempty() && users.size() == 1) { // user...
apex reference guide logindiscoveryhandler interface // accept sms input formats with 1- or 2-digit country code, // 3-digit area code, and 7-digit number. // you can customize the sms regex to allow different formats. string smsregex = '^(\\+?\\d{1,2}?[\\s-])?(\\(?\\d{3}\\)?[\\s-]?\\d{3}[\\s-]?\\d{4})$'; pattern smspa...
// use email verification method if the user's email is verified. return discoveryresult(users[0], auth.verificationmethod.email, starturl, requestattributes); } else { // use password verification method as fallback if the user's email is unverified. return discoveryresult(users[0], auth.verificationmethod.password, s...
and return the url to initialize sso. return null; } private pagereference discoveryresult(user user, auth.verificationmethod method, string starturl, map<string, string> requestattributes) { //only users with an external identity or community license can login using site.passwordlesslogin //use getssoredirect to enabl...
a sample requestattributes response. communityurl=http://my-dev-ed.my.salesforce.com:5555/discover ipaddress=55.255.0.0 useragent=mozilla/5.0 (macintosh; intel mac os x 10_13_4) applewebkit/605.1.15 (khtml, like gecko) version/11.1 safari/605.1.15 platform=mac osx application=browser city=san mateo country=united state...
defaulthandler.login(identifieremail,starturl,requestattributes); // asser page reference is returned system.assertnotequals(null, pagereference, 'page reference was not returned'); } /* test discoverable handler login with invalid (non-existing) user. expected : auth.logindiscoveryexception */ @istest static void test...
access token and refresh token for a custom authentication provider plug-in. use this method when you know that the refresh was successful. signature public oauthrefreshresult(string accesstoken, string refreshtoken) parameters accesstoken type: string the oauth access token for the user who is logged in. refreshtoken ...
auth.userdata class is used to store user information for auth.registrationhandler. the third-party authentication provider can send back a large collection of data about the user, including their username, email address, locale, and so on. frequently used data is converted into a common format with the auth.userdata c...
agelocalekey = data.attributemap.get('language'); u.localesidkey = data.locale; update(u); } } the following example tests the above code. @istest private class standarduserregistrationhandlertest { static testmethod void testcreateandupdateuser() { standarduserregistrationhandler handler = new standarduserregistration...
. the user object corresponds to the user information. this object can be a new user that hasn’t been inserted in the database or an existing user record in the database. updateuser(userid, samlssoproviderid, communityid, portalid, federationid, attributes, assertion) updates the specified user’s information. this meth...
create, user u, map<string, string> attributes, string federationidentifier, boolean isstandard) { if(create && attributes.containskey('user.username')) { u.username = attributes.get('user.username'); } if(create) { if(attributes.containskey('user.federationidentifier')) { u.federationidentifier = attributes.get('user....
the user to a custom login flow. for example, use after a login attempt to redirect the user to password flow if the user is ineligible for lightning login. getqrcode() returns a map containing a url to a quick response (qr) code and a time-based one-time password (totp) shared secret to configure authenticator apps or...
the login flow is finished and redirects the user to the specified location in the experience cloud site. the login process runs in a restricted session until users complete the process. calling this method indicates that the login flow is complete, lifts the restriction, and gives users full access to the experience c...
16 gmt 2014, logouturl=https://google.com, sessionsecuritylevel=standard, usersid=005###############, sourceip=1.1.1.1 } getlightninglogineligibility(userid) returns the eligibility status for a user who’s logging in with lightning login when you set up your org with my domain and use the login discovery page type. use...
isipallowedforprofile(profileid, ipaddress) indicates whether the given ip address is within the trusted ip range for the given profile. signature public static boolean isipallowedforprofile(string profileid, string ipaddress) parameters profileid type: string the 15-character alphanumeric string for the current user’s...
(string totpcode) parameters totpcode type: string the time-based one-time password (totp) code to validate. return value type: boolean usage if the current user does not have a totp code, this method throws an exception. if the current user has attempted too many validations, this method throws an exception. validatet...
.userdata class using the specified arguments. 165apex reference guide userdata class userdata(identifier, firstname, lastname, fullname, email, link, username, locale, provider, siteloginurl, attributemap) creates a new instance of the auth.userdata class using the specified arguments. signature public userdata(string...
locale {get; set;} property value type: string provider the service used to log in, such as facebook or janrain. signature public string provider {get; set;} property value type: string siteloginurl the site login page url passed in if used with a site; null otherwise. 169apex reference guide verificationmethod enum si...
verificationresult has the following constructor. in this section: verificationresult(redirect, success, message) creates an instance of the verificationresult class that contains the verification result from system.usermanagement.verifyselfregistration. verificationresult(redirect, success, message) creates an instanc...