Petr Hubík
Petr Hubík

Reputation: 191

MS CRM 2011 Creating quote with REST to user with read-only access

I'm creating Quotes in own calculation system and exporting them to MS CRM 2011 throught REST API with credentials of users. Then those quotes are displayed in CRM as theirs (as if they created it by clicking in CRM). But now we want to edit privilege, so users can these quote only read. But this mean, that throught REST API I'm unable to create quote with their credentials. Is there a way how to create new Quote as user, which has read-only access throught web? Or is it possible to change authorship after quote was created?

Upvotes: 0

Views: 850

Answers (1)

Guido Preite
Guido Preite

Reputation: 15128

To set the record's owner inside CRM 2011 there are 3 ways:

Entity quote = new Entity("quote");
// set the fields
// ...
// set the owner
Guid ownerId = new Guid("BFC777ED-5E79-E111-8489-00166D63156F");
quote["ownerid"] = new EntityReference("systemuser", ownerId);
service.Create(quote);

In your case when you create the quote using the REST API you need to set the ownerid field with the GUID of the selected user.

Is not possible to change the owner of an existing record using REST.

Upvotes: 4

Related Questions