Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Power Apps Pro Dev & ISV
Answered

Getting error in Canvas app when calling this._context.webAPI.createRecord

(0) ShareShare
ReportReport
Posted on by 36

Hi,

 

I am using this pcf control .

docs 

 

Model Driven App

-Download the code

-Generate solution-

-Import into Model Driven App 

This is working fine

 

Canvas App
My requirement is to use the same piece of control and same code work in Canvas App.

But when I try to load this control into canvas. I am getting error. "Method not implemented"

 

Can someone tell me how to fix this?
My required is to call CDS webapi into canvas a

 

 

  • Verified answer
    Ben Thompson Profile Picture
    1,400 on at
    Re: Getting error in Canvas app when calling this._context.webAPI.createRecord

    If it is separate  there is really nothing you can do - the CDS environment doesn't exist and the canvas app has no way of identifying which environment it should be talking to.

     

    If it is embedded within a CDS environment you could (if you really, really had to and I really really don't recommend it) read the pageUrl and use as the basis to make webapi calls. But you will not have the Xrm interface so you will need to use 

    XMLHttpRequest to make the request and handle the responses.
     
    As I said it's just about possible in the latter circumstance but I really, really wouldn't be doing so. You need to find a more appropriate means to get the CDS information you want into dataset the canvas app is querying.
  • rrizwann Profile Picture
    36 on at
    Re: Getting error in Canvas app when calling this._context.webAPI.createRecord

    We have both scenario.

    We are using canvas app separately and  embedded in a CDS application also

  • Ben Thompson Profile Picture
    1,400 on at
    Re: Getting error in Canvas app when calling this._context.webAPI.createRecord

    I don't think there is any easy one.

     

    The purpose of a PCF component is to improve the display of information in the context of the current record - as the current record in a canvas app is not a CDS record there is no need or way to provide the functionality.

     

    Is the canvas app embedded in a CDS application or is it entirely separate to the CDS environment?

  • rrizwann Profile Picture
    36 on at
    Re: Getting error in Canvas app when calling this._context.webAPI.createRecord

    Thanks for the reply.

     

    What is the alternate way to call the CDS Webapi into Canvas app ?

     

    Thanks

    R.

  • Verified answer
    Ben Thompson Profile Picture
    1,400 on at
    Re: Getting error in Canvas app when calling this._context.webAPI.createRecord

    Sadly you can't do that - once you are in a canvas app there is no CDS environment to call so the Web API feature cannot be used as there is nothing to call. 

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

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Power Apps - Power Apps Pro Dev & ISV

#1
WarrenBelz Profile Picture

WarrenBelz 87 Most Valuable Professional

#2
mmbr1606 Profile Picture

mmbr1606 71 Super User 2025 Season 1

#3
Michael E. Gernaey Profile Picture

Michael E. Gernaey 65 Super User 2025 Season 1

Overall leaderboard