我正在尝试将数据提交到服务器,并在服务器中挑选并存储在 salesforce 中。我得到的错误是服务器上的“尝试取消引用空对象”。所以我想知道问题是什么......下面是示例代码:
public static List<String> processAgentVisitSurvey(ProcessSurveySubmission.SurveySubmission submission, Map<String, Submission_Answer__c> answers, Person__c person) {
// Load the TDR
TDR__c tdr = loadTdr(person);
if (tdr == null) {
//Send an email saying that an unregistered person is trying to act a TDR
// Send back the error message
return new String[] { '0', 'User with handset Id ' + submission.imei + ' is not a TDR', 'SUPRESSMSG' };
}
这是错误消息的来源。
有一个类重定向到此方法:
private static List<String> additionalProcessing(
SurveySubmission surveySubmission,
Survey__c survey,
Person__c interviewer,
Id intervieweeId
) {
List<String> returnValues = new List<String>();
Map<String, Submission_Answer__c> answers = parseSubmissionToMap(surveySubmission);
// Find the name of the method that this survey hooks into to do its post processing
try {
if (survey.Post_Processing_Method__c.equalsIgnoreCase('None')) {
returnValues.add('0');
returnValues.add('There is no post processing method specified for this survey');
returnValues.add('SUPRESSMSG');
}
else if (survey.Post_Processing_Method__c.equals('CKW_Registration')) {
return CkwRegistration.processCkwRegistration(answers, interviewer);
}
else if (survey.Post_Processing_Method__c.equals('CKW_Baseline')) {
return CkwRegistration.processCkwBaseline(answers, interviewer);
}
else if (survey.Post_Processing_Method__c.equals('CKW_Staff_Update')) {
return CkwRegistration.processCkwUpdate(answers, interviewer);
}
else if (survey.Post_Processing_Method__c.equals('Subcounty_Registration')) {
return CkwRegistration.processSubcounties(answers, interviewer);
}
else if (survey.Post_Processing_Method__c.equals('TDR_AGENT_VISIT')) {
return TdrHelpers.processAgentVisitSurvey(surveySubmission, answers, interviewer);
}
else if (survey.Post_Processing_Method__c.equals('UDOM_RAIN_GUAGE')) {
return UDoMSurveyProcessing.processDailyRainGauge(surveySubmission, answers, interviewer);
}
else if (survey.Post_Processing_Method__c.equals('UDOM_RAIN_GUAGE_REG')) {
return UDoMSurveyProcessing.registerRainGauge(surveySubmission, answers, interviewer);
}
else if (survey.Post_Processing_Method__c.equals('MTN_CHANNELS')) {
return MtnChannelsHelpers.processChannelsFFPSSurvey(surveySubmission, answers, interviewer);
}
else if (survey.Post_Processing_Method__c.equals('FHI_GROUP_REGISTRATION')) {
return FHISurveysHelpers.processGroupRegistration(surveySubmission, answers, interviewer, survey.Survey_Name__c);
}
else if (survey.Post_Processing_Method__c.equals('FHI_HOUSEHOLD_REGISTRATION')) {
return FHISurveysHelpers.processHouseholdRegistration(surveySubmission, answers, interviewer, survey.Survey_Name__c);
}
// else if (survey.Post_Processing_Method__c.equals('Colombia_Farmer_Registration')) {
// return ColombiaFarmerRegistrationPostProcessor.processSubmission(surveySubmission, answers, interviewer);
// }
else if (survey.Post_Processing_Method__c.equals('FIELD_OFFICER_SUPPORT')) {
return FieldOfficeHelpers.processFoSurvey(surveySubmission, answers, interviewer);
}
// else if (survey.Post_Processing_Method__c.equals('DATA_VALIDATOR_SPOT_CHECK')) {
// return DataValidatorHelpers.processSpotCheck(surveySubmission, answers, interviewer);
// }
// else if (survey.Post_Processing_Method__c.equals('DATA_VALIDATOR_BACK_CHECK')) {
// return DataValidatorHelpers.processBackCheck(surveySubmission, answers, interviewer);
// }
else if (survey.Post_Processing_Method__c.equals('EQUIPMENT_TRACKING')) {
return EquipmentTrackingHelpers.processFieldOfficerSubmission(surveySubmission, answers, interviewer);
}
}
catch (Exception e) {
returnValues.add('0');
returnValues.add(e.getMessage());
returnValues.add('An error occured. Please contact support');
}
return returnValues;
}
我认为这很好......
请帮助因为我似乎没有看到任何问题 谢谢。我希望提供的代码就足够了。