You need to sign in to do that
Don't have an account?
aaryansri
Test class for webservices
Hi ,
I need to write test class for webservice code can some body help on that below is the class code and purpose of the class
Class used to get component record ID to be used in custom buttons without hardcode.
Global without sharing class GetComponentId{
WebService static string GetIDbyComponentName(String ComponentName, String ComponentType) {
if(ComponentType == 'Report'){
String ComponentId = [SELECT Id FROM Report WHERE DeveloperName = :ComponentName LIMIT 1].Id;
return ComponentId;
}else
{ String ComponentId = 'error';
return ComponentId; }}}
I need to write test class for webservice code can some body help on that below is the class code and purpose of the class
Class used to get component record ID to be used in custom buttons without hardcode.
Global without sharing class GetComponentId{
WebService static string GetIDbyComponentName(String ComponentName, String ComponentType) {
if(ComponentType == 'Report'){
String ComponentId = [SELECT Id FROM Report WHERE DeveloperName = :ComponentName LIMIT 1].Id;
return ComponentId;
}else
{ String ComponentId = 'error';
return ComponentId; }}}
Ankit Arora
This is just to get you started, I hope you can take care of rest.