从Intuit IPP devkit QBO中的companymetadata检索公司名称

时间:2013-03-30 20:23:03

标签: intuit-partner-platform quickbooks-online

我正在尝试从companymetadata检索公司名称。我有这个不起作用。

    Dim oauthValidator As New OAuthRequestValidator(accessToken, accessTokenSecret, consumerKey, consumerSecret)
    Dim context As New ServiceContext(oauthValidator, apptoken, realmid, IntuitServicesType.QBO)
    Dim commonService As New DataServices(context)
    Dim actualCompanyMetaData As Intuit.Ipp.Data.Qbo.CompanyMetaData = TryCast(commonService.FindById(New Qbo.CompanyMetaData()), Qbo.CompanyMetaData)

    Dim cpnyname As String = actualCompanyMetaData.CompanyFileName.ToString

如何获取公司名称?

2 个答案:

答案 0 :(得分:1)

在QBNRegisteredCompanyName属性中返回:

Intuit.Ipp.Data.Qbo.CompanyMetaData actualCompanyMetaData =commonService.FindById(new Intuit.Ipp.Data.Qbo.CompanyMetaData();
string cpnyname = actualCompanyMetaData.QBNRegisteredCompanyName;

http://docs.developer.intuit.com/0025_Intuit_Anywhere/0050_Data_Services/v2/0400_QuickBooks_Online/CompanyMetaData

答案 1 :(得分:0)

在QBO v3中

var dataService = new DataService(context);
var company = dataService.FindById(new Company { Id = oauthAccessToken.RealmId});
return company.CompanyName;

https://developer.intuit.com/apiexplorer?apiname=V3QBO