zoukankan      html  css  js  c++  java
  • Integrating Dynamics 365 CE with PowerApps

    Integrating Dynamics 365 CE with PowerApps

    Let's say we want to create a quick mobile app for the HIMBAP Auto Service Center to create an auto service request for a customer. Let's see how quickly we can build our app using PowerApps Studio, by following these steps:

    1. Click on the Dynamics 365 Home button (from where we selected Flow earlier) and select PowerApps.
    2. Click on Create and select Canvas app from blank, and let's name our app Auto Service Request.
    3. After clicking on OK, PowerApps Studio will open a new app that will have one screen by default.
    4. Click on the right-hand side of Screen1 and select the Rename option from the drop-down menu. Let's rename it Service Request.
    5. Let's add the following controls to our screen, and name them as follows:
    • Label: topiclbl
    • Text: topictxt
    • Label: customerlbl
    • Dropdown: customerdll
    • Label: vehiclelbl
    • Dropdown: vehicledll
    • Label: issueifanylbl
    • Text: issuetxt
    • Label: bookingdatelbl
    • Date Picker: bookingdate

    We can add these controls from the Insert menu by following the numbering sequence shown in the screenshot that follows:

    Let's place these controls on the screen as per the preceding screenshot. Now, let's add a Dynamics 365 CE data source to get data from Dynamics 365 CE entities, as follows:

    1. Click on the View menu and select Data Sources.
    2. Click on the + Add data source button and select our current Dynamics 365 CE connection. Once it is connected, we need to select the following three entities, like so:

    1. Now, let's bind our Customer dropdown to the Dynamics 365 CE customer entity, as follows:

    1. Next, we want to show the customer vehicle in the Vehicle dropdown, so we need to configure it by following the numbered steps shown in the following screenshot, after selecting the drop-down control from the screen. First, we need to select the Vehicles entity, and after that, we need to select the Vehicle Name field. Later, we can configure the Depends on options for this dropdown:

    1. Next, let's use the Reset method to clear all the fields with a click of the New button. We can select the New button and use the Reset method on the formula bar, using the following number sequence: 

    1. We need to write code for the Save button to store the current screen data to the Auto Service. We can select the Save button and write the following code for the OnSelect event of the button:
    Patch('Auto Services',Defaults('Auto Services'),{name:topictxt.Text},{currentsituation:issuetxt.Text},{him_servicebookingdate:bookingdate.SelectedDate},{_parentaccountid_value:customerddl.Selected.Account},{_him_vehicle_value:vehicledll.Selected.Vehicle});

    In the preceding code, we are using the Patch method, which is used to create or update a record. When we want to use Patch to create a record, we need to use it with Defaults, which takes the table name as a parameter. In the preceding code, we have passed in the Auto Service entity name. Further, we can pass all the field names that we want to set.

    1. Now, press F5 to run our application. As soon as we select a customer name, we will be able to see their vehicle under the Vehicle dropdown, as in the following screenshot:

    1. When we click the Save button, we will be able to see a record created in Dynamics 365 CE, like so:

    Finally, we can publish our app, and it can be used from a mobile device. To access our application, we first need to download PowerApps, and from there, we can access our PowerApps applications. This is a simple sample application, but we can create complex canvas apps in a similar way.

  • 相关阅读:
    Eclipse中的快捷键
    xml文件头文件生成策略以及导入约束条件
    HTTP协议状态代码和错误状态含义的解释
    水了一个前端面试 记下问的东西
    整理的一些PHP面试题目
    Magic Index 寻找数组中A[i]=i的位置(原题转自微信号待字闺中)
    【经典算法】寻找最长01字串(转自待字闺中)
    PHP中不用第三个变量交换两个变量的值
    已知一个数组a[N]来构造数组b[N]的有趣算法题
    MySQL安装后默认自带数据库的作用
  • 原文地址:https://www.cnblogs.com/lingdanglfw/p/15007695.html
Copyright © 2011-2022 走看看