Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Example code to execute a WhoAmIRequest in a custom plugin:

Code Block
var SampleCustomer = SampleCustomer || {};
SampleCustomer.Plugins = SampleCustomer.Plugins || {};

SampleCustomer.Plugins.whoAmI = async function (context) {
    var requestData = {};

    var metadata = {
        boundParameter: null,
        parameterTypes: {},
        operationType: 1, // This is a function. Use '0' for actions and '2' for CRUD
        operationName: "WhoAmI",
    };

    var response = await Enreach.API.Xrm.execute(requestData, metadata);
    console.log("Your user id is " + response.UserId);
};

...