Retrieving environment variable value in Javascript
The script below might help if you wanted to read CDS environment variable value in your javascript web resource. top.environmentVariables = []; function getEnvironmentVariableInternal(varName){ “use strict”; top.environmentVariables[varName] = null; Xrm.WebApi.retrieveMultipleRecords(“environmentvariabledefinition”, `?$top=1&fetchXml=<fetch version=’1.0′ output-format=’xml-platform’ mapping=’logical’ distinct=’true’> <entity name=’environmentvariabledefinition’> <attribute name=’defaultvalue’ /> <filter type=’and’> <condition attribute=’schemaname’ operator=’eq’ value=’` + varName + `’ /> </filter> <link-entity name=’environmentvariablevalue’ from=’environmentvariabledefinitionid’… Read More »