You are viewing an old version of this page. View the current version.
Compare with Current
View Page History
« Previous
Version 34
Next »
How to switch to classic D365
Click Solutions
→ APSD
→ ...
→ Switch to classic
Granting access to the environment to other developers
How to create new security roles
Security roles are now included as part of the solution and will be migrated between environments as part of it.
Click on the settings icon in the top right corner, then navigate to Advanced settings
→ Security
→ Security Roles
Select Service Writer and perform a copy role
Create the following new roles, case sensitive.
AP Engineer
AP Clerk
AP Manager
AP Invoice Manager
Setting Up a New Environment
When setting up a brand new environment, there are a few additional steps that must be done other than simply importing the solution. The custom connectors must be created (as there is currently a bug that doesn’t allow them to be migrated with the solution) and all lookup data must be imported.
* Custom connectors must be created before importing the solution.
Creating custom connectors in new environment
On the left hand menu, navigate to Data
→ Custom Connectors
Click on + New
→ Other
→ Custom connector
.
In the Connector Name field, type “APSR”.
Toggle the Swagger Editor
to ON, delete all the code and copy/paste the code from the APSR.json file.
Toggle the Swagger Editor
to OFF.
Ensure you are in the General tab and then verify that the Host and Base URL point to the correct location for the environment you are in (refer to chart below).
Click Create connector
.
Click on the Test tab, then + New connection
.
Enter the API Key (RDIMS 17999814) and click Create connection
.
Repeat steps 3-9 to create the SIAPI connector using the SIAPI.json file.
**This API doesn’t require an API Key.
Repeat steps 3-10 to create the SPAPI connector using the SPAPI.json file.
Repeat steps 3-10 to create the MTAPI connector using the MTAPI.json file.
Repeat steps 3-10 to create the TMAPI connector using the TMAPI.json file.
For all 5 connectors, share them with the organization.
On the left hand menu, navigate to Data
-> Connections
.
For each connection, share them with the organization.
Click ...
→ Share
→ + Add everyone in my org
→ Save
.
This must be done so that any changes to the API Key get shared to all users. The update should be instant, if users are not receiving the updated key, they will need to clear their browser’s cache.
Microsoft Bug: Cannot share custom connectors contained within a solution (Workaround - FAILED)
There is a bug with D365 that doesn’t allow sharing of custom connectors if they are included in a solution. Workaround: https://youtu.be/ROKO589RBnQ
Go to Data
→ Tables
→ Connector
table → Data
tab.
Select the connector and click on Edit Record
.
Click SHARE
→ Add User/Team
→ Select Team in the Look for
dropdown.
Check off the team that is named after the environment.
Click Select
→ Add
.
Ensure that they only have Read access (for other users, refer to chart below).
Click Share
.
Migrating the Application Between Environments
Export the solution
Data will not be migrated between environments through the solution. You will need to perform data migration separately following the steps below.
Open the Power Apps Studio and select the environment you are migrating from.
Click on Solutions
on the left-hand menu and then click on the APSD
solution.
Click Publish all customizations
in the top menu bar.
Switch to the Overview tab on the side and click Export
→ Next
.
Increase version number as applicable, and select Unmanaged, then click on Export
.
Import the solution
Click on Solutions
on the left-hand menu and then Import
in the top menu bar.
Select Browse
and point to the zip file, APSD_1_0_0_X.zip
, created in the export solution steps. "X" will be the current iteration number at the time of deployment.
Click Next
twice and create a new connection for both Outlook and Dataverse.
For both connectors, select a predefined system account that is a System Administrator. This information needs to be handed over by the Exchange group, in the DEV environment we are using our own accounts.
Click Import
and wait for the process to finish.
Click on Publish all customizations
.
Update connectors and dropdowns in the Canvas app
Go to edit the Service Request Canvas app.
When prompted, select Don't Allow
.
Remove all connections that are showing as not connected - 5 connections (APSR, MTAPI, SIAPI, SPAPI, TMAPI), Office365Users and APSD_Translations.
Add all of them back.
For APSD_Translation, connect to SharePoint data connector. In the box enter the following URL: https://034gc.sharepoint.com/sites/DSD-CivilAviation/Lists/APSD_Translations/AllItems.aspx
Check off the APSD_Translations
list & click Connect
.
Run the App Checker and ensure no errors are reported.
Turn on “Allow searching” in the properties for the following elements:
New Service Request Step One Screen
- cboNapaProject
element
New Service Request Step Three Contact Info Screen
- cboFindOrganizationAlt
element
Service Request Review Screen
- ddSRRChangeReAssignment
element
New Invoice Step One Screen
- cboInvoiceCustomer
and cboCustomerAddress
elements
Weekly Time Entry Normalized Screen
- cmbProject
9. Save and Publish the app.
Importing/Migrating Data
When setting up a new environment, all lookup data must be brought into the environment. This can be done either through creating a dataflow to migrate data between environments or by importing the data from an Excel spreadsheet.
Importing SCRAM task data
Go to the environment that has the master set of data for the SCRAM tasks. Currently, this is QA.
On the left menu, go to Data
→ Tables
, then open the Scram Tasks table.
On the top menu, click on Data
→ Export data
. Once the export has been successfully completed, click on Download exported data
.
Unzip the csv file.
Switch to the environment you are deploying to.
On the left menu, go to Data
→ Tables
, then open the Scram Tasks table.
On the top menu, click on Data
→ >
beside Get data → Get data from Excel
.
Upload the csv file from step 4. If there are any mapping issues, fix them.
Click Import
. Wait for the process to complete, then verify that the data was imported.
Importing 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.
Rejected Email Notifications
Name: Timesheet rejected - Send email notification
Description: This Power Automate Flow triggers 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_expensestatus” field is modified to “Rejected”. The flow sends an email to the submitter.
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.
Timesheet 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:
Add a time entry
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:
<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>
Create a time entry record in the CRSM database.
Add hours to time entry
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.
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)
[
{
"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
}
]
}
]
Importing Users and Setting Roles
Name: Flow – Import Users and Roles
Description: This Power Automate Flow can be manually triggered to import users from an Excel file (see screenshot below) into the Dynamics 365 “Users” table in the target environment. The Flow also associates users with their managers as listed in the Excel file and assigns them the roles as per the Excel file. This Excel file can be stored on the executing user’s OneDrive.
0 Comments