protected override void ExecuteBrowser() { var record = _crmContext.RecordCache.Get(_alias, true); var close = OpportunityCloseHelper.Create(_crmContext, _closeData, record); var browser = _seleniumContext.GetBrowser(); var formData = browser.OpenRecord(new OpenFormOptions(record)); var dialog = OpportunityCloseDialog.CreateDialog(browser.App, formData, close.Win); dialog.EnterData(_crmContext, _closeData); dialog.FinishDialog(record); }
protected override void ExecuteApi() { var record = _crmContext.RecordCache.Get(_alias, true); var close = OpportunityCloseHelper.Create(_crmContext, _closeData, record); var request = close.Win ? new WinOpportunityRequest() as OrganizationRequest : new LoseOpportunityRequest(); request.Parameters["OpportunityClose"] = close.Entity; request.Parameters["Status"] = new OptionSetValue(close.StatusReasonNumber); GlobalTestingContext.ConnectionManager.CurrentConnection.Execute <OrganizationResponse>(request); }