cancel
Showing results for 
Search instead for 
Did you mean: 

How to get data from backend in sup hybrid using generated hybrid js api

Former Member
0 Kudos

HI All.

I am trying to fetch data on the basis of primary key using sup hybrid.

Steps done:

1: created MBO

2: Deployed application on the server

3: Generated Hybrid app api

4: created a html file where i tried to get the data from back-end on the basis of primary key

function deleteDepartment() {

var dep = new Department();

dep.dept_id="2";

department_findByPrimaryKey( dep, "" , function(error)

{alert(error)});

}

Method 1:

hwc.processDataMessage = function

processDataMessage(incomingWorkflowMessage, noUI, loading,

fromActivationFlow, dataType) {

alert(incomingWorkflowMessage);

}

Method 2:

hwc.processDataMessage = function

(incomingWorkflowMessage) {

alert(incomingWorkflowMessage);

}

I tried to use both the method(method 1 and method 2), but control is not going to any of the methods.

Please help..

Also if anyone have sample for sup hybrid app using generated hybrid app api. please provide.

Thanks

Accepted Solutions (1)

Accepted Solutions (1)

david_brandow
Contributor
0 Kudos

Have you defined the hwc "namespace"?  If so, how?  If not, try doing it as follows:

    hwc = (typeof hwc === "undefined" || !hwc) ? {} : hwc;            // SUP 'namespace'

before you declare the processDataMessage function.

Answers (2)

Answers (2)

david_brandow
Contributor
0 Kudos

Ankit Garg wrote:

[...] if anyone have sample for sup hybrid app using generated hybrid app api. please provide.

This sample uses the same MBO and same object query you are attempting to use, so it should be perfect for your purposes:

     https://cw.sdn.sap.com/cw/docs/DOC-152686

Former Member
0 Kudos

Hi Ankit,

First thing I would like to know is which version of SUP are you using?

And second thing which I want to put in consideration is: findBy... is an Object Query. It will not hit the back end and get you the data. In case of a HWC it has to be some kind of Online Request.

Regards,

Dharmaraj