You need to sign in to do that
Don't have an account?
Geetu
Wizard test class - Need help
can somebody help me how to write test class for below class
global class WizardCallBack_CLM implements Apttus.WizardCustomClass.IDataSourceCallback{
/*
Description :- Accepts Account Id,Record Type Id,Parent Id and Account Name to autopopulate as parameter and sends the JSON response to be used in Wizard
Input :- Wizard ID, Map of parameters passed in URL
Output :- JSON response using class WizardCallbackResponse_CLM
*/
global String getData(String wizardId,Map<String,String> inputParameters){
String accountId=inputParameters.get('accountId');
String recordTypeId = inputParameters.get('recordTypeId');
String accountName=inputParameters.get('accountName');
String parentId = inputParameters.get('parentId');
String oemNames = inputParameters.get('oemNames').replace(';,',';');
System.debug('>>>>>>>> accountName '+accountName);
System.debug('>>>>>>>> parentId '+parentId);
WizardCallbackResponse_CLM.WizardCallbackData data = new WizardCallbackResponse_CLM.WizardCallbackData();
List<Apttus__WizardInputControl2__c> inputControlsList = [SELECT Apttus__Question__c,Apttus__WizardStepId__c FROM Apttus__WizardInputControl2__c where Apttus__WizardStepId__c in (SELECT id FROM Apttus__WizardStep2__c where Apttus__WizardDesignId__c =: Label.CPG)];
List<WizardCallbackResponse_CLM.UserResponses> userResponseList= new List<WizardCallbackResponse_CLM.UserResponses>();
System.debug('>>>>>>>>List'+inputControlsList);
for(Apttus__WizardInputControl2__c inputObj :inputControlsList){
System.debug('>>>>>>>>question'+inputObj.Apttus__Question__c);
if(accountName!=null && inputObj.Apttus__Question__c == 'What is the legal name of the dealer?')
{
System.debug('>>>>>>Inside If');
WizardCallbackResponse_CLM.UserResponses userResponse = new WizardCallbackResponse_CLM.UserResponses();
userResponse.Question = 'What is the company name?';
userResponse.inputRepeatSequence = 0;
userResponse.inputControlId = inputObj.id;
userResponse.Answer=accountName;
userResponseList.add(userResponse);
}
}
}
data.UserResponses = userResponseList;
data.Parameters = null;
return JSON.serialize(data);
}
}
global class WizardCallBack_CLM implements Apttus.WizardCustomClass.IDataSourceCallback{
/*
Description :- Accepts Account Id,Record Type Id,Parent Id and Account Name to autopopulate as parameter and sends the JSON response to be used in Wizard
Input :- Wizard ID, Map of parameters passed in URL
Output :- JSON response using class WizardCallbackResponse_CLM
*/
global String getData(String wizardId,Map<String,String> inputParameters){
String accountId=inputParameters.get('accountId');
String recordTypeId = inputParameters.get('recordTypeId');
String accountName=inputParameters.get('accountName');
String parentId = inputParameters.get('parentId');
String oemNames = inputParameters.get('oemNames').replace(';,',';');
System.debug('>>>>>>>> accountName '+accountName);
System.debug('>>>>>>>> parentId '+parentId);
WizardCallbackResponse_CLM.WizardCallbackData data = new WizardCallbackResponse_CLM.WizardCallbackData();
List<Apttus__WizardInputControl2__c> inputControlsList = [SELECT Apttus__Question__c,Apttus__WizardStepId__c FROM Apttus__WizardInputControl2__c where Apttus__WizardStepId__c in (SELECT id FROM Apttus__WizardStep2__c where Apttus__WizardDesignId__c =: Label.CPG)];
List<WizardCallbackResponse_CLM.UserResponses> userResponseList= new List<WizardCallbackResponse_CLM.UserResponses>();
System.debug('>>>>>>>>List'+inputControlsList);
for(Apttus__WizardInputControl2__c inputObj :inputControlsList){
System.debug('>>>>>>>>question'+inputObj.Apttus__Question__c);
if(accountName!=null && inputObj.Apttus__Question__c == 'What is the legal name of the dealer?')
{
System.debug('>>>>>>Inside If');
WizardCallbackResponse_CLM.UserResponses userResponse = new WizardCallbackResponse_CLM.UserResponses();
userResponse.Question = 'What is the company name?';
userResponse.inputRepeatSequence = 0;
userResponse.inputControlId = inputObj.id;
userResponse.Answer=accountName;
userResponseList.add(userResponse);
}
}
}
data.UserResponses = userResponseList;
data.Parameters = null;
return JSON.serialize(data);
}
}
s
All Answers
s
I have a similar requirement for Apttus wizard,
can you please send the complete code involved in this requirement including classes like WizardCallbackResponse_CLM.
If possible please provide your contact details.
Thanks!