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.

 

 

13 REPLIES 13

Hi @Sachinbansal , any links for this tutorial?

Hi @finsg 

 

Below link would help you on how to create flow and call it from PowerApps passing paramaters.

 

https://sachinbansal.blog/2018/04/05/dynamics-365-powerapp-microsoft-flow-sample-app-from-scratch/

 

Specific to notes creation, you can use below on button click or whatever:

'PowerApps-CreatenotesinD365'.Run(txtNoteTitle.Text, txtNoteDescription.Text, Regarding)

 

Here regarding would be guid of record to add note to.

 

Attached is snapshot of how flow will look like. Make sure to map yellow highlighted fields in flow.

Hey

 

I came here looking for the solution to my problem, adding attachments not just notes, but have resolved the issue and I hope my blog helps others.

 

https://linked365.home.blog/2019/05/11/creating-attachments-in-d365/

I found an easier way to patch notes to work, use Regarding:GUID(<record-guid>) instead...
Read more here:
https://powerusers.microsoft.com/t5/Creating-Apps/Patch-photo-s-to-Notes-Entity-in-Dynamics/m-p/3205...

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

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Top Solution Authors
Top Kudoed Authors
Users online (70,954)