This is a migrated thread and some comments may be shown as answers.

Single records from OE table

1 Answer 36 Views
HTML5, CSS, JavaScript
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Tim
Top achievements
Rank 1
Tim asked on 13 May 2016, 09:06 PM

Hi! Back with another question.

Is there a way to extract a single record from an OpenEdge database? What I want it to be able to tell the user when they last created an audit with this app. Here is what I have so far, but it is still not liking it. I know that this would not be the complete code to do this, I'm just not sure where to go or if I'm on the right track.

(function (parent) {
 
var dataProvider = app.data.progressDataProvider;
    dataProvider.loadCatalogs().then(function _catalogsLoaded() {
        var jsdo = new progress.data.JSDO({name: 'Pallet_Audit'});
        jsdo.autoSort = true;
        jsdo.setSortFields( "STAMP_DT:DESC" );
        jsdo.fill();
    });
 
})(app.welcomeView);


1 Answer, 1 is accepted

Sort by
0
Tsvetina
Telerik team
answered on 18 May 2016, 11:48 AM
Hello Tim,

You are on the right track - what you are missing is just some code to handle the callback from the database call.

jsdo.fill().done(function(jsdo, success, request) {
// get the first item
if (success) {
var item = request.response.dsItem.ttItem[0];
// item.STAMP_DT ...
}
}).fail(function() {
//handle error
});

You can read more about handling the fill method callback here:
fill( ) method

If you prefer to, you can also use event handlers to process the data returned by the fill method. Both ways are described in the above document.

Regards,
Tsvetina
Telerik
 

Visit the Telerik Verified Plugins Marketplace and get the custom Cordova plugin you need, already tweaked to work seamlessly with AppBuilder.

 
Tags
HTML5, CSS, JavaScript
Asked by
Tim
Top achievements
Rank 1
Answers by
Tsvetina
Telerik team
Share this question
or