You need to sign in to do that
Don't have an account?
Trying to put a subquery list in a page block but returning error
Hi,
Getting this extremely annoying issue.
Here is my query:
assets = [SELECT Id, Name, External_Reference__c, Serial_Number__c, UsageEndDate, (SELECT Id, Name, AssetId FROM Entitlements) FROM Asset WHERE Serial_Number__c IN : serialIds ORDER BY UsageEndDate Desc];
I have a nested page block where I want to iterate through the child Entitlements, but I continously get this error:
System.SObjectException: SObject row was retrieved via SOQL without querying the requested field: Asset.Entitlements
I can't find any security that is prohibiting me from viewing this list.
Any ideas?
yup,
And it returns the subquery list filled with Entitlements.
And does your profile have read rights to entitlements?
I'm running as Sys Admin and have full Crud Permission set and no FLS is set on Entitlements.
That query runs on a search command button click, and I get that error as soon as I perform the search.
I tried the following soql below in execute anonymous and it works fine for me:
List <Asset> a = [select id, Name, (Select Id, Name from Entitlements) from Asset];
system.debug('list my assets ======' +a);
Can you try copy and pasting your code block for the query?