cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Advocate I
Advocate I

Create one case record from Canvas App into Dynamics 365 Customer Service

Hi Power Apps Developers!

I'm not able to create one Dynamics 365 Case record from Canvas Apps by Patch() or SubmitForm() functions; cause:

  • there is the "Customer" polymorphic lookup field but D365 Case data don't achieve the attribute "Customer" (I remember that Customer is a grayed required field for Dynamics 365)
  • there is a lot of confusion on the Community about to fill correctly a simply CDS lookup field (ex. SLA lookup, Contact lookup etc...)

here the concept Power Apps Claim form:

FormPA.png

here my code onSelect button "Create New":

 

 

 

 

Patch(
    Cases,
    Defaults(Cases),
    {
        title: txtTitleFC.Text,
        description: txtDescriptionFC.Text,
        caseorigincode: Value(drpOriginFC.Selected.Value),
        prioritycode: drpPriorityFC,
        customer: First(colCustomerToBeAdded).colCustomerRecord
        sla: First(cmbSlaFC.selected)
    }
);

 

 

 

 

where:

colCustomerToBeAdded is a collection item with the record customer (Account or Contact) 

cmbSlaFC  is a combo box input filled by D365 SLA records data set (simply lookup field).

 

@fins reported the same problem at the end of this post:

https://powerusers.microsoft.com/t5/Building-Power-Apps/Error-Using-Patch-to-Create-Record-with-Poly...

 

I hope that someone expert will help us with a definitive solid solution to create a Case record by Power Apps and solve the Customer Polymorphic lookup.

 

Thanks in advance

 

4 REPLIES 4
Highlighted
Super User III
Super User III

Hi @David_Pezzoli 

This is well beyond my level of expertise but on searching regarding the issue I found the link below.  Perhaps it will help. https://pavankumargarlapati.wordpress.com/2019/08/06/embedded-canvas-app-how-to-get-the-selected-pol... 

Highlighted

@Drrickryp  Unfortunately it does not answer the problem or solve it: your link explain a contact example by Owner inside Contact form, not Case form...

Create a Case from a standalone Power Apps is my difficulty.

 

Thanks anyway for your trying!

Highlighted

Hi @David_Pezzoli 

 

I've tried to do the same thing with a Canvas Power App and gave up in the end.  My gut feeling is that it is not supported currently.  

 

What I have done instead is create a Power Automate flow to create the Case record instead.  The Canvas App calls the flow, the flow creates the Case in CDS and then the flow returns the Case ID back to Power Apps to do what you want with it.  

 

This isn't as elegant as it could be but it works for me.

 

The alternative is to raise a support case with Microsoft and get the official word on whether this is supported or not.

 

-----
 
If this post has answered your question please consider it for "Accept as Solution" or if it has been helpful give it a "Thumbs Up".

Highlighted

@HSheild ,

thank you for your feedback, this issue is a sad gap for the Power Apps features. So this prove that the tool is still young: not being able to create a Case CDS record by Patch .... sigh... is disheartening!

 

Before choosing your reply like "Accept as Solution" I wait a few days if someone else has other opinions about this Microsoft gap.

 

Thank you so much!

David

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

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

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Users online (14,276)