cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Whenever I use a custom action, it opens a new object page after performing the action

sahu10114
Explorer
0 Kudos
4,217

I have a custom action which changes the status of a line item. Pressing the button for the custom action successfully changes the status but then it opens a blank object page (uuid full of 0s) in read only mode. How do I avoid this problem?

following is the custom action metadata extension.

@UI.lineItem: [ {
    position: 10 ,
    importance: #MEDIUM,
    label: 'Invno'
  },{ 
    type : #FOR_ACTION,
    dataAction: 'setInvnoAction',
    label: 'Set Invno.'
  } ]

Behavior implementation

METHOD setinvnoaction.

    MODIFY ENTITIES OF zr_10_inv_tab IN LOCAL MODE
      ENTITY zr_10_inv_tab
      UPDATE FIELDS ( status )
      WITH VALUE #( FOR key IN keys
                       ( %tky = key-%tky %cid_ref = key-%cid_ref status = 'X' 
    ) ).
ENDMETHOD.

Behavior definition

action setInvnoAction result[1] $self;

  

Accepted Solutions (0)

Answers (1)

Answers (1)

Dinu
Active Contributor

You have to either declare the action to not return a result or fill results if you have declared that it will return results. See the RAP tutorial for custom actions for how to fill result with the instance the action is acting on.

sahu10114
Explorer
0 Kudos
I tried filling the result structure as per the article but that didn't solve the problem.
Dinu
Active Contributor
0 Kudos
If "it opens a blank object page (uuid full of 0s)", it is definite that the result is not filled by the implementation.
das_shubhashish
Explorer
0 Kudos
debug and check if result struc is getting filled or not. its high chance that %param structue was not filling.