Getting an error when creating an application user:
Exception Message:
Unable to retrieve attribute=businessunitid for entityLogicalName=systemuser.
Entity has Attribute Count=29.
AttributeNames=
address1_shippingmethodcode, caltype, domainname, address1_addresstypecode, isactivedirectoryuser, preferredphonecode, displayinserviceviews, processid, incomingemaildeliverymethod, address2_addresstypecode, setupuser, preferredaddresscode, internalemailaddress, firstname, outgoingemaildeliverymethod, applicationid, defaultfilterspopulated, address2_shippingmethodcode, emailrouteraccessapproval, lastname, isdisabled, isintegrationuser, preferredemailcode, invitestatuscode, islicensed, systemuserid, isemailaddressapprovedbyo365admin, issyncwithdirectory, accessmode
ErrorCode: -2147220176
HexErrorCode: 0x80040530
ErrorDetails:
0: businessunitid
1: systemuser
ApiExceptionSourceKey: Plugin/Microsoft.Crm.ObjectModel.SystemUserService
ApiStepKey: 5acabb1b-ea3e-db11-86a7-000a3a5473e8
ApiDepthKey: 1
ApiActivityIdKey: 2832e742-3fea-4642-87e9-6c2dcc664a60
ApiPluginSolutionNameKey: System
ApiStepSolutionNameKey: System
ApiExceptionCategory: ClientError
ApiExceptionMesageName: UnableToRetrieveAttributeValueFromEntity
ApiExceptionHttpStatusCode: 400
My hero ... Thank you for this
Thanks for this! Had exactly the same problem. Not sure when this got introduced as I have created application users many times in the UI previously.
I have added the Business unit field in the application user form.
This has solved my issue.
[/quote]I'm not too savvy with Dynamics 365, but here's what I can do to elaborate more when adding Business Units (I was like 1 hour scratching my head where to add the Business Unit column into the form). It will save your time rather than writing or executing a code which you also need time reviewing whether the code do any good for you.
In your https://admin.powerplatform.microsoft.com, go to your environment where you want to give a tick your environment and click "Settings" on the top toolbar. From there, open the "Resources" drop down and click "All legacy settings". It will bring you to the classic settings page (You have to go through the classic in order to modify the form).
Next to the big "Dynamic 365" there's "Settings", click the down-arrow icon to reveal the menu and click "Security", then click "Users". Usually the title and the pin will be selected to "Enabled Users", change it to "Application Users". Then click on "New". On the top toolbar, you can see the "FORM EDITOR" button. Just click it, it will bring you to the form editor. On the right-hand side under "Field Explorer", drag and drop "Business Unit". "Save" it, "Publish", then "Save and Close".
Then just refresh (Ctrl + F5) the current "Application User" form, it will be added with Business Units and your Application User form will succeed to submit.
I have added the Business unit field in the application user form.
This has solved my issue.
How can I use the code?
Hi Frederik Bisback,
The 0x80040530 error code is a UnableToRetrieveAttributeValueFromEntity error with a message of "unable to retrieve attribute '{0}' for entity '{1}'. Please provide a valid attribute name." The error is occurring as the process of creating an application user is unable to retrieve attribute=businessunitid for entityLogicalName=systemuser.
How are you creating the Application User? You will be able to get around this issue by creating/updating Application Users in Dynamics 365 programmatically.
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,240 Super User 2024 Season 2
Martin Dráb 230,149 Most Valuable Professional
nmaenpaa 101,156