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

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

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
v-xida-msft
Community Support
Community Support

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.

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!

 

Is any work around solution for this?

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

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

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
Regular Visitor

+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
New Member

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? 

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
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

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.

Carousel April Dunnam Updated 768x460.jpg

Urdu Hindi D365 Bootcamp

Dont miss our very own April Dunnam’s The Developer Guide to the Galaxy! Find out what the Power Platform has to offer for the traditional developer.

Top Solution Authors
Top Kudoed Authors
Users online (1,973)