1
votes

I've created a plugin to set some custom fields on the businessunit entity when it's created.

I registered the plugin and confirmed the context message is Create.

Now, when I create a new businessunit, I get the exception message "Expected only one default business unit team".

I'm not setting the default team and even went so far as to remove the attribute before I save the entity.

1

1 Answers

1
votes

The problem was I was running in the context of Create and calling Update to save but the entity that hadn't been officially created yet.

I removed the Update() function because CRM will save my added attributes when it creates the record.