You need to sign in to do that
Don't have an account?
jblon1973
Invalid bind expression type of Schema.SObjectField for column of type Id
I am getting the named error on the following code. I am not sure what I am missing.
The structure is that the Trial__c is the parent of Trial_Data__c and I am simply trying to query all the Trial Data related to one trial.
Here is my Code:
for(Trial_Data__c td : [Select Id, Channel_Volume__c, Channel_Flow__c, Trial__c From Trial_Data__c WHERE Trial__c =: Trial__c.Id ORDER BY Id ASC]) { GoogleViz.row r = new GoogleViz.row(); r.cells.add ( new GoogleViz.cell( interval));//interval r.cells.add ( new GoogleViz.cell( td.Channel_Volume__c));//X-Axis gv.addRow( r ); interval = interval + .01; }
The error is on the first row query. I need to make sure I am not pulling ALL Trial_Data__c records to display.
Thank you for any help you can provide.
strTrial = ApexPages.currentPage().getParameters().get('Id');
All Answers
[Select Id, Channel_Volume__c, Channel_Flow__c, Trial__c From Trial_Data__c WHERE Trial__c =: Trial__c.Id ORDER BY Id]
or
[Select Id, Channel_Volume__c, Channel_Flow__c, Trial__c From Trial_Data__c WHERE Trial__c =: Trial__c.Id ]
The error is in the select statement.
Unfortunately, the queries produce the same error.
Select Id, Channel_Volume__c, Channel_Flow__c, Trial__c From Trial_Data__c WHERE Trial__c =: Trial__c.Id ORDER BY Id ASC
use some variable to store the Trial__c.Id value and use it in query.
example:
String x = Trial__c.Id ;
then in query use it :
Select Id, Channel_Volume__c, Channel_Flow__c, Trial__c From Trial_Data__c WHERE Trial__c =:x ORDER BY Id ASC
That produces the error of:
Illegal Assignment from Schema.SObjectField to String.
Here is the complete code and it is on line 19
Yes I am. It displays a Visualization
If your page is getting any id then it might work:
That gives me unexpected token ";" on line 2
public string strTrial;
Now I am getting this error:
Method does not exist or incorrect signature: ApexPages.currentPage.getParameter()TestResultGraphConroller.cls/TechEd Production/src/classesline 5
strTrial = ApexPages.currentPage().getParameters().get('Id');
Thank you so much. It works!!!!
JP
I thing you using Schema.SObjectField to query the relatioship object.So it will throw an error