Use External Data Sources for Expected Quantity in Cycle Counts

Expected quantities in cycle counts are automatically calculated from product item records in Intelligent Sales. However, if you need to use external data sources for these numbers, use our IFetchInventoryCount Apex Interface with your own custom Apex classes and methods.

Required Editions

Available in: Lightning Experience

Available in: Enterprise and Unlimited Editions with Health Cloud or Life Sciences Cloud

User Permissions Needed
To define an Apex class: Author Apex
  1. In the Developer Console, select File | New | Apex Class.
  2. Implement this Apex interface in the Apex class:
    public class UpdateInventory implements healthcloudext.IFetchInventoryCount{
    //Sample Apex Class to fetch Inventory count from external Inventory Location (Input parameter : visitId)
        public Map<Id,Integer> getInventoryCount(String visitId){
    		 Map<Id,Integer> sample = new Map<Id,Integer>();        
        	    //Logic to fetch numbers from external data source
     	        //Use Apex code to connect to external API and fetch result  
            	//Return Type: Map of Product Item Id against its Count(Integer Value)
            return sample;
        }
    }

If any record against ProductItemId is missing a value, and that product item already has a value for expected quantity in the Intelligent Sales system, then the value in the Intelligent Sales system is used instead.