Code Fix: An error occurs when executing a List method on a View or Form at runtime
KB001933
PRODUCT
Issue Description
An error occurs when executing a List method on a View or Form at runtime for Microsoft CRM and Microsoft NAV using the OData Service Broker.
Error
“Exception has been thrown by the target of an invocation”.
Cause
Microsoft CRM and Microsoft NAV do not support all the parameters of OData.
Resolution
- Ensure you have K2 4.7 installed.
- Download and Install the K2 4.7 May 2017 Cumulative Update from K2 Partner and Customer Portal.
- Get the K2 4.7 May 2017 Cumulative Update FP5 from Regional Support.
- Install the K2 4.7 May 2017 Cumulative Update FP5 to apply the fix.
- Edit the OData Service Instance and note that a new Service Key is available called “Exclude query parameters”.
- Enter the parameters to be excluded (enter excluded parameters separated by a comma) :
- $top,$skip,$orderby,$inlinecount
- Refresh the SmartObject created from the OData Service Instance.