I am writing a SObject generating class for unit test. Here is my code:
public class Uth_Integration_Obj extends Uth_Sobject
{
public String status;
public String sf_id;
public String sobject_type;
public Uth_Integration_Obj(String id)
{
//Default values only
status = Integration_Status.OUTPENDING;
sobject_type = Sobject_Type.FOLDER; //This line caused the error.
sf_id = id;
}
//...
And the Sobject_Type file is a fairly simple one:
public class Sobject_Type
{
public final static String FOLDER = 'Folder__c';
public final static String LISTOBJ = 'List__c';
}
I am getting the error during compilation:
Compile Error for Uth_Integration_Obj.cls: Initial term of field expression must be a concrete SObject: String at line 12 column 21
Line 12 is marked in the comment.
If I change Sobject_Type.FOLDER into 'folder__c' it will cause no issue at all. But basically they should be the same thing. I have no idea what is the issue here. Any explanation?