Because Dynamics CRM only has one of these three fields (Quantity On Hand), the default Dynamics GP Sales Item to Dynamics CRM Product map only maps Quantity On Hand. Salespeople working in Dynamics CRM might rather see the Dynamics GP Quantity Available, which is calculated as Quantity Available = Quantity On Hand – Allocated Quantity. In order to include this calculation in the Sales Item to Product Map, we will do the following (each step will be described in detail below):
2. Select the Sales Item to Product map for the integration you want to customize.
3. Click the edit button for the Quantity On Hand field
4. Click the edit button for the condition field
5. Click the delete button for the value1 field
6. Click the edit button for the value1 field
7. Click Use a Function
8. Select Math from the Function category drop down
9. Select Subtract from the function list
10. Click next
11. Click the edit button for the value1 field
12. Click Use a function
13. Select General from the Function category drop down
14. Select SumCollection from the function list
15. in the collection field enter source field: Quantities
16. in the propertyPath field enter string constant: "item/OnHandQuantity/Value"
17. Click Add
18. Click the edit button for the value2 field
19. Click Use a function
20. Select General from the Function category drop down
21. Select SumCollection from the function list
22. in the collection field enter source field: Quantities
23. in the propertyPath field enter string constant: "item/AllocatedQuantity/Value"
24. Click Add
25. Click Add
26. Click Add
27. Click the delete button for the falseValue field
28. Click the edit button for the falseValue field
29. Click Use a Function
30. Select Math from the Function category drop down
31. Select Subtract from the function list
32. Click next
33. Click the edit button for the value1 field
34. Click Use a function
35. Select General from the Function category drop down
36. Select SumCollection from the function list
37. in the collection field enter source field: Quantities
38. in the propertyPath field enter string constant: "item/OnHandQuantity/Value"
39. Click Add
40. Click the edit button for the value2 field
41. Click Use a function
42. Select General from the Function category drop down
43. Select SumCollection from the function list
44. in the collection field enter source field: Quantities
45. in the propertyPath field enter string constant: "item/AllocatedQuantity/Value"
46. Click Add
47. Click Add
48. Click Add
After making these changes to the mapping and reloading all Sales items the Quantity On Hand field in Dynamics CRM will match the Quantity Available from Dynamics GP. Another option is to customize the Dynamics CRM Product entity to display the Quantity Available, Allocated Quantity, and Quantity On Hand in different fields. Please see the Dynamics CRM SDK and Connector SDK for more information on how to add custom fields for integration.