Reputation: 5
Can a variable be used like this code in the macro expressions to retrieve values dynamically?
I am trying the code below which return as null.
var indexId = 45;
return CMSContext.Current.GlobalObjects.Users[indexId].DisplayName;
Upvotes: 0
Views: 207
Reputation: 5
I figured that the code should be on the same line. Earlier I was declaring the variable in separate line. So this works now
indexId = 45;return CMSContext.Current.GlobalObjects.Users[indexId].DisplayName;
Upvotes: 0