cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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
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.

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 ?

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
News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

Power Apps Community Call

Power Apps Community Call- January

Mark your calendars and join us for the next Power Apps Community Call on January 20th, 8a PST

PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

Top Solution Authors
Top Kudoed Authors
Users online (8,988)