Forum Discussion
karthikeyan
Guide
Hi Lithium team,
As Stan said earlier, we are running into an issue of a code works for Admin and not working for Non-admin users, Lets for Employee it doesn't work. It returns empty records or no values, Can you please help us?
Following is the code snippet.
<!-- MasterAnaplanner Users and their role is either Customer or Partner Macro --> <#macro masterAnaplannerUsers> <#local msg = "SELECT id, href, view_href, login, email, first_name, last_name, rank.name, avatar.profile, rank.simple_criteria.role.id FROM users WHERE roles.id = 't:Master Anaplanner Directory'" /> <#local msgqry = executeLiQLQuery(msg) /> <#if msgqry?size gt 0> <#local users = msgqry /> <#list users as user> <#local userQuery = "SELECT name FROM roles WHERE users.id = '${user.id}'" /> <#local userObject = executeLiQLQuery(userQuery) /> <#if userObject?size gt 0> <#local roles = userObject /> <#if roles?? && roles[0]??> <#list roles as role> <#if role.name == "Customer" || role.name == "Partner"> <div class="col"> <div class="avatar-role"> <div class="avatar"> <a href="${getFieldValue(user.view_href)}"> <img src="${user.avatar.profile}" /> </a> </div> <div class="user-role"> <span>${role.name}</span> </div> </div> <div class="user-name-email"> <div class="name">${user.login}</div> </div> </div> </#if> </#list> </#if> </#if> </#list> </#if> </#macro>
Parshant
7 years agoBoss
StanGromer, karthikeyan@ can u share this function as wellexecuteLiQLQuery(msg)?
Related Content
- 10 months ago
- 6 years ago