cancel
Showing results for 
Search instead for 
Did you mean: 

how to run update operation from MBO

Former Member
0 Kudos

I need to update the data from MBO update operation.

but can you guide me for input how to set the personalised key.

Regard

Ali

Accepted Solutions (0)

Answers (2)

Answers (2)

midhun_vp
Active Contributor
0 Kudos

If it is a native app you don't need to map the input of operation with PKs. You can pass the input of the operation from the method itself. Ex. POListMBO.updateOperation("1001"); Where 1001 is the input.

Midhun VP

Former Member
0 Kudos

Dear Midhun

  i am using hybrid app and key_timeSheetid is my personalised key to set the data for update.

and menuItemCallbackTimeSheetMBOCallUpdateQuery method is a custom action with get the data.

the problem is i dnt know how to set the data in personalised key or how to run the update operation.

kindly guide me .   

//   document.getElementById("key_timeSheetid").value = 'helloWorld';

   

//   menuItemCallbackTimeSheetMBOCallUpdateQuery();

  

midhun_vp
Active Contributor
0 Kudos

Can you explain the requirement in detail with the steps you followed.

You have to map PK with the input of operation in the case of Hybrid apps. To call this method from app, create a menuitem with type as online and map the PKs with the data from screen. Or are you trying to map the input from program ?

Midhun VP

Former Member
0 Kudos

referred from image i have a list of approve button in my TimeSheetMBO.

i create list programatically with button and each button has a id when user click on button

$('#key_approve_btn').click(function(){

    

     alert( "value "+$(this).attr('value'));

     menuItemCallbackTimeSheetMBOCallUpdateQuery();   //custom action

}

now from this function i got the ID and want to make input for update operation.


Query:-

update Timesheet set StatusName='from SAp' where TimesheetId=:timeSheetId


midhun_vp
Active Contributor
0 Kudos

You mean to say that you want to pass the "value" as input of the operation menuItemCallbackTimeSheetMBOCallUpdateQuery ?

Midhun VP

Former Member
0 Kudos

yes exactly

midhun_vp
Active Contributor
0 Kudos

You have to set the PKs from program. Follow the below steps:

  • Create a new key on the screen where custom menu item is created. Click on screen > Keys>Add. Ex. key name "CustomKey".
  • From the properties of the menu item created, map the PK with the key created (ie.CustomKey ).
  • Write the below code inside custombeforesubmit method inside custom,js file


hwc.customBeforeSubmit = function(screenKey, actionName, dataMessageToSend) {

     if(screenKey =="Details_Screen" &&      actionName=="menuItemCallbackTimeSheetMBOCallUpdateQuery " ){

       var myNewValue1 = new MessageValue();

       myNewValue1.setKey("CustomKey");

       myNewValue1.setValue(""+value);//Value you got from screen

       myNewValue1.setType("TEXT");

       var mvc = dataMessageToSend.getValues();

       if( mvc ) {

       mvc.add( myNewValue1.getKey(), myNewValue1 );

       }

       }

Midhun VP

Former Member
0 Kudos