You need to sign in to do that
Don't have an account?
MUSFAR KT 6
Can anyone help for writting testclass
public with sharing class InvocableSelectionUpdateWorkAround {
public InvocableSelectionUpdateWorkAround() {
}
/**
* For a given SObject, for each selection field replace it as the String version of itself.
* @param cleanse - The Sobject to cleanse
*/
public void performWorkAround(SObject cleanse) {
DescribeSObjectResult describe = Utils.getSObjectTypeDescribe(cleanse.getSObjectType());
Map<String,Schema.SObjectField> fieldMap = describe.fields.getMap();
for(String fieldName : cleanse.getPopulatedFieldsAsMap().keySet()) {
if(fieldMap.get(fieldName).getDescribe().getType() == Schema.DisplayType.PICKLIST) {
cleanse.put(fieldName, String.valueOf(cleanse.get(fieldName)));
}
}
}
}
public InvocableSelectionUpdateWorkAround() {
}
/**
* For a given SObject, for each selection field replace it as the String version of itself.
* @param cleanse - The Sobject to cleanse
*/
public void performWorkAround(SObject cleanse) {
DescribeSObjectResult describe = Utils.getSObjectTypeDescribe(cleanse.getSObjectType());
Map<String,Schema.SObjectField> fieldMap = describe.fields.getMap();
for(String fieldName : cleanse.getPopulatedFieldsAsMap().keySet()) {
if(fieldMap.get(fieldName).getDescribe().getType() == Schema.DisplayType.PICKLIST) {
cleanse.put(fieldName, String.valueOf(cleanse.get(fieldName)));
}
}
}
}
This class is not able to save in my org due to this.
DescribeSObjectResult describe = Utils.getSObjectTypeDescribe(cleanse.getSObjectType());
What is Utils?