ccrz.ccLogicCouponUpdateUse.fetchCoupon

Calls the ccrz.ccApiCoupon.fetch method for returning the coupons to update.

Compatibility

This reference applies to:

Release Managed Package Version API Version
B2B Commerce for Visualforce Winter ’21 4.13 12

Signature

global virtual Map<String, Object> fetchCoupon(Map<String, Object>)

Inputs (Required)

This method accepts the Map<String, Object> after the ccrz.ccLogicCouponUpdateUse.processInput method completes.

This method also requires one of the following keys in the working map:

ccrz.ccApiCoupon.CODE
String that specifies the value of the ccrz__CouponCode__c field of the coupon to update.
ccrz.ccApiCoupon.CODES
List<String> that specifies ccrz__CouponCode__c field values of the coupons to update.
ccrz.ccApiCoupon.ID
String that specifies the Salesforce ID of the coupon to update.
ccrz.ccApiCoupon.IDS
List<String> that specifies the Salesforce IDs of coupons to update.

Inputs (Optional)

If the working map includes the following key, this method evaluates it:

ccrz.ccApiCoupon.LOCK_COUPON
Boolean
Value Usage
true (default) Query the specified coupons using the SOQL FOR UPDATE keyword, which locks the coupons from other changes until the update completes.
false Don't lock coupons during this method's execution.

Logic Performed

This method completes the following actions:

  1. Passes ccrz.ccApiCoupon.ID, ccrz.ccApiCoupon.IDS, ccrz.ccApiCoupon.CODE, or ccrz.ccApiCoupon.CODES as input for the ccrz.ccApiCoupon.fetch method. This method also passes ccrz.ccApiCoupon.LOCK_COUPON as the ccrz.ccService.FORUPDATE input for ccrz.ccApiCoupon.fetch.
  2. Stores the ccrz.ccApiCoupon.fetch output data in the ccrz.ccLogicCouponUpdateUse.COUPON_RETURN_DATA intermediate key.

Outputs

This method returns the working Map<String, Object>, and sets the following keys:

ccrz.ccLogicCouponUpdateUse.COUPON_RETURN_DATA
Map<String, Object> that the ccrz.ccApiCoupon.fetch method returned.