Some questions on displaying on what I can show in querying the Process.
1 - I am running into limitations on pulling in more fields in my query.
public List<ProcessInstanceStep> getSteps() {
return [select StepStatus, ProcessInstance.targetObject.name from ProcessInstanceStep where ProcessInstance.TargetObjectId = :T.id ];
}
The above successfully returns the name of the object under approval, but that isn't that helpful, since it's an auto number.
Trying to pull any other field provides errors. Example:
return [select StepStatus, ProcessInstance.targetObject.Field__C from ProcessInstanceStep where ProcessInstance.TargetObjectId = :T.id ];
Brings error:
No such column 'Field__c' on entity 'Name'. If you are attempting to use a custom field, be sure to append the '__c' after the custom field name. Please reference your WSDL or the describe call for the appropriate names.
Why is it referencing entity Name ? Have I reached the limit in relation query? thanks
- I am having a error trying to query on a field on the initial object
SObject row was retrieved via SOQL without querying the requested field: Custom_Object__c.Look_up__c
I want to query on an ID in a lookup field on the object. The below does not allow me to query on a custom field on T but I think illustrates what I want to do:
Custom_Object__c T;
public ID TID {get; set; }
public TravelerApprovalExtension(ApexPages.StandardController controller) {
T = (Custom_object__C) controller.getRecord();
TID = t.Look_up__c;
}
So I can use TID here:
public List<Look_up__c> getLups() {
return [select name, ID, start_date__c, end_date__c , location__C from Look_up__c where ID = :TID ];
}
How can I efficiently get a field as a variable on the record to use as a query parameter? thanks! Also, more generally - on a getRecord(), does one return the ID, or the (whole) record? Can't quite understand why I can't use this in my instance if I actually got the record and not just the ID-
T = (Custom_object__C) controller.getRecord();
TID = t.Look_up__c;