cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Titiwai
Helper II
Helper II

cannot update record in d365 finance

Received a message "an error has occurred. update not allowed for field 'FixedAssetGroupId'" when trying to update a record in d365. But the problem is this field is also mandatory so I can't leave it blank. How can I to get around this problem?Annotation 2020-02-20 095704.jpg

 

 

1 REPLY 1
RolfEleveld
New Member

Dear Titiwai.

I have the same issue with Dynamics FnO flow components where update requires fields based on mandatory fields in the API, the update component makes them mandatory in the OpenApiConnection for the Flow.

I have been able to circumvent this issue by exporting the flow into a package (zip).
1. Unzip the file
2. Find the file definition.json in there

3. Reformat the JSON file, so it is somewhat legible

4. Find the flow segment you were editing, where spaces are replaced by _, so in your example: Update_a_record

5. Rewrite the method from OpenApiConnection to ApiConnection, Please find here an example from my context where I am stuck now:

"Expire_Employee": {
"runAfter": {},
"type": "OpenApiConnection",
"inputs": {
"host": {
"connectionName": "shared_dynamicsax",
"operationId": "PatchItem",
"apiId": "/providers/Microsoft.PowerApps/apis/shared_dynamicsax"
},
"parameters": {
"dataset": "aap.sandbox.operations.dynamics.com",
"table": "EmploymentDetails",
"id": "@{items('Employmentdetails')?['PersonnelNumber']},@{items('Employmentdetails')?['LegalEntityId']},@{items('Employmentdetails')?['EmploymentStartDate']},@{items('Employmentdetails')?['EmploymentEndDate']},@{items('Employmentdetails')?['ValidFrom']},@{items('Employmentdetails')?['ValidTo']}",
"item/PersonnelNumber": "@items('Employmentdetails')?['PersonnelNumber']",
"item/LegalEntityId": "@items('Employmentdetails')?['LegalEntityId']",
"item/EmploymentType": "@items('Employmentdetails')?['EmploymentType']",
"item/EmploymentEndDate": "@triggerOutputs()?['body/OData__EndDate']"
},
"authentication": "@parameters('$authentication')"
}
}
To something like:
"Expire_Employee": {
"runAfter": {},
"metadata": {
"flowSystemMetadata": {
"swaggerOperationId": "PatchItem"
}
},
"type": "ApiConnection",
"inputs": {
"host": {
"connection": {
"name": "@parameters('$connections')['shared_dynamicsax']['connectionId']"
},
"api": {
"runtimeUrl": "https://flow-apim-europe-westeurope.azure-apim.net/apim/dynamicsax"
}
},
"method": "patch",
"body": {
"TransitionDate": "@triggerOutputs()?['body/OData__EndDate']"
},
"path": "/datasets/@{encodeURIComponent(encodeURIComponent('aap.sandbox.operations.dynamics.com'))}/tables/@{encodeURIComponent(encodeURIComponent('EmploymentDetails'))}/items/@{encodeURIComponent(encodeURIComponent(items('Employmentdetails')?['PersonnelNumber'],',',items('Employmentdetails')?['LegalEntityId'],',',items('Employmentdetails')?['EmploymentStartDate'],',',items('Employmentdetails')?['EmploymentEndDate'],',',items('Employmentdetails')?['ValidFrom'],',',items('Employmentdetails')?['ValidTo']))}",
"authentication": "@parameters('$authentication')"
}
}
Please note that I have omitted the fields that I do not wish to update in the above.

6. Save the file
7. recreate the zip again, make sure the files are directly in the zip (same as what you downloaded), not in a subfolder
8. import the zip as a solution and update the flow you had.

I hope this helps you. I cannot use this anymore as I have added my flows to a solution so I can share clusters of items together but I can no longer upload my flows... and downloading is now missing the connections.

Helpful resources

Announcements
MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Users online (1,201)