web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / unable to remove recor...
Power Apps
Unanswered

unable to remove record through Low-Code PowerFx Plugin

(0) ShareShare
ReportReport
Posted on by 601

Dear,

I know that the low code plugins are still in preview, but I thought I would give it a try anyway.

On editing an OpportunityProduct I am trying to delete another record using a plugin (Entity: OpportunityProduct, Message: Update, Stage: Post-Operation, Mode: Async), with the following code (with a hardcoded guid as example, which is different than the record the plugin is triggered from):

 

 

Remove(opportunityproduct, LookUp(opportunityproduct, opportunityproductid = GUID("18556dae-5593-ee11-be37-000d3aacaa23")))

 

 

giving the following error:

 

 

Start message: Update, stage=PostOp, etn=opportunityproduct baf25ed5-4693-ee11-be37-000d3aacaa23, ver=1.0.0.0
Object reference not set to an instance of an object., script: [compiled]Remove(opportunityproduct, LookUp(opportunityproduct, opportunityproductid = GUID("18556dae-5593-ee11-be37-000d3aacaa23"))), input: ???
Exception thrown: System.NullReferenceException: Object reference not set to an instance of an object.
 at PowerPlexPlugin.DataverseServices.DeleteAsync(String entityName, Guid id, CancellationToken cancellationToken)
 at Microsoft.PowerFx.Dataverse.DataverseTableValue.<RemoveAsync>d__18.MoveNext()

 

 

When trying the same through a canvas app with the equivalent code

 

 

Remove('Opportunity Products', LookUp('Opportunity Products', opportunityproductid = GUID("18556dae-5593-ee11-be37-000d3aacaa23")))

 

 

it works fine.

 

If I use a non-existing GUID,

 

 

Remove(opportunityproduct, LookUp(opportunityproduct, opportunityproductid = GUID("00000-0000-0000-0000-000d3aacaa23")))

 

 

I get the "correct" error that the record does not exist.

 

 

Start message: Update, stage=PostOp, etn=opportunityproduct baf25ed5-4693-ee11-be37-000d3aacaa23, ver=1.0.0.0
Exception thrown: Microsoft.Xrm.Sdk.InvalidPluginExecutionException: Error attempting lookup. Entity 'opportunityproduct' With Id = 00000-0000-0000-0000-000d3aacaa23 Does Not Exist
 at PowerPlexPlugin.RuleMessageHandler.RunDirect(CompiledExpression[] compiledExpressions, EventMessageName message)
 at PowerPlexPlugin.RuleMessageHandler.RunDirect(CompiledExpression compiledExpression, EventMessageName message)
 at Microsoft.PowerFx.Evaluator.ExecuteCore(DataverseServices services, PlexPluginContext Context, IOrganizationService orgService)
 at Microsoft.PowerFx.Evaluator.<>c__DisplayClass13_0.<Execute>b__0()

 

 

So, it seems that in the original code the system did find the record to be deleted, but it does not "want" to delete it through the Plugin...

Does anyone knows what is preventing deleting the record?

best regards,

Koen

 

 

I have the same question (0)

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 846

#2
Valantis Profile Picture

Valantis 532

#3
Haque Profile Picture

Haque 410

Last 30 days Overall leaderboard