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
Darshee MehtaDarshee Mehta 

Test class for a webservice

Hi, I would need some help to write a test class for a webservice
Here WCT_LCA__c is my custom object.

global class WCT_UpdateLCARecordsFlags {
    WebService static String updateFlags(String recordId)
        WCT_LCA__c rec;
            rec=new WCT_LCA__c(id=recordId);
            update rec;
        }Catch(Exception e)
        return 'Thanks for reviewing the LCA record.';

Hi Darshee,

I'd suggest you should start writing the webservice test class looking at the examples available in the following links:

If you face any issues with the code, please post here and the community will be able to help you better.
Darshee MehtaDarshee Mehta
Thank you Sonam