Skip to main content

Notifications

Announcements

No record found.

Customer experience | Sales, Customer Insights,...
Suggested answer

D365 Plugin Update issue - Entity Id must be specified for Update

Posted on by 85

Hi,

I am developing a plugin which will override the existing behaviour of Qualify leads, for that I am running a plugin on the PreValidation event. However, I am getting an error on, systemService.Update(resp.Entity);

Error : Entity Id must be specified for Update

//initialize form
                    traceService.Trace("QualifyLeads: Account Creation started");
                    InitializeFromRequest req = new InitializeFromRequest();
                    //set the source entity
                    req.EntityMoniker = new EntityReference(LogicalName, LeadId);
                    req.TargetEntityName = "account";
                    req.TargetFieldType = TargetFieldType.All;

                    InitializeFromResponse resp = (InitializeFromResponse)systemService.Execute(req);

                    systemService.Update(resp.Entity);
                    traceService.Trace("QualifyLeads: Account Created");

Am I missing anything ?

Entity Id what i am getting in return is {00000 000000 0000000}

  • Suggested answer
    RG Student Profile Picture
    RG Student 85 on at
    RE: D365 Plugin Update issue - Entity Id must be specified for Update

    Guid guid = orgService.Create(resp.Entity);

    I was using the wrong method.

  • a33ik Profile Picture
    a33ik 84,323 Most Valuable Professional on at
    RE: D365 Plugin Update issue - Entity Id must be specified for Update

    Guid has that format because the record you initialize using InitializeFrom message is not created yet - you have it in code only.

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans