A JavaScript command in a model-driven app must call an unbound Dataverse custom API named contoso_RecalculateTerms that takes a string parameter. The developer wants to use the Client API rather than building a raw HTTP request. What must the request object passed to Xrm.WebApi.online.execute provide?
Select an answer to reveal the explanation.
Short Explanation
Xrm.WebApi.online.execute is a courier that needs a shipping label: your request object's getMetadata says what operation it is, whether it's an action or a function, and what each parameter's type is. No label, no delivery.
Full Explanation
Xrm.WebApi.online.execute sends a single request built from a JavaScript object. The object carries the parameter values as properties and implements getMetadata, which returns the boundParameter, null for an unbound operation, the parameterTypes map describing each parameter's type name and structural property, the operationType, which distinguishes actions, functions and CRUD operations, and the operationName, which is the custom API's unique name. With this metadata the client library composes the correct Web API call, a POST for an action-style custom API or a GET for a function. Supplying only an entity name and ID describes a retrieve, not an operation, and the method does not infer operations from the current form. FetchXML is a query language for retrieving rows and cannot invoke a custom API. There is no method that resolves a custom API by its display name; operations are identified by their unique name, and parameters travel as properties of the request object, which the library serializes. Exam caveat: whether the custom API is called as an action or a function depends on how it is defined, and the operation type in getMetadata must match. Operational check: run the request from the browser console with a test value and confirm the custom API's plug-in or response properties return as expected.