This API creates a favorite configuration from the Catalog page referenced by cartID.

saveFavoriteConfigurationstatic Apttus_Config2.FavoriteConfigurationStruct.SaveFavoriteResponseDO saveFavoriteConfiguration(Apttus_Config2.FavoriteConfigurationStruct.SaveFavoriteRequestDO requestDO)

requestApttus_Config2.FavoriteConfigurationStruct.SaveFavoriteRequestDOThe request data object.

Request Data Object - Apttus_Config2.FavoriteConfigurationStruct.SaveFavoriteRequestDO
cartIDIDThe identifier of the cart.
favoriteConfigurationSOApttus_Config2__FavoriteConfiguration__cReference to the Favorite Configuration Object
lineNumbersList <Integer>The list of line numbers to be added to the favorite configuration.

Response Data Object - Apttus_Config2.FavoriteConfigurationStruct.SaveFavoriteResponseDO
favoriteConfigurationSOApttus_Config2__FavoriteConfiguration__cReference to the Favorite Configuration Object
processedLineNumbersList<Integer>List of line numbers added as a favorite configuration.

Data Object - Apttus_Config2__FavoriteConfiguration_c
NameStringEnter a suitable name for your favorite configuration. This name is displayed as a record under your Favorites category.
PriceListIdStringThe pricelist id associated with a favorite configuration.
ScopeStringChoose an option for the visibility of your configuration record. The available values are, Public and Private. If you set this to Private, this record is visible to only the owner of the record. If you set this to Public, this record is accessible to all the users.

Code Sample

The sample below enables you to create a favorite configuration for a cart with a cartId. You can invoke this API in use cases when you want to show a Favorite configuration page based on the cartID and pricelist.

requestDO = new Apttus_Config2.FavoriteConfigurationStruct.SaveFavoriteRequestDO();
System.debug('requestDO\'s favorite configuration : ' + requestDO.favoriteConfigurationSO);
requestDO.favoriteConfigurationSO.Name = 'HG Fav BundleandStd';
requestDO.favoriteConfigurationSO.Apttus_Config2__Scope__c = 'Public';
requestDO.favoriteConfigurationSO.Apttus_Config2__PriceListId__c = 'aElF0000000Gmhp';
requestDO.cartId = ID.valueOf('a1I4C0000009hYV');
requestDO.lineNumbers = new List<Integer>();
Integer maxLineNumber = 5;
for (Integer i=1; i<=maxLineNumber; i++)
System.debug('response = ' + Apttus_Config2.FavoriteConfigurationGlobalService.saveFavoriteConfiguration(requestDO));