cancel
Showing results for 
Search instead for 
Did you mean: 

Calling MBO operations through Custom.js

Former Member
0 Kudos

I want to call mbo's operation through java script .

How to  implement it ?

Accepted Solutions (1)

Accepted Solutions (1)

midhun_vp
Active Contributor
0 Kudos

Solution:

Create a menu item in the screen .Lets say "GetMyList".

As a result a method will be created, menuItemCallbackTest_ScreenGetMyList();

You can find it in the file workflow_jquerymobilelookandfile.html

You need to call this as below in the custom.js file as given below before opening any screen you want.

function customBeforeShowScreen(screenToShow, screenToHide) {

if(screenToHide === "First_Screen" && screenToShow==="Second_Screen") {

                 menuItemCallbackTest_ScreenGetMyList();

                    

                              return true;

                    }

}

You can hide the menu item you created using jquery. If you are on SUP 2.1.3 you can create custom action instead of menu item, no need to write code to hide the menu item then.

--Midhun VP

0 Kudos

Dear Midhun,

          In the file " workflow_jquerymobilelookandfeel.html", the method menuItemCallbackTest_Screen<mbo name>() is not found.

- Supriyo

midhun_vp
Active Contributor
0 Kudos

Supriya, Test_Screen is the screen key and GetMyList is the menu item name. Hope you got it now.

- Midhun VP

Answers (1)

Answers (1)

Dan_vL
Product and Topic Expert
Product and Topic Expert
0 Kudos

Are you using the Eclipse Tooling to develop your Hybrid App?

If so, one way to do this would be to add a custom menu item on a screen that invokes an MBO operation.  On the properties for the menu item, specify the operation to call and perform the parameter mappings.  Then generate the code for the hybrid app.  In the file workflow.js or hybridapp.js(SUP 2.2 SP02), there will be a method added that when called invokes the MBO operation.