You need to sign in to do that
Don't have an account?
Jim Montgomery
Invalid bind expression type of Case for column of type Id
Invalid bind expression type of Case for column of type Id line 9
public class CaseAMSInventory {
Public Case CaseAcct{get;set;}
transient Public List<AMS_Inventory_Rollup__c> CI{get;set;}
public CaseAMSInventory(ApexPages.StandardController controller) {
CaseAcct=[select AccountID from case where ID = :ApexPages.currentPage().getParameters().get('id') ];
CI=[select id,(select id,name,product_name__c,quantity__c, PFX_Account_Number__c from AMS_Inventory_Rollups__r where accountID__c =:CaseAcct ) from Case where ID=:ApexPages.currentPage().getParameters().get('id') ];
// System.Debug('CI: ' + CI.get(0));
//System.Debug('Inventory: ' + CI.get(0).AMS_Inventory_rollups);
}
}
public class CaseAMSInventory {
Public Case CaseAcct{get;set;}
transient Public List<AMS_Inventory_Rollup__c> CI{get;set;}
public CaseAMSInventory(ApexPages.StandardController controller) {
CaseAcct=[select AccountID from case where ID = :ApexPages.currentPage().getParameters().get('id') ];
CI=[select id,(select id,name,product_name__c,quantity__c, PFX_Account_Number__c from AMS_Inventory_Rollups__r where accountID__c =:CaseAcct ) from Case where ID=:ApexPages.currentPage().getParameters().get('id') ];
// System.Debug('CI: ' + CI.get(0));
//System.Debug('Inventory: ' + CI.get(0).AMS_Inventory_rollups);
}
}
public class CaseAMSInventory {
Public Case CaseAcct{get;set;}
transient Public List<AMS_Inventory_Rollup__c> CI{get;set;}
public CaseAMSInventory(ApexPages.StandardController controller) {
CaseAcct=[select AccountID from case where ID = :ApexPages.currentPage().getParameters().get('id') ];
List<case> Caserecord=[select id,(select c.id,c.name,c.product_name__c,c.quantity__c,c.PFX_Account_Number__c from AMS_Inventory_Rollups c) from Case where ID=:ApexPages.currentPage().getParameters().get('id') ]; // use the relationship name for get the child records
if(!CI.isEmpty())
CI.addAll(Caserecord[0].AMS_Inventory_Rollups); //// use the relationship name for get the child records
}
}
if you have any doubt refer this link: https://salesforce.stackexchange.com/questions/103935/accessing-subquery-from-visualforce-page
Can you please Let me know if it helps or not!!!
If it helps don't forget to mark this as a best answer!!!
Thanks,
Raj
All Answers
public class CaseAMSInventory {
Public Case CaseAcct{get;set;}
transient Public List<AMS_Inventory_Rollup__c> CI{get;set;}
public CaseAMSInventory(ApexPages.StandardController controller) {
CaseAcct=[select AccountID from case where ID = :ApexPages.currentPage().getParameters().get('id') ];
List<case> Caserecord=[select id,(select c.id,c.name,c.product_name__c,c.quantity__c,c.PFX_Account_Number__c from AMS_Inventory_Rollups c) from Case where ID=:ApexPages.currentPage().getParameters().get('id') ]; // use the relationship name for get the child records
if(!CI.isEmpty())
CI.addAll(Caserecord[0].AMS_Inventory_Rollups); //// use the relationship name for get the child records
}
}
if you have any doubt refer this link: https://salesforce.stackexchange.com/questions/103935/accessing-subquery-from-visualforce-page
Can you please Let me know if it helps or not!!!
If it helps don't forget to mark this as a best answer!!!
Thanks,
Raj
There is a problem in line 9 where you are trying to query child to Parents record but the query is not written in the correct way.
--
Thanks,
Prashant