Methods
Methods
GetByEntityId(string entityId)
Gets a SObject from the M4S cache for a given SObject ID in string format.
Parameters
entityId
Type: System.String
A string of the SObject ID to retrieve.
Return Value
FuseIT.Sitecore.SalesforceConnector.Entities.EntityBase
Sample
GenericMongoService mongoService = new GenericMongoService(mySalesforceSession, Account.SFType); EntityBase entity = mongoService.GetByEntityId("0015C000002rs7Y");
GetByEntityId(Id entityId)
Gets a SObject from the M4S cache for a given SObject ID.
Parameters
entityId
Type: FuseIT.Sitecore.SalesforceConnector.Id
A Id value of the SObject ID to retrieve.
Return Value
FuseIT.Sitecore.SalesforceConnector.Entities.EntityBase
Sample
GenericMongoService mongoService = new GenericMongoService(mySalesforceSession, Account.SFType); Account account = PreviouslyCreatedAccount(); EntityBase entity = mongoService.GetByEntityId(account.Id);
GetByEntityId(string entityId, string[] fields)
Gets a SObject from the M4S cache for a given SObject ID with specified fields populated.
Parameters
entityId
Type: FuseIT.Sitecore.SalesforceConnector.Id
A Id value of the SObject ID to retrieve.
fields
Type: System.String[]
An array of string values for each of the fields to be retrieved.
Return Value
FuseIT.Sitecore.SalesforceConnector.Entities.EntityBase
Sample
GenericMongoService mongoService = new GenericMongoService(mySalesforceSession, Account.SFType); string[] entityFields = new string {"Id", "Name"}; EntityBase entity = mongoService.GetByEntityId("0015C000002rs7Y", entityFields); string accountName = entity.InternalFields["Name"];
EntityBase GetByEntityId(Id entityId, SObjectField[] fields)
Gets a SObject from the M4S cache for a given SObject ID with specified fields populated.
Parameters
entityId
Type: FuseIT.Sitecore.SalesforceConnector.Id
A Id value of the SObject ID to retrieve.
fields
Type: FuseIT.G4S.SalesforceConnector.Entities.SObjectField[]
An array of SObjectField values for each of the fields to be retrieved.
Return Value
FuseIT.Sitecore.SalesforceConnector.Entities.EntityBase
Sample
GenericMongoService mongoService = new GenericMongoService(mySalesforceSession, Account.SFType); SObjectField[] entityFields = new SObjectField {"Id", "Name"}; EntityBase entity = mongoService.GetByEntityId("0015C000002rs7Y", entityFields); string accountName = entity.InternalFields["Name"];
GetAll()
Retrieves all of the SObjects for a type. All fields are populated.
Return Value
System.Collections.Generic.List<FuseIT.Sitecore.SalesforceConnector.Entities.EntityBase>
Sample
GenericMongoService mongoService = new GenericMongoService(mySalesforceSession, Account.SFType); List<EntityBase> entities = mongoService.GetAll();
GetAll(string[] fields)
Retrieves all of the SObjects for a type with the specified fields populated.
Parameters
fields
Type: FuseIT.G4S.SalesforceConnector.Entities.SObjectField[]
An array of SObjectField values for each of the fields to be retrieved.
Return Value
System.Collections.Generic.List<FuseIT.Sitecore.SalesforceConnector.Entities.EntityBase>
Sample
GenericMongoService mongoService = new GenericMongoService(mySalesforceSession, Account.SFType); SObjectField[] entityFields = new SObjectField {"Id", "Name"}; List<EntityBase> entities = mongoService.GetAll(entityFields);
ValidEntityId(string entityId)
Verifies that the SObject ID is valid for the particular SObject.
Parameters
entityId
Type: System.String
Value of the SObject ID.
Return Value
System.Boolean
ValidEntityId(Id entityId)
Verifies that the SObject ID is valid for the particular SObject.
Parameters
entityId
Type: FuseIT.Sitecore.SalesforceConnector.Id
Value of the SObject ID.
Return Value
System.Boolean
IsSupported()
Verifies that this object type exist for the sessions organization (via the partner API).
Return Value
System.Boolean