我正在尝试从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
如何获取公司名称?
答案 0 :(得分:1)
在QBNRegisteredCompanyName属性中返回:
Intuit.Ipp.Data.Qbo.CompanyMetaData actualCompanyMetaData =commonService.FindById(new Intuit.Ipp.Data.Qbo.CompanyMetaData();
string cpnyname = actualCompanyMetaData.QBNRegisteredCompanyName;
答案 1 :(得分:0)
在QBO v3中
var dataService = new DataService(context);
var company = dataService.FindById(new Company { Id = oauthAccessToken.RealmId});
return company.CompanyName;