public void UpdateTradeRegistration(String accountId) { PDH_CrmService.CrmInterface.AccountOperation accountOp = new PDH_CrmService.CrmInterface.AccountOperation(); UpdateTradeRegistrationResponse response = accountOp.UpdateTradeRegistration(accountId); //return response; }
public UpdateTradeRegistrationResponse UpdateTradeRegistration(String accountId) { log.Info("CMS-->Approved:" + accountId); UpdateTradeRegistrationResponse response = new UpdateTradeRegistrationResponse(); CrmUtil cu = new CrmUtil(); OrganizationServiceProxy organizationProxy = cu.getCrmService(); try { //Update Account TradeRegistration //Entity account = new Entity("account"); //ColumnSet attributes = new ColumnSet(new string[] { "new_check" }); //account = organizationProxy.Retrieve(account.LogicalName, new Guid(accountId), attributes); //log.Info("Retrieved new_check: " + account["new_check"]); Entity account = RetriveAccountByEmail(organizationProxy, accountId); OptionSetValue register = new OptionSetValue(1); //account.Attributes.Add("new_check", register); account["new_check"] = true; organizationProxy.Update(account); response.ErrCode = "0"; return(response); } catch (Exception ex) { log.Info(ex.Message + "--" + ex.ToString()); } return(null); }