An entity is a set of records which are used to store data similarly how the table stores data within a database. CDS for apps includes a base set of standard entities that cover typical scenarios but we can create custom entities specific to your organization.
Following steps are required for creation of data entity.
Step 1) Login to PowerApps.
Step 2) Select the environment which was created in previous part. For this click on environments button available in top right corner and select your environment. It will contain list of all environments.
Step 3) Go to data tab in left corner and click on entities button.
Step 4) Click on New entity button and add relevant information. Your entity will be created.
Step 5) Rename primary field name. By clicking on it. In my case I have given it CustomerId as display name.
Step 6) Add more field in entity. In my case I have add following fields.
- Customer name : Data type - Text
- Customer type : Data type - Option set (International , Local)
- IsValid : Data type - Two options
- InternationalCode : Data type - Text
Step 7) Go to relationship tab and add a new relation by clicking on Add relationship button. Then select one to many relation option.
Step 8) Now select Primary entity. In my case I have select Contact as primary entity.
Step 9) Click on business rule tab and add a business rule by clicking on Add business rule button. A new screen will appear for adding business rule.
Note : I am going to add a condition in which if my customer type is international then in this case we need to show international Code field only otherwise it will be invisible.
First set properties of condition. In my case i have selected customer type field and added condition in it whenever customer type is International perform some action.
Step 10 ) Add an action to condition by selecting Set Visibility action from drop of Add button. Select relevant field from drop down.
Step 11) Click on validate button in order to check its validation and then click on active button to activate your business rule on entity.
Step 12) Your business rule will be added in entity.
Entity creation process has been completed. In coming blogs we will be discussing about how to import data and use that data for creating apps through CDS.
No comments:
Post a Comment
Note: only a member of this blog may post a comment.