Hello Experts, I have copied the code below from another post in this forum. and wanted to use it to update a system view. However, when I use "SavedQuery sq = new SavedQuery{ }" Visual Studio tells me: "The type or namespace name 'type/namespace' could not be found (are you missing a using directive or an assembly reference?) Compiler Error CS0246". Am I missing any reference? Here are the ones I use: using System; using System.Linq; using Microsoft.Xrm.Sdk; using Microsoft.Xrm.Sdk.Client; using Microsoft.Xrm.Sdk.Query; One Doc I found is this one: https://docs.microsoft.com/en-us/dynamics365/customer-engagement/web-api/savedquery?view=dynamics-ce-odata-9 I tried to add Microsoft.Crm.Sdk; without any success. Maybe the wrong documentation? I hope someone can help me or point me into the right direction. Thanks in advance ! The code below is the one I've copied: System.String layoutXml = @" "; System.String fetchXml = @" "; SavedQuery sq = new SavedQuery { Name = "A New Custom Public View", Description = "A Saved Query created in code", ReturnedTypeCode = "Associated Hardware View", FetchXml = fetchXml, LayoutXml = layoutXml, QueryType = 0 }; service.Update(sq); //service = IOrganizationService Entity entity = new Entity("savedquery"); entity.Id = viewId; entity["fetchxml"] = fetchXml; entity["layoutxml"] = layoutXml; service.Update(entity);
↧