Context Parameters

You will often want to include information from the user's context in the filters for your query. For example, what if I want to show only those books where the supplier org matches my org? Several "context parameters" are always available to all reports for you to use just as if they were passed in like a user-provided filter:

  • MY_VC_ID: Value chain ID of the user (and role)

  • MY_VC_NAME: Value chain name of the user (and role)

  • MY_ENT_ID: ID of the enterprise of the role currently performed by the user (may be null).

  • MY_ENT_NAME: Name of the enterprise of the role currently performed by the user (may be null).

  • MY_ORG_ID: ID of the organization of the role currently performed by the user (may be null).

  • MY_ORG_NAME: Name of the organization of the role currently performed by the user (may be null).

  • MY_SITE_ID: ID of the parent site of the role currently performed by the user (may be null).

  • MY_SITE_NAME: Name of the site associated with the role currently performed by the user (may be null).

  • MY_ROLE_ID: Current user's role ID, based on the role they are currently performing.

  • MY_ROLE_NAME: Current user's role name, based on the role they are currently performing.

  • MY_ROLE_TYPE_NAME: Current user's role type name, based on the role they are currently performing.

  • MY_USER_ID: Current user's ID.

  • MY_USER_NAME: Current user's user name.

  • MY_USER_ENT_ID: Current user's enterprise ID, irrespective of their current role, based on the enterprise with which they are associated.

  • MY_USER_ENT_NAME: Current user's enterprise name, irrespective of their current role, based on the enterprise with which they are associated.

Let's apply this to our Bookstore report, filtering out any Books whose supplier org doesn't match the user's org:

and SYS_SUPPLIER_ID = $MY_ORG_ID$

After making this change, you should see only those Books where the Supplier org matches the current user's org.

images/download/attachments/144836770/orgperm-version-1-modificationdate-1655932381000-api-v2.jpg