function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

Test Class for Schema.DescribeFieldResult

Am not able to get the field result from Schema.DescribeFieldResult

can any one help me how to get the field result below is my method

public String LabelDataType{get;set;}
    public String FieldObject{get;set;}
public String Label {get;set;}

public PageReference fieldtype(){
    String APIName = getAPIName(FieldObject, Label);
    if(APIName == ' None')return null;

Schema.DescribeFieldResult fieldResult = getFieldResult(FieldObject,APIName);
    if(fieldResult != null){

    return null;   
You haven't posted a couple of key pieces of code - the getAPIName function and the getFieldResult function - without those we're reduced to guessing what apex you've written and whether there are errors in it.