Comments (4)
from node-activex.
Hi Yuri,
Thanks for your feedback.
Here is the code:
`function getQB_info() {
require('winax')
const session_manager = new ActiveXObject('QBFC13.QBSessionManager.1');
const ENOpenMode = Object.freeze({ 'omSingleUser': 0, 'omMultiUser': 1, 'omDontCare': 2 })
const appName = "AmazonConnector"
const appId = ''
function doRequestAndGetResult(reqSet) {
var responseMsgSet = session_manager.doRequests(reqSet);
var status = responseMsgSet.ResponseList.GetAt(0);
var statusCode = status.StatusCode;
var statusMessage = status.StatusMessage;
if (statusCode !== 0) {
var message = 'Quickbooks Error: "' + statusMessage + '"'
var err = new Error(message)
err.code = statusCode
throw err
}
return responseMsgSet.ResponseList.GetAt(0).Detail
}
session_manager.OpenConnection(appId, appName)
var result = session_manager.BeginSession('', ENOpenMode.omDontCare)
try {
var requestSet = session_manager.CreateMsgSetRequest("UK", 12, 0)
requestSet.ClearRequests();
var companyQuery = requestSet.AppendCompanyQueryRq()
var companyRet = doRequestAndGetResult(requestSet)
console.log(companyRet.CompanyName.GetValue())
console.log(companyRet.Address.Addr1.GetValue())
// companyRet.Address.Addr2 == null. or 'undefined' / not declared doesn't exist or whatever.
// The following instructions or If hovering on that variable whilst debugging will crash the whole application
if (typeof companyRet.Address.Addr2 !== 'undefined' && companyRet.Address.Addr2 !== null)
console.log(companyRet.Address.Addr2)
if (companyRet.Phone !== null)
console.log(companyRet.Phone.GetValue())
if (companyRet.Email)
console.log(companyRet.Email.GetValue())
if (companyRet.EIN !== null)
console.log(companyRet.EIN.GetValue())
// companyRet.SSN == null. or 'undefined' / not declared doesn't exist or whatever.
// The following instructions or If hovering on that variable whilst debugging will crash the whole application
if (typeof companyRet.SSN !== 'undefined' && companyRet.SSN !== null)
console.log(companyRet.SSN.GetValue())
}
catch (e) {
alert(e)
}
session_manager.EndSession()
session_manager.CloseConnection()
}`
from node-activex.
I`m fixed null pointers in variants, try [email protected]
from node-activex.
Wow! Excellent staff!!!
I have tried and tested. Works wonderfully. So Great!
Many thanks!!!!
from node-activex.
Related Issues (20)
- ActiveX.Object is not a constructor HOT 1
- 没有注册类 HOT 4
- Can't Install winax HOT 2
- Winax not re-installing after changing Visual Studio Versions HOT 1
- Can't get it to work in VSCode extension HOT 1
- v8::HandleScope::CreateHandle() Cannot create a handle without a HandleScope
- https://Android-sdk-is
- Question about "Function Setter" limitation HOT 1
- Type Mismatch Error HOT 1
- Q: How to obtain a running instance of Excel (Marshal.GetActiveObject?) HOT 4
- im getting a error !!
- update docx toc failed in word but succeeded in wps HOT 5
- Can't use node-activex for [email protected] HOT 3
- How to attach to an existing IDispatch pointer HOT 10
- installation fail
- Cannot find module './build/Release/node_avtivex.node' HOT 1
- function cannot be called. HOT 3
- LICENSE file is not found HOT 3
- DispInvoke: XXX Error HOT 1
- When the electron is running,a program crash was encountered. Look at the stack information, which looks like node-activex HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from node-activex.