ffrr.SettingsServiceglobal with sharing class SettingsService The ffrr.SettingsService provides classes and methods for operations related to the ffrr__Settings__c records. Methods
createMappingsToPOLIglobal static ffrr.SettingsService.UpsertResult createMappingsToPOLI(List<Id> settingIds) Creates a Field Mapping Definition for each of the given Settings using the fields defined in those Settings. The Default Field Mapping will be populated on each of the Settings. Input Parameters
Return ValueA SettingsService.UpsertResult containing the Ids of the created Field Mapping Definitions and the Ids of the settings used to create them. Sample Code//Note: This sample code is for demonstration purposes only. It is not intended for //use in a production environment, is not guaranteed against defects or errors, and //is in no way optimized or streamlined. // In this example the Settings Service is used to create Field Mapping Definitions // from the provided Setting to the Performance Obligation Line Item SObject. // Retrieve the Setting that will be used to create the Field Mapping Definition Id settingId = [SELECT Id FROM ffrr__Settings__c WHERE ffrr__Object__c = 'Account' AND ffrr__UseInRevenueContract__c = true LIMIT 1].Id; // Call the Service providing the Settings Id. // Based on the fields in the settings record the relevant Field Mappings will // be created under this Field Mapping Definition. ffrr.SettingsService.UpsertResult result = ffrr.SettingsService.createMappingsToPOLI(new List<Id>{settingId}); createMappingsToPOLIglobal static ffrr.SettingsService.UpsertResult createMappingsToPOLI(List<Id> settingIds, ffrr.SettingsService.UpsertOptions options) Creates a Field Mapping Definition for each of the given Settings using the fields defined in those Settings. The Default Field Mapping will be populated on each of the Settings. If a given Setting already has a Default Field Mapping it can be specified to update it. Input Parameters
Return ValueA SettingsService.UpsertResult containing the Ids of the created Field Mapping Definitions and the Ids of the settings used to create them. Sample Code//Note: This sample code is for demonstration purposes only. It is not intended for //use in a production environment, is not guaranteed against defects or errors, and //is in no way optimized or streamlined. // In this example the Settings Service is used to create Field Mapping Definitions // from the provided Setting to the Performance Obligation Line Item SObject. // Retrieve the Setting that will be used to create the Field Mapping Definition Id settingId = [SELECT Id FROM ffrr__Settings__c WHERE ffrr__Object__c = 'Account' AND ffrr__UseInRevenueContract__c = true AND ffrr__DefaultFieldMappingDefinition__c != null LIMIT 1].Id; // Specify to update the default Field Mapping Definition record related to this Setting. ffrr.SettingsService.UpsertOptions options = new ffrr.SettingsService.UpsertOptions(); options.UpdateMappings = true; // Call the Service providing the Settings Id and the options. // Based on the fields in the settings record the relevant Field Mappings under // this Field Mapping Definition will be updated (or created if they don't exist). ffrr.SettingsService.UpsertResult result = ffrr.SettingsService.createMappingsToPOLI(new List<Id>{settingId}, options); ffrr.SettingsService.UpsertOptionsglobal with sharing class UpsertOptions Contains additional options regarding the upserting of FieldMappingDefinitions. Sample Code//Note: This sample code is for demonstration purposes only. It is not intended for //use in a production environment, is not guaranteed against defects or errors, and //is in no way optimized or streamlined. // The UpsertOptions class is used to provide additional information // when creating Field Mapping Definitions. // Create the Options ffrr.SettingsService.UpsertOptions options = new ffrr.SettingsService.UpsertOptions(); // Set the updateMappings boolean field which controls whether existing // Field Mapping Definitions are updated(true) or replaced(false). // The default is false. options.updateMappings = true; Properties
MethodsUpsertOptionsglobal UpsertOptions() Default constructor. Defaults the UpdateMappings Boolean to FALSE. ffrr.SettingsService.UpsertResultglobal with sharing class UpsertResult Container for data resulting from an Upsert operation. Properties
MethodsUpsertResultglobal UpsertResult() |