Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Info

Steps to install APSD in D365 PowerApps platform

...

Expand
titleImporting SCRAM task data
Info

Alternative solution: Follow https://docs.microsoft.com/en-us/powerapps/developer/data-platform/dataverse-odata-dataflows-migration to create a dataflow to migrate the data between environments. This currently exists for QA → ACC.

  1. Go to the environment that has the master set of data for the SCRAM tasks. Currently, this is QA.

  2. On the left menu, go to DataTables, then open the Scram Tasks table.

  3. On the top menu, click on DataExport data. Once the export has been successfully completed, click on Download exported data.

  4. Unzip the csv file.

  5. Switch to the environment you are deploying to.

  6. On the left menu, go to DataTables, then open the Scram Tasks table.

  7. On the top menu, click on Data> beside Get dataGet data from Excel.

  8. Upload the csv file from step 4. If there are any mapping issues, fix them.

  9. Click Import. Wait for the process to complete, then verify that the data was imported.

Expand
titleImporting AP task data 

Follow the same steps for Importing SCRAM task data using the AP Task table instead.

Flows

The service principal account should be used for all connections to the DataVerse.

Expand
titleTimesheet Approval Rejected Email Notifications

Name: Timesheet rejected - Send email notification

Description: This Power Automate Flow - TimeSheetNotificationstriggers when the “ap_timesheetstatus” field is modified to “Rejected”. The flow sends an email to the submitter.

Name: Expense rejected - Send email notification

Description: This Power Automate Flow triggers when the “ap_timsheetstatus” expensestatus” field is modified to “Rejected”. The flow sends an email to the submitter.

Image Removed

Name: Invoice rejected - Send email notification

Description: This Power Automate Flow triggers when the “ap_invoicestatus” field is modified to “Rejected”. The flow sends an email to the submitter.

Expand
titleTimesheet Approval – Add to CRSM 

Name: Flow - Push Approved Time Entries To CRSM

Description: This Power Automate Flow triggers when the “ap_timsheetstatus” field is modified to “Approved”. The flow uses the “TMAPI” custom connector, specifically the following end points: 

  1. Add a time entry

    1. To add a time entry, the flow gets all the rows where the current timesheet is approved from the “Time Entries” table filtered via a FetchXML query to only get the rows where “Added to CRSM” is false and hours are not empty or null. Here’s the query:

      Code Block
      languagexml
      <fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false">
        <entity name="ap_timeentry">
          <attribute name="ap_timeentryid" />
          <attribute name="ap_timeid" />
          <attribute name="createdon" />
          <order attribute="ap_timeid" descending="false" />
          <filter type="and">
            <condition attribute="ap_addedtocrsm" operator="eq" value="0" />
            <condition attribute="ap_timesheet" operator="eq" uitype="ap_timesheet" value="{@{triggerOutputs()?['body/ap_timesheetid']}}" />
            <condition attribute="ap_employeelogin" operator="eq" value="@{triggerOutputs()?['body/ap_employeelogin']}" />
            <condition attribute="ap_timecard" operator="eq" value="@{triggerOutputs()?['body/ap_reportingperiod']}" />
            <condition attribute="ap_timeentryhours" operator="not-null" />
          </filter>
        </entity>
      </fetch>

    2. Create a time entry record in the CRSM database.

  2. Add hours to time entry

    1. This endpoint is used to create a record for adding hours for the time entry that was created in the previous step. Depending upon the “ap_timeentrytype” i.e. “Regular”, “Travel” or “Other”, corresponding action is called. 

  3. At the end of the flow, the flag “Added to CRSM” is set to true in the Time Entries table. 

Push Time Entry to CRSM Step inside flow

TypeCode: Regular (REG), Travel (TH), Other (DH)

Code Block
[
  {
    "ServiceRequestId": @{int(variables('ServiceRequestID'))},
    "ServiceId": @{outputs('Get_a_row_by_ID')?['body/ap_serviceid']},
    "ApproverNetworkId": @{triggerOutputs()?['body/ap_approvedby']},
    "Comment": @{items('Apply_to_each_-_Push_to_CRSM')?['ap_comments']},
    "SubmitterNetworkId": @{items('Apply_to_each_-_Push_to_CRSM')?['ap_employeelogin']},
    "DateTime": @{items('Apply_to_each_-_Push_to_CRSM')?['ap_timeentrydate']},
    "Hours": [
      {
        "Quantity": @{items('Apply_to_each_-_Push_to_CRSM')?['ap_timeentryhours']},
        "TypeCode": "REG",
        "IsBillable": @{items('Apply_to_each_-_Push_to_CRSM')?['ap_billable']},
        "StatusCode": 2
      }
    ]
  }
]

...