In addition to SFDC and MDA objects, you can use Data Spaces as a data source in the rules engine. In this tutorial, we will create a data space on Opportunity Products and then use it in the rules engine to create relationships.
Note: You cannot create rules on Relationships using data spaces.
The high level steps in this tutorial are:
Create a Data Space
To create a data space:
1. Navigate to Administration > Operations > Data Spaces.
2. From the Select Object drop-down, select the Opportunity Product.
3. Add the following as Fields:
- Id, Date, AnnualFee, Line Description, List Price, NumberOfLicenses, Opportunity Product Name, Product Code, Product Family, Product Name, Product Description, Account Name, Industry, Annual Revenue, Account ID, Close Date, Won, Stage
Note: These selections were not possible before the introduction of Data Spaces
4. Enter a name and description for the data space in the Name and Description fields respectively; then click SAVE.
Use the Data Space in Rules Engine
In this procedure, the rules engine creates relationships on accounts where a product opportunity was recently closed won.
1. Navigate to Administration > Rules Engine and click + RULE.
2. Select a rule type.
3. Select Account in Rule For, as we are creating the rule for accounts.
4. Type a name for the rule in Rule Name box.
5. Type a description for the rule in Description box.
6. Click Next. The Setup Rule screen appears.
7. Select Data Spaces from the data source list.
8. Select Product Opportunity from the data source list.
9. Add the following as Show fields:
- Product Name, Product Family, Product Description, Product Code, Account ID, Product ID
10. Add the following as Filters:
- Won equals select the checkbox
- Stage equals Closed Won
- Close Date greater than Subtract 1 days from Rule Date
11. Click Next and select Action Type as Load to Relationship.
12. Select the appropriate Relationship Type.
13. Select field mappings for the show fields.
14. Click SAVE and then click RUN NOW. The rule runs and creates relationships for the source object Product Opportunities.