Showing results for 
Search instead for 
Did you mean: 
Helper II
Helper II

PCF is not working when form context is used


Hi All,

I have build PCF using some of the deprciated Client APis lke

and Xrm.Page
to get the related details. My problem is when I need to use it to build PCF as there is no way or atleast I can't  find a way to use formContext .
Here is the example of it, I tried to define a fuction and use form context but its giving error in PCF as its not accepting the formContext. Can you please tell me the way because I am afraid if its depricated completly, we need to rework again and if its depricated then what is the timeline for complete block of it???
account1 = Xrm.Page.getAttribute("account").getValue();
var userSettings = Xrm.Utility.getGlobalContext().userSettings;
var currentuserid = userSettings.userId;
if (Xrm.Utility.getGlobalContext().getQueryStringParameters().pageType=="quickcreate"){      
var userId=currentuserid.replace("{""").replace("}""");
var req = new XMLHttpRequest();"GET"Xrm.Utility.getGlobalContext().getClientUrl() + "/api/data/v9.2/systemusers(" + userId + ")?$select=productmarket"false);
req.setRequestHeader("Content-Type""application/json; charset=utf-8");

Helpful resources

Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Power Apps Ideas

Check out the New Ideas Site

We are excited to announce a new way to share your ideas for Power Apps!

Top Solution Authors
Top Kudoed Authors
Users online (5,887)