I have a created a simple RetrieveRecord example in my new pcf application:
I call the following function from init:
public init(context: ComponentFramework.Context<IInputs>, notifyOutputChanged: () => void, state: ComponentFramework.Dictionary, container:HTMLDivElement)
{
this.makeRequestCrm(context);
}
async makeRequestCrm(context: ComponentFramework.Context<IInputs>) {
context.webAPI.retrieveRecord('account','xxxxx').then(
function success(result) {
console.log(result);
},
function (error) {
console.log(error);
}
);
I have set the web api feature in my input manifest xml:
@chigivigi08 where do you do your tests? It won't work in harness or in Canvas Apps but it should work fine in Model Driven App.
Take a Look into the doc from Microsoft.
WarrenBelz
81
Most Valuable Professional
mmbr1606
53
Super User 2025 Season 1
stampcoin
48