Skip to content

Commit

Permalink
Merge pull request #80 from microsoft/users/menakakollu/update-sync-s…
Browse files Browse the repository at this point in the history
…olution

Updated Sync solution and PowerShell scripts
  • Loading branch information
menakakmsft authored Sep 10, 2024
2 parents b248f7b + 0e27b72 commit 01f780d
Show file tree
Hide file tree
Showing 6 changed files with 158 additions and 5 deletions.
Binary file modified Scripts/SAPSetupAssistantValidationScripts.zip
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ $job = Start-Job -ScriptBlock {
Test-NetConnection -ComputerName $hostName -Port $port
} -ArgumentList $hostName, $port

if (Wait-Job -Job $job -Timeout 10) {
if (Wait-Job -Job $job -Timeout 15) {
$result = Receive-Job -Job $job

if ($result.TcpTestSucceeded) {
Expand All @@ -33,7 +33,7 @@ if (Wait-Job -Job $job -Timeout 10) {
}
}
else {
Write-Host -NoNewLine "[{'step': 'CheckNetworkConnection', 'status': 'Error', 'message': 'The connection to $hostName over port $port timed out after 5 seconds.'}]"
Write-Host -NoNewLine "[{'step': 'CheckNetworkConnection', 'status': 'Error', 'message': 'The connection to $hostName over port $port timed out after 15 seconds.'}]"
}

Remove-Job -Force -Job $job
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,29 @@
<EntityDataProviders />
<connectionreferences>
<connectionreference connectionreferencelogicalname="mpa_SAPBasisAdministrator">
<connectionreferencedisplayname>Template Installer SAP ERP</connectionreferencedisplayname>
<connectionreferencedisplayname>SAP Setup Assistant - SAP ERP</connectionreferencedisplayname>
<connectorid>/providers/Microsoft.PowerApps/apis/shared_saperp</connectorid>
<iscustomizable>1</iscustomizable>
<promptingbehavior>0</promptingbehavior>
<statecode>0</statecode>
<statuscode>1</statuscode>
</connectionreference>
<connectionreference connectionreferencelogicalname="mpa_shareddataflows_39423">
<connectionreferencedisplayname>Power Query Dataflows mpa_SAPTemplateInstallerDropDownValues-39423</connectionreferencedisplayname>
<connectionreferencedisplayname>SAP Setup Assistant - Power Query Dataflows </connectionreferencedisplayname>
<connectorid>/providers/Microsoft.PowerApps/apis/shared_dataflows</connectorid>
<iscustomizable>1</iscustomizable>
<promptingbehavior>0</promptingbehavior>
<statecode>0</statecode>
<statuscode>1</statuscode>
</connectionreference>
<connectionreference connectionreferencelogicalname="mpa_sharedoffice365_fbe3e">
<connectionreferencedisplayname>SAP Setup Assistant - Office 365 Outlook</connectionreferencedisplayname>
<connectorid>/providers/Microsoft.PowerApps/apis/shared_office365</connectorid>
<iscustomizable>1</iscustomizable>
<promptingbehavior>0</promptingbehavior>
<statecode>0</statecode>
<statuscode>1</statuscode>
</connectionreference>
</connectionreferences>
<msdyn_dataflows>
<msdyn_dataflow msdyn_dataflowid="969efae6-4c42-ef11-8409-7c1e520b5c89">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<ImportExportXml version="9.2.24072.208" SolutionPackageVersion="9.2" languagecode="1033" generatedBy="CrmLive" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<ImportExportXml version="9.2.24074.218" SolutionPackageVersion="9.2" languagecode="1033" generatedBy="CrmLive" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SolutionManifest>
<UniqueName>mpa_SAPSetupAssistantDropDownValues</UniqueName>
<LocalizedNames>
Expand Down Expand Up @@ -108,6 +108,10 @@
<Required type="connectionreference" displayName="mpa_sharedcommondataserviceforapps_fadb4" solution="Active" id.connectionreferencelogicalname="mpa_sharedcommondataserviceforapps_fadb4" />
<Dependent type="29" displayName="InstallTemplateSAPDropDownSync" id="{801d4fb4-90b0-ee11-a569-00224825b0d2}" />
</MissingDependency>
<MissingDependency>
<Required type="connectionreference" displayName="mpa_sharedoffice365users_f61b7" solution="Active" id.connectionreferencelogicalname="mpa_sharedoffice365users_f61b7" />
<Dependent type="29" displayName="InstallTemplateSAPDropDownSyncBatchRun" id="{0be5c436-aac6-ee11-9079-000d3a33d5a1}" />
</MissingDependency>
<MissingDependency>
<Required type="EnvironmentVariableDefinition" displayName="mpa_SAPApplicationServer" solution="Active" id.schemaname="mpa_SAPApplicationServer" />
<Dependent type="29" displayName="InstallTemplateSAPDropDownSync" id="{801d4fb4-90b0-ee11-a569-00224825b0d2}" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,24 @@
"api": {
"name": "shared_dataflows"
}
},
"shared_office365users_1": {
"runtimeSource": "embedded",
"connection": {
"connectionReferenceLogicalName": "mpa_sharedoffice365users_f61b7"
},
"api": {
"name": "shared_office365users"
}
},
"shared_office365": {
"runtimeSource": "embedded",
"connection": {
"connectionReferenceLogicalName": "mpa_sharedoffice365_fbe3e"
},
"api": {
"name": "shared_office365"
}
}
},
"definition": {
Expand Down Expand Up @@ -316,6 +334,129 @@
"name": "Status Message",
"value": "The batch process has completed."
}
},
"Get_Created_By_User": {
"runAfter": {
"Set_variable": [
"Succeeded"
]
},
"metadata": {
"operationMetadataId": "3605041d-c700-4967-970c-088dc9750143"
},
"type": "OpenApiConnection",
"inputs": {
"host": {
"connectionName": "shared_commondataserviceforapps_1",
"operationId": "GetItem",
"apiId": "/providers/Microsoft.PowerApps/apis/shared_commondataserviceforapps"
},
"parameters": {
"entityName": "systemusers",
"recordId": "@triggerOutputs()?['body/_createdby_value']"
},
"authentication": "@parameters('$authentication')"
}
},
"Get_user_profile_(V2)": {
"runAfter": {
"Get_Created_By_User": [
"Succeeded"
]
},
"metadata": {
"operationMetadataId": "f7ff8395-33b7-470f-9d5a-7d4d63337b52"
},
"type": "OpenApiConnection",
"inputs": {
"host": {
"connectionName": "shared_office365users_1",
"operationId": "UserProfile_V2",
"apiId": "/providers/Microsoft.PowerApps/apis/shared_office365users"
},
"parameters": {
"id": "@outputs('Get_Created_By_User')?['body/domainname']"
},
"authentication": "@parameters('$authentication')"
}
},
"Get_Refreshed_Batch_Items": {
"runAfter": {
"Get_user_profile_(V2)": [
"Succeeded"
]
},
"metadata": {
"operationMetadataId": "c5bcae0d-09d2-4aa7-a9f6-0edac398de65"
},
"type": "OpenApiConnection",
"inputs": {
"host": {
"connectionName": "shared_commondataserviceforapps_1",
"operationId": "ListRecords",
"apiId": "/providers/Microsoft.PowerApps/apis/shared_commondataserviceforapps"
},
"parameters": {
"entityName": "mpa_installtemplatebatchprocessitems",
"$filter": "_mpa_batchprocess_value eq '@{triggerOutputs()?['body/mpa_installtemplatebatchprocessid']}'",
"$orderby": "mpa_name asc"
},
"authentication": "@parameters('$authentication')"
}
},
"Create_HTML_table": {
"runAfter": {
"Get_Refreshed_Batch_Items": [
"Succeeded"
]
},
"metadata": {
"operationMetadataId": "6f5c0218-ae0b-413e-9b4f-7bb788255c2d"
},
"type": "Table",
"inputs": {
"from": "@outputs('Get_Refreshed_Batch_Items')?['body/value']",
"format": "HTML",
"columns": [
{
"header": "Domain",
"value": "@item()?['mpa_name']"
},
{
"header": "Status",
"value": "@If(equals(item()?['mpa_processingstatus'], 865420000), 'Not Started', If(equals(item()?['mpa_processingstatus'], 865420001), 'In Progress', If(equals(item()?['mpa_processingstatus'], 865420002), 'Completed', 'Error')))"
},
{
"header": "Message",
"value": "@item()?['mpa_message']"
}
]
}
},
"Send_an_email_(V2)": {
"runAfter": {
"Create_HTML_table": [
"Succeeded"
]
},
"metadata": {
"operationMetadataId": "0cf5f93b-c822-4d69-8a59-3aa55f726a50"
},
"type": "OpenApiConnection",
"inputs": {
"host": {
"connectionName": "shared_office365",
"operationId": "SendEmailV2",
"apiId": "/providers/Microsoft.PowerApps/apis/shared_office365"
},
"parameters": {
"emailMessage/To": "@outputs('Get_user_profile_(V2)')?['body/mail']",
"emailMessage/Subject": "SAP domain sync process completed",
"emailMessage/Body": "<p>The following SAP domains have completed syncing to Microsoft Dataverse as part of the SAP Procurement template installation.<br>\n<br>\n@{outputs('Compose_-_CSS_Table_Style')}@{body('Create_HTML_table')}<br>\n<br>\n</p>",
"emailMessage/Importance": "Normal"
},
"authentication": "@parameters('$authentication')"
}
}
},
"runAfter": {
Expand Down

0 comments on commit 01f780d

Please sign in to comment.