Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago

Unable to refresh Dynamic Data Sources from CRM

I have a report that is connecting to Dynamics CRM using the M query below. Works fine in the desktop but will not refresh on the service. New to M query and connecting to Dynamics CRM this way. Any assistance would be appreciated!! 

 

 

let
crmUrl = "https://xxxxxxx.api.crm9.dynamics.com/api/data/v9.2/",
Source = "reports(bbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbb)?$select=bodybinary",
odataReply = Json.Document(Web.Contents(crmUrl & Source)),
textfile = Text.FromBinary(Binary.FromText(odataReply[bodybinary])),
functionText = List.Skip(Text.Split(textfile, "///")),
functionNames = List.Transform(functionText, each Text.Trim(Text.BeforeDelimiter(_, "#(cr)#(lf)")) ),
functionEvaluate = List.Transform(functionText, each Expression.Evaluate(Text.Insert(_,0,"// "), #shared)),
Custom1 = Record.FromList(functionEvaluate, functionNames),
crmGetEntityView = Custom1[crmGetEntityView],
getView = crmGetEntityView("Purchase Request")("*MyViews*>PBI - Active Obligations")
in
getView

3 Replies