Quantcast
Channel: Microsoft Dynamics CRM Forum - Recent Threads
Viewing all articles
Browse latest Browse all 46379

Can You Update Entity Attribute In PostOperation?

$
0
0

I have a plugin that is registered like this:

[CrmPluginRegistration(MessageNameEnum.Create,
    "contractdetail",
    StageEnum.PostOperation,
    ExecutionModeEnum.Asynchronous,
    "",
    "Post-Invoice Contract",
    1,
    IsolationModeEnum.Sandbox)]


I am trying to update an attribute within the target entity like this:

                    //Update Contract Line StartDate
                    Entity updatedContractLine = new Entity(entity.LogicalName)
                    {
                        Id = entity.Id
                    };
                    updatedContractLine["activeon"] = startDate;
                    service.Update(updatedContractLine);


I know that a PostOperation means that the created entity has already been committed to the database and I am fine with that. I want the "activeon" attribute to be updated after it is created. For some odd reason, the attribute is not updating! Can someone explain why?!


Viewing all articles
Browse latest Browse all 46379

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>