Skip to main content

How Global Methods used in SF

This article explains how Global Methods used in SF

Global Apex endpoint to create an Entity in Salesforce

Given an account id. The account id is the “Id” field of the account standard object record. This allows clients to programmatically sync data from a Salesforce account to the Fenergo manage package custom objects following the mapping configuration “salesforceToFenxMapping”. Also it creates an entity record in Salesforce. The method returns the entity “Id” field of the created entity record.

As a reminder. The fenx__entity__c managed custom object makes a relation between a Salesforce account (fenx__Linked_Salesforce_Record_Id__c) and a Fenergo entity (fenx__Fenx_External_Id__c).
fenx__entity__c example record:

Technical Details:

  • Exposed method and parameters that need to pass:

Id fenx.FenxGlobal.mapInitiateCustomerDataModelToFenxDataModel(

    Id accountId

  )
​
​Example: 

fenx.FenxGlobal.mapInitiateCustomerDataModelToFenxDataModel ('001J7000008xWCqIAM');

Global Apex endpoint to create an Entity in Fenergo

This allows clients to programmatically create an entity in Fenergo given an entity id. The entity id is the “Id” field of the entity custom object record.

Technical Details:

  • Exposed method and parameters that need to pass:

void fenx.FenxGlobal.createEntityInFenXFromFenxDataModel(

    Id salesforceEntityId

  )
​
​Example: 

fenx.FenxGlobal.createEntityInFenXFromFenxDataModel('a03J7000002AMBGIA4');

Global Apex endpoint to sync Fenergo data model to Client data model

The method accepts a list of entity ids (The entity id is the “Id” field of the entity custom object record). This allows clients to programmatically sync data per each entity id from the Fenergo manage package custom objects to Client objects following the mapping configuration “fenxToSalesforceMapping”.

Technical Details:

  • Exposed method and parameters that need to pass:

void fenx.FenxGlobal.mapFenxSalesforceDataModelToClientDataModal(

    Set<Id> salesforceEntityIds

  )
​
​Example: 

fenx.FenxGlobal.mapFenxSalesforceDataModelToClientDataModal(new Set<Id>{ 'a03J7000002AMBGIA4'});

Did this answer your question?