/// <summary> /// Constructor /// </summary> public CrmSoapService() { // Get Setting SettingsHelper _settings = SettingsService.Instance; // Instantiate proxy _proxy = new OrganizationDataWebServiceProxy(); _proxy.ServiceUrl = _settings.ServerUrl; }
async private void GetAccounts(string accessToken) { OrganizationDataWebServiceProxy orgService = new OrganizationDataWebServiceProxy { ServiceUrl = CrmUrl, AccessToken = accessToken }; //Get "Sample" Accounts - make this more meaningful & add paging QueryExpression query = new QueryExpression { EntityName = "account", ColumnSet = new ColumnSet("name", "address1_latitude", "address1_longitude"), TopCount = 10, Orders = new DataCollection <OrderExpression> { new OrderExpression { AttributeName = "name", OrderType = OrderType.Descending } }, Criteria = new FilterExpression { Conditions = { new ConditionExpression { EntityName = "account", AttributeName = "name", Operator = ConditionOperator.Like, Values = { "%sample%" } } } } }; EntityCollection response = await orgService.RetrieveMultiple(query); foreach (Entity account in response.Entities) { _dataSource.Objects.Insert(0, account); using (var indexPath = NSIndexPath.FromRowSection(0, 0)) TableView.InsertRows(new[] { indexPath }, UITableViewRowAnimation.Automatic); } }
async partial void SetLatLong(UIBarButtonItem sender) { OrganizationDataWebServiceProxy orgService = new OrganizationDataWebServiceProxy { ServiceUrl = MasterViewController.CrmUrl, AccessToken = NSUserDefaults.StandardUserDefaults.StringForKey("AccessToken") }; Entity account = (Entity)_detailItem; account["address1_latitude"] = _iPhoneLocationManager.Location.Coordinate.Latitude; account["address1_longitude"] = _iPhoneLocationManager.Location.Coordinate.Longitude; AccountLatitude.Text = _iPhoneLocationManager.Location.Coordinate.Latitude.ToString(CultureInfo.InvariantCulture); AccountLongitude.Text = _iPhoneLocationManager.Location.Coordinate.Longitude.ToString(CultureInfo.InvariantCulture); await orgService.Update(account); }
static CRMHelper() { proxy = new OrganizationDataWebServiceProxy(); proxy.ServiceUrl = ServerUrl; proxy.EnableProxyTypes(); }
async private void GetAccounts(string accessToken) { OrganizationDataWebServiceProxy orgService = new OrganizationDataWebServiceProxy { ServiceUrl = CrmUrl, AccessToken = accessToken }; //Get "Sample" Accounts - make this more meaningful & add paging QueryExpression query = new QueryExpression { EntityName = "account", ColumnSet = new ColumnSet("name", "address1_latitude", "address1_longitude"), TopCount = 10, Orders = new DataCollection<OrderExpression> { new OrderExpression { AttributeName = "name", OrderType = OrderType.Descending } }, Criteria = new FilterExpression { Conditions = { new ConditionExpression { EntityName = "account", AttributeName = "name", Operator = ConditionOperator.Like, Values = {"%sample%"} } } } }; EntityCollection response = await orgService.RetrieveMultiple(query); foreach (Entity account in response.Entities) { _dataSource.Objects.Insert(0, account); using (var indexPath = NSIndexPath.FromRowSection(0, 0)) TableView.InsertRows(new[] { indexPath }, UITableViewRowAnimation.Automatic); } }
public CRMContext() { proxy = new OrganizationDataWebServiceProxy(); proxy.ServiceUrl = ServerUrl; }