Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Can you try the sample.js script that I just updated from here:</p> <p><a href="https://github.com/versionone/VersionOne.SDK.JavaScript/blob/master/sample.js" rel="nofollow">https://github.com/versionone/VersionOne.SDK.JavaScript/blob/master/sample.js</a> </p> <p>It pulls in the two modules like this:</p> <pre><code>var V1Meta = require('./v1meta').V1Meta; var V1Server = require('./client').V1Server; var hostname = "www14.v1host.com"; var instance = "v1sdktesting"; var username = "api"; var password = "api"; var port = "443"; var protocol = "https"; var server = new V1Server(hostname, instance, username, password, port, protocol); var v1 = new V1Meta(server); v1.query({ from: "Member", where: { IsSelf: 'true' }, select: ['Email', 'Username', 'ID'], success: function(result) { console.log(result.Email); console.log(result.Username); console.log(result.ID); }, error: function(err) { // NOTE: this is not working correctly yet, not called... console.log(err); } }); </code></pre> <p>You might have to get the latest and build the JS from CoffeeScript.</p> <p>I think I was trying out "browserify" last year and that's how the "v1sdk.js" file got generated. But I'm not sure if that's the best approach if you're using node. It's probably better just to do it the way the sample.js file is doing it.</p> <p>However, I did also check in a change to v1sdk.coffee which property exports the two other modules, just as a convenience. With that, you can look at sample2.js. The only different part there is this, which is more like you were trying to do with your example:</p> <pre><code>var v1sdk = require('./v1sdk'); var hostname = "www14.v1host.com"; var instance = "v1sdktesting"; var username = "api"; var password = "api"; var port = "443"; var protocol = "https"; var server = new v1sdk.V1Server(hostname, instance, username, password, port, protocol); var v1 = new v1sdk.V1Meta(server); </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload