cancel
Showing results for 
Search instead for 
Did you mean: 

Read Context Node In Separate View

Former Member
0 Kudos

Hello,

Within a getter method of my Context Node, I would like to retrieve values within a Context Node of a separate View within the same Component. Does anyone know if this is possible?

Specifically, within the following:

Component: BT111H_OPPT

View: BT111H_OPPT/Details

Context Node: BTOPPORTH

Field:STRUCT.ZZ_AMT_ELIGIBLE (within Getter Method of this field)

I would like to retrieve the following:

Component: BT111H_OPPT

View: BT111H_OPPT/ItemsList

Context Node: BTADMINI

Field:STRUCT.ZZ_MRR_AMT_RENEW

I'll need to retrieve the list of Items, loop through them, and calculate the total ZZMRR_AMT_RENEW, and then display this value in my custom field on the Opportunity header (i.e., ZZ_AMT_ELIGIBLE).

I would think this is possible, however, I'm not sure about the syntax.

Thanks!

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

You can use standard cuco BT111H_OPPT/CUBTTextCOMP.

You can write following code in do_prepare_output of details view. Do the calculation and set the field there only.


lr_cuco_partner ?= get_custom_controller( 'BT111H_OPPT/CUBTTextCOMP').
  if lr_cuco_partner is bound.
  lr_entity_cuco ?=  lr_cuco_partner->TYPED_CONTEXT->BTAdminI->collection_wrapper->get_current( ).
     if lr_entity_cuco is bound.
     
      lv_process_type = lr_entity_cuco->get_property_as_string( 'YOUR_FIELD' ).
     endif.
 endif.

Best Regards

Pankaj Kumar

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

You can use standard cuco BT111H_OPPT/CUBTTextCOMP.

You can write following code in do_prepare_output of details view. Do the calculation and set the field there only.


lr_cuco_partner ?= get_custom_controller( 'BT111H_OPPT/CUBTTextCOMP').
  if lr_cuco_partner is bound.
  lr_entity_cuco ?=  lr_cuco_partner->TYPED_CONTEXT->BTAdminI->collection_wrapper->get_current( ).
     if lr_entity_cuco is bound.
     
      lv_process_type = lr_entity_cuco->get_property_as_string( 'YOUR_FIELD' ).
     endif.
 endif.

Best Regards

Pankaj Kumar