Is there a way to trace errors to the dynamics tracing log in a pcf component like you would for a .NET plugin?
I am developing plugins that are called frop a pcf component. In the plugin, any errors are traces using ITracingService.
What I was wondering is if it was possible to do the same thing in the power apps component framework to trace errors component side
Well, it should be pretty straightforward to write your own using Context.WebAPI.CreateRecord -- the main thing that would make rolling your own difficult in Plugins is the transaction rollback, but there is no such mechanism client-side, so no such worries. Maybe try something like this (I haven't tested it, so there might be more required fields you need to populate before this code will work!):
public trace(traceMessage: string){
let trace: ComponentFramework.WebApi.Entity = {
text: traceMessage,
}
this._context.webAPI.createRecord("tracelog", trace);
}
public init(context: ComponentFramework.Context<IInputs>, notifyOutputChanged: () => void, state: ComponentFramework.Dictionary): void {
this.trace("Entered init function! Trace it!");
}
WarrenBelz
87
Most Valuable Professional
mmbr1606
71
Super User 2025 Season 1
Michael E. Gernaey
67
Super User 2025 Season 1