crmFactory.RegisterDemoAccount投げExceptionます。変数を使用するには、変数resを初期化する必要があります。
は初期化できないため、割り当てられていない変数の使用に関するコンパイル エラーを発生させずAccountRegistrationResponseに宣言するにはどうすればよいですか? resnull に割り当てることはできますが、これは良いプログラミング アプローチではないと思います。
AccountRegistrationResponse res /*=null*/;
try
{
res = crmFactory.RegisterDemoAccount(CrmConfigRepository.CrmOwnerUserId
, CrmConfigRepository.CrmOrganizationName
, CrmConfigRepository.CrmBusinessUnitName
, demo.getData());
}
catch (Exception e)
{
_log.Error("Cannot create demo account", e);
}
_log.Debug(res.getString());