1

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

这是我所拥有的连接代码:

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); 

回答

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

+0

很好谢谢 – Tangfb

相关问题