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.
|
Available in: Lightning Experience Available in: Enterprise and Unlimited Editions with Health Cloud or Health Cloud for Life Sciences |
| User Permissions Needed | |
|---|---|
| To define an Apex class: | Author Apex |
- In the Developer Console, select
-
Implement this Apex interface in the Apex class:
1public class UpdateInventory implements healthcloudext.IFetchInventoryCount{ 2//Sample Apex Class to fetch Inventory count from external Inventory Location (Input parameter : visitId) 3 public Map<Id,Integer> getInventoryCount(String visitId){ 4 Map<Id,Integer> sample = new Map<Id,Integer>(); 5 //Logic to fetch numbers from external data source 6 //Use Apex code to connect to external API and fetch result 7 //Return Type: Map of Product Item Id against its Count(Integer Value) 8 return sample; 9 } 10}
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.