The Requested Resources was not found or you do not have sufficient permissions to view it

StackOverflow https://stackoverflow.com/questions/23492554

  •  16-07-2023
  •  | 
  •  

سؤال

Dynamics crm when retrieving value and updating it into another entity it showing like The Requested Resources was not found or you do not have sufficient permissions to view it

i specified update ids like enobj.Id=(Guid)context.OutputParameters["id"]; message:create service :update on another entity The Requested resources not available

this is my code:

Query Expression query = new Query Expression();
query.EntityName = en.LogicalName;
query.ColumnSet = new ColumnSet("new_amount");
var x = service.RetrieveMultiple(query);
Entity enobj = new Entity("new_product"); 
int i = 0;
foreach (var item in x.Entities)
{   
    i = i + (int)item.Attributes["new_amount"];
    enobj.Attributes["new_grandtotal"] = i;
}

enobj.Id=(Guid)context.OutputParameters["id"];

// en.Id = enobj.Id;
enobj.Id = en.Id;
service.Update(enobj);

message:create service :update

i have two entites product and productlineitems

in productlineitems iam creating a record with the field amount 50 after creating that value.iam updating on product entity. again i create productlineitem 2 with the value some 90.iam adding 50+90 =140 again lineitem 3 with the value. iam taking that on product entity

message:create --- productlineitems service :update --- product enter image description here

هل كانت مفيدة؟

المحلول

I think you are trying to update Product with Product Line Id. Try the following:

Replace

enobj.Id = en.Id;

With

// set the field name (key) based on what you got in system
enobj.Id = (Guid)en["new_productid"];

Also, Calling Context is set to Current user. So make sure that user have permissions to update Product.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top