Thanks for the response.. Ravi , Goutam, Mahender ... Actually the procedure written by goutam i'm following right now.. when I'm trying to solve the first step i'm having trouble .. My webapi returning all the entities when i run without filtering Primary key value. but when i'm trying to query by using GUID then i'm not getting any result...
Here is the path GET [Organization URI]/api/data/v8.2/accounts?userQuery=766b0101-5044-e611-80d3-000d3a918c4d
I tried with accountid inplace of userquery even no luck...
{
"error":{
"code":"","message":"Syntax error at position 10 in 'AccountId=9fe17aa2-e5a2-e711-80fd-000d3a91d738'.","innererror":{
"message":"Syntax error at position 10 in 'AccountId=9fe17aa2-e5a2-e711-80fd-000d3a91d738'.","type":"Microsoft.OData.Core.ODataException","stacktrace":" at Microsoft.OData.Core.UriParser.ExpressionLexer.ValidateToken(ExpressionTokenKind t)\r\n at Microsoft.OData.Core.UriParser.Parsers.UriQueryExpressionParser.ParseExpressionText(String expressionText)\r\n at Microsoft.OData.Core.UriParser.ODataQueryOptionParser.ParseFilterImplementation(String filter, ODataUriParserConfiguration configuration, IEdmType elementType, IEdmNavigationSource navigationSource)\r\n at Microsoft.OData.Core.UriParser.ODataQueryOptionParser.ParseFilter()\r\n at System.Web.OData.Query.FilterQueryOption.get_FilterClause()\r\n at Microsoft.Crm.Extensibility.OData.DataQueryOptionsConverter.SetFilterExpression(QueryExpression qe, FilterQueryOption filterQueryOption)\r\n at Microsoft.Crm.Extensibility.OData.QueryOptionsConverterBase`4.GetQueryExpression(ODataQueryOptions queryOptions, String edmEntityName, CrmODataExecutionContext context)\r\n at Microsoft.Crm.Extensibility.OData.CrmODataServiceDataProvider.RetrieveEdmEntityCollection(CrmODataExecutionContext context, String entityCollectionName, String castedEntityName, ODataQueryOptions queryOptions)\r\n at Microsoft.Crm.Extensibility.OData.EntityController.GetEntitySetInternal(String entitySetName, String castEntityName, CrmODataExecutionContext context, CrmEdmEntityObjectCollection crmEdmEntityObjectCollection, ODataQueryOptions queryOptions)\r\n at Microsoft.Crm.Extensibility.OData.EntityController.GetEntitySet(String entitySetName)\r\n at lambda_method(Closure , Object , Object[] )\r\n at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>c__DisplayClass10.<GetExecutor>b__9(Object instance, Object[] methodParameters)\r\n at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ExecuteAsync(HttpControllerContext controllerContext, IDictionary`2 arguments, CancellationToken cancellationToken)\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Controllers.ApiControllerActionInvoker.<InvokeActionAsyncCore>d__0.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Controllers.ActionFilterResult.<ExecuteAsync>d__2.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Dispatcher.HttpControllerDispatcher.<SendAsync>d__1.MoveNext()"
}
}
}
I have that record in my entity..
"@odata.etag":"W/\"3353205\"","customertypecode":100000000,"address2_addresstypecode":1,"merged":false,"statecode":0,"exchangerate":1.0000000000,"name":"Franchise 474","statuscode":1,"modifiedon":"2017-12-01T18:22:46Z","_owninguser_value":"369c3eea-a3f7-e511-80cb-000d3a913664","hisc_peaqtrackingsurveyparticipant":true,"donotpostalmail":false,"accountratingcode":1,"donotphone":false,"hisc_peaqannualsurveyparticipant":false,"preferredcontactmethodcode":1,"_ownerid_value":"369c3eea-a3f7-e511-80cb-000d3a913664","customersizecode":1,"hisc_newfranchsienumber":474,"openrevenue_date":"2018-12-05T21:59:37Z","businesstypecode":1,"donotemail":false,"address2_shippingmethodcode":1,"address1_addressid":"e51072d4-65ef-4468-a634-89dfaaa6535e","address2_freighttermscode":1,"_hisc_primarylocation_value":null,"createdon":"2017-09-26T18:08:22Z","versionnumber":3353205,"donotbulkemail":false,"opendeals_date":"2018-12-05T21:59:37Z","donotfax":false,"hisc_isprimarylocation":false,"donotbulkpostalmail":false,"donotsendmm":false,"hisc_satelliteoffice":false,"creditonhold":false,"_transactioncurrencyid_value":"bdc0cdd6-a4f7-e511-80cb-000d3a913664","accountid":"9fe17aa2-e5a2-e711-80fd-000d3a91d738"
I tried by using different GUID values from the entity..
any help would be appreciated ...