/// <summary> /// Remove the item implied by this sync state from CRM. /// </summary> /// <param name="state">A sync state wrapping an item which has been deleted or marked private in Outlook.</param> protected virtual void RemoveFromCrm(SyncState state) { if (SyncDirection.AllowOutbound(Direction)) { var crmEntryId = state.CrmEntryId; if (state.ExistedInCrm && this.permissionsCache.HasImportAccess(state.CrmType)) { eNameValue[] data = new eNameValue[2]; data[0] = clsSuiteCRMHelper.SetNameValuePair("id", crmEntryId); data[1] = clsSuiteCRMHelper.SetNameValuePair("deleted", "1"); clsSuiteCRMHelper.SetEntryUnsafe(data, state.CrmType); } state.RemoveCrmLink(); } }
protected void RemoveFromCrm(SyncState state) { if (!SyncingEnabled) { return; } var crmEntryId = state.CrmEntryId; if (!string.IsNullOrEmpty(crmEntryId) && this.HasImportAccess(state.CrmType)) { eNameValue[] data = new eNameValue[2]; data[0] = clsSuiteCRMHelper.SetNameValuePair("id", crmEntryId); data[1] = clsSuiteCRMHelper.SetNameValuePair("deleted", "1"); clsSuiteCRMHelper.SetEntryUnsafe(data, state.CrmType); } state.RemoveCrmLink(); }