You need to sign in to do that
Don't have an account?
![Darshee Mehta Darshee Mehta](https://dfc-org-production.my.site.com/img/userprofile/default_profile_45_v2.png)
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)
{
system.debug(recordId);
WCT_LCA__c rec;
try{
rec=new WCT_LCA__c(id=recordId);
rec.WCT_Updated_Fragomen_record__c=false;
update rec;
}Catch(Exception e)
{
}
return 'Thanks for reviewing the LCA record.';
}
}
Here WCT_LCA__c is my custom object.
global class WCT_UpdateLCARecordsFlags {
WebService static String updateFlags(String recordId)
{
system.debug(recordId);
WCT_LCA__c rec;
try{
rec=new WCT_LCA__c(id=recordId);
rec.WCT_Updated_Fragomen_record__c=false;
update rec;
}Catch(Exception e)
{
}
return 'Thanks for reviewing the LCA record.';
}
}
I'd suggest you should start writing the webservice test class looking at the examples available in the following links:
http://salesforce.stackexchange.com/questions/22735/custom-webservice-test-class
http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_callouts_wsdl2apex_testing.htm
If you face any issues with the code, please post here and the community will be able to help you better.