cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Dexx3336
Level: Powered On

Not able to create the attachment regarding any entity

Hi All,

The code which was running earlier for creating the attachment in CRM from canvas app is not running now.

 

below is code snippet:

 

Patch(
Notes,
Defaults(Notes),
{
subject: TextInputTitle.Text,
notetext: TextInputDescription.Text,

_objectid_value : BrowseGallery1.Selected.accountid,
objecttypecode : "accounts",

filename: First(CameraImage).Filename,
documentbody: If(
StartsWith(
First(CameraImage).fileBody,
"data:image"
),
Replace(
First(CameraImage).fileBody,
1,
Len(
Left(
First(CameraImage).fileBody,
Find(
",",
First(CameraImage).fileBody
)
)
),
""
),
First(CameraImage).fileBody
)
}
)

What is wrong in above code? I also tried by using  "_objectid_type" instead of "objecttypecode" but didn't work for me. Smiley Sad 

 

Thanks in advance.

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Not able to create the attachment regarding any entity

Hi @Dexx3336,

Please take a try to turn off/disable the "Use GUID data types instead of strings" option within Advanced settings of App settings of your app, then re-load your app, try your formula again, check if the issue is solved.4.JPG

 

Best regards,

Kris

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

13 REPLIES 13
Community Support Team
Community Support Team

Re: Not able to create the attachment regarding any entity

Hi @Dexx3336,

Could you please share more details about the error message within your app?

Do you want to patch a new record within the Notes entity based on your Accounts record?

The user @chrisgreen has faced similar issue with you, please check the response within the following thread:

https://powerusers.microsoft.com/t5/Common-Data-Service-for-Apps/Ambiguous-binding-present-on-Patch/...

If the issue still exists, please consider take a try to submit an assisted support ticket throught the following link:

https://powerapps.microsoft.com/en-us/support/pro/

 

Best regards,

Kris

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Dexx3336
Level: Powered On

Re: Not able to create the attachment regarding any entity

Thanks, @v-xida-msft for a response. 
when I used _objectid_type I am getting below error:

Patch(
Notes,
Defaults(Notes),{
subject: TextInput1.Text,
_objectid_value: BrowseGallery1.Selected.accountid,
_objectid_type:"accounts"}
)

powerapp save image using patch to crm error.png

let me know if I am missing something in the above code?

And if I am right? then, don't know why the code is not working now Smiley Sad . I have already used the same code before and it worked at that time. But it is not working now.

suggestion/solution from anyone will be appreciated. I really need it this time as our client moved to D365 v9.1 online and it does not support off-line capability in the mobile app.

Thanks!

 

Dexx3336
Level: Powered On

Re: Not able to create the attachment regarding any entity

Is any work around solution for this?

Community Support Team
Community Support Team

Re: Not able to create the attachment regarding any entity

Hi @Dexx3336,

Please take a try to turn off/disable the "Use GUID data types instead of strings" option within Advanced settings of App settings of your app, then re-load your app, try your formula again, check if the issue is solved.4.JPG

 

Best regards,

Kris

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Dexx3336
Level: Powered On

Re: Not able to create the attachment regarding any entity

Hi @v-xida-msft , 
Yes, i also reached at that point in my finding and this was the only reason why it was not allowed to save the attachments in CRM.
I also noticed that before recent update this option was defaulted to false . But now it is set to true bydefault.

Thanks for your efforts. Smiley Happy

Sachinbansal
Level: Powered On

Re: Not able to create the attachment regarding any entity

Hi @Dexx3336 

 

I am also facing same issue while creating notes in D365, and as you suggested to turn off flag for "User Guid data types instead of strings", I do not find this option under App Settings. Any suggestions? I started getting this error as as soon as I enabled "Use Display Column Names" feature. Even I do not find this option to disable it back in App Settings.

finsg
Level: Powered On

Re: Not able to create the attachment regarding any entity

+1 I'm also facing this issue. And the "Use GUID data types instead of strings" option is missing in the Apps Setting. Has the option been moved @v-xida-msft ?

shine
Level: Power Up

Not able to create notes record in D365

I am also facing same issue while creating notes record in D365, and as you suggested to turn off flag for "User Guid data types instead of strings", this setting is not listed under App Settings. Is there any other option provided? Any suggestions? 

Sachinbansal
Level: Powered On

Re: Not able to create notes record in D365

Hi @shine 

 

Only option untill this issue/bug is fixed is to create a flow and pass note title, description, regarding value as parameters from PowerApp. That's what I did in my app.

 

Regards

Sachin Bansal

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (4,623)