web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Creating Activity Type...
Power Apps
Unanswered

Creating Activity Type Records With PowerApp not possible due to Metadata Error in CDM / PowerApp

(0) ShareShare
ReportReport
Posted on by

I want to write a PowerApp that creates a new Activity Record in Dynamics 365 CE / CRM. Activity Records can be Phone Calls, Email Records, but also Notes containing files/attachments. They have a special field called "regarding": It specifies to which actuall record an activity record belongs. For example, this could be a lead, an opportunity or basically any custom entity. As this field can point to different tables, CRM needs not only the reference to the target record (which is a GUID), but also to the target table. This can be specified in CRM as Entity Type Name ("accounts", "leads", ...) or entity type code (1,2,3, ...). Now I try to create an activity record using PowerApps as shown below:

 

Patch(Notizen, Defaults(Notizen), {subject:"Test", notetext:"Test", _objectid_value:Gallery1.Selected.leadid, _objectid_type:"leads", filename:"img.jpg",documentbody:""})

 

The relevant fields are _objectid_value and _objectid_type. The first contains the GUID to the targetet lead, the second the entity type. However, PowerApps calls out an error: "The type of this argument '_objectid_type' does not match the expected type 'GUID'. Found type 'text'".

 

This is obviously wrong: The type in this context in CRM is not and has never been GUID. It has to be number or text. I verified this behaviour in different environements with different regarding target entities and different activity types - all wrong with the same error. It doesn't even matter whether I connect via Dynamics Connector or CDS connector.

 

Some forum/blog entries already mention this problem - for example this one:

https://www.inogic.com/blog/2019/02/populate-multi-entity-lookup-fields-of-dynamics-365-ce-in-powerapps/

 

The proposed solution is to turn off advanced setting "Use GUID data type instead of strings". However, this option is no longer available. Other options didn't have the desired effect.

 

Does someone know an up-to-date workaround? And could this bug please be fixed? The proxy type generator for Dynamics should simply respect the fact that regarding fields (and some others) have a string element detailing the target table.

 

Thanks in advance!

I have the same question (0)
  • PavanKumar Profile Picture
    479 on at

    Hi @Jochen365 ,

     

    instead of providing id and type seperately you can give record as below

    Patch(Notizen, Defaults(Notizen), {subject:"Test", notetext:"Test", objectid:Lookup(Leads,Lead = Gallery1.Selected.leadid),filename:"img.jpg",documentbody:""})

    or instead of objectid you can give the actual field name example 'Regarding'.

     

     

    if this answers your question mark it as verified and give it a thumbs up

    Regards,

    Pavan Kumar Garlapati

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    This might work:

    ID: GUID()
    GUID("8daf3206-44b6-40a5-8cdd-2d31b91a5c52")

     

    Might be helpful:

    https://powerusers.microsoft.com/t5/Building-Power-Apps/quot-Activity-Type-quot-from-Activity-entity-in-Dynamics-365-not/m-p/584177/highlight/true#M182787 

     

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 530

#2
WarrenBelz Profile Picture

WarrenBelz 459 Most Valuable Professional

#3
Haque Profile Picture

Haque 314

Last 30 days Overall leaderboard