EnhancedLightningGrid icon indicating copy to clipboard operation
EnhancedLightningGrid copied to clipboard

Adding $User data to a Query not working

Open MDalt opened this issue 6 years ago • 1 comments

Hope this is the right place to post this and apologies if its not. The challenge I am having revolves around querying data based on a current logged in User.

I essentially need data from the login in users record in order to execute the return of the correct records within the data grid.

I have tried $User.xyz , User.xyz , $UserInfo.getxyz , and others but getting "Unable to Query..." in the debug logs.

c.GetSDGInitialLoad response: {"SDGObject":null,"Results":null,"isError":true,"ErrorMessage":"Unable to query: SELECT Name,Billing_Customer__r.Name FROM Service__c WHERE Billing_Customer__c = $User.PartnerUserAccountId__c ORDER BY Id ASC NULLS FIRST limit 100 offset 0"}

MDalt avatar Jun 24 '18 19:06 MDalt

I have actually managed to negate the need for this by using standard sharing rules and OWD's. I have just done a blanket query with SDG.

However, this would solve the issue of complex sharing rules in many ways within communities and the overhead that comes with them.

MDalt avatar Jun 25 '18 12:06 MDalt