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
MUSFAR KT 6MUSFAR 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)));
            }
        }
    }
}
Suraj Tripathi 47Suraj Tripathi 47

This class is not able to save in my org due to this.

       DescribeSObjectResult describe = Utils.getSObjectTypeDescribe(cleanse.getSObjectType());

What is Utils?

MUSFAR KT 6MUSFAR KT 6
Can you please share your email id