1

我已将三个客户项目在线插入 QuickBooks。我想通过 id 找到一个特殊项目并修改其中一个属性的值。我想通过在应用程序的后台编码来实现这一点。我怎样才能做到这一点?

这是我拥有的连接代码:

realmId = HttpContext.Current.Session["realm"].ToString();
accessToken = HttpContext.Current.Session["accessToken"].ToString();
accessTokenSecret = HttpContext.Current.Session["accessTokenSecret"].ToString();
consumerKey = ConfigurationManager.AppSettings["consumerKey"].ToString(CultureInfo.InvariantCulture);
consumerSecret = ConfigurationManager.AppSettings["consumerSecret"];
dataSourcetype = IntuitServicesType.QBO;
OAuthRequestValidator oauthValidator = new OAuthRequestValidator(accessToken, accessTokenSecret, consumerKey, consumerSecret);
ServiceContext context = new ServiceContext(oauthValidator, realmId, dataSourcetype);
DataServices commonService = new DataServices(context);
4

1 回答 1

0

您可以通过以下方式查询客户:

//search based on customer name
var qbdCustomerQuery1 = new Intuit.Ipp.Data.Qbd.CustomerQuery();
qbdCustomerQuery1.Item1ElementName = Intuit.Ipp.Data.Qbd.Item1ChoiceType.FirstLastInside; //Item1ChoiceType.FirstLastEnd   //Item1ChoiceType.FirstLastStart
qbdCustomerQuery1.Item1 = "Popeye";
List<Intuit.Ipp.Data.Qbd.Customer> CustomerQueryResult = qbdCustomerQuery1.ExecuteQuery<Intuit.Ipp.Data.Qbd.Customer>(context).ToList<Intuit.Ipp.Data.Qbd.Customer>();

//search based on customer id

 Intuit.Ipp.Data.Qbo.Customer qboCustomer = new Intuit.Ipp.Data.Qbo.Customer();
 qboCustomer.Id = new IdType() { idDomain = Intuit.Ipp.Data.Qbo.idDomainEnum.QBO, Value = "3" };
 IEnumerable<Intuit.Ipp.Data.Qbo.Customer> qboCustomerResults = commonService.FindById(qboCustomer) as IEnumerable<Intuit.Ipp.Data.Qbo.Customer>;

使用结果集获取客户对象。修改值并调用更新: https ://developer.intuit.com/docs/0025_quickbooksapi/0055_devkits/0100_ipp_.net_devkit/0299_synchronous_calls/0001_data_service_apis

于 2013-09-12T11:15:26.030 回答