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:
<feature-usage>
<uses-feature name="WebAPI" required="true" />
</feature-usage>
Is there something else I am missing ?