Quantcast
Channel: PDCM's Activities
Viewing all articles
Browse latest Browse all 170

Create record and assign while updating record in plugin

$
0
0

Hello,

while opportunity record iam trying to create custom entity record and assigning to specific user .

Entity taskform = new Entity("new_taskform");

EntityReference owner = new EntityReference();
OpportunityID = new Guid(entity.Attributes["opportunityid"].ToString());
taskform.Attributes.Add("name", "Task for " );
owner.Id = new Guid("093A74B6-440D-E811-A957-000D3AF08FCF"); // Taking id from current entity and assigning it to contact’s owner
owner.LogicalName = "systemuser"; // Taking id from current entity and assigning it to contact’s owner

taskform["ownerid"] = owner; //"093A74B6-440D-E811-A957-000D3AF08FCF";

taskform["regardingobjectid"] = new EntityReference("opportunity", OpportunityID);Guid guid = orgService.Create(taskform);

iam getting following error 

An exception of type 'System.ServiceModel.FaultException`1' occurred in PluginProfiler.Library.dll but was not handled in user code

Additional information: 'new_taskform' entity doesn't contain attribute with Name = 'name' and NameMapping = 'Logical'.

please suggest how to fix .

Thanks,


Viewing all articles
Browse latest Browse all 170

Trending Articles



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