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
venkateshyadav1243venkateshyadav1243 

Test Class for Schema.DescribeFieldResult

Hi
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);
  System.debug(LabelDataType.toUpperCase()+';;;;'+fieldResult.getType());
    if(fieldResult != null){
                    }
            else{
                        }
        }
    }

    return null;   
  }
bob_buzzardbob_buzzard
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.