cancel
Showing results for 
Search instead for 
Did you mean: 

Exception while getting the drop down value on an Event

Former Member
0 Kudos

Hi Gurus,

I am getting an exception on the IC Web Client.

My requirement is to manipulate a text box value on change of the drop down field. I have create an event handler method. And was trying to fetch the drop down list value by using the entity reference object and get_property method. Below is the code in event handler.

   lo_lcstatus_entity = me->typed_context->btadminh->collection_wrapper->get_current( ).

   IF lo_lcstatus_entity IS BOUND.

     lv_lcstatus  = lo_lcstatus_entity->get_property_as_string( iv_attr_name = 'LCSTATUS' ).

   ENDIF.

But, I wonder, its returning null value and throwing run time exception.  Below are are the details with screen shots.

1. Drop down on IC Service request screen. If the status drop down value is changed, then I have to change a text box value with the new value.

2. Technical Details:

3. Exception

4. tried to Debug the root cause. But its shows that ATTRIBUTE_REF value is coming as Initial.

If the BTAdminH attribute_ref is initial, then how the drop down values are  getting populated. LCSTATUS attribute is part of the BTADMINH context node.

Please advice.

Thanks,

Kiran Vemula.

Accepted Solutions (1)

Accepted Solutions (1)

former_member202474
Contributor
0 Kudos

Hi Kiran,

               LCSTATUS though it appears under the context node BTADMINH, is not part of this entity, it is nothing but the status field which is fetched from the relationship entity of BTADMINH.

Try this code:

entity must be the BTADMINH entity

        entity ?= current.

      coll = entity->get_related_entities(

               iv_relation_name = 'BTHeaderStatusSet' ).    "#EC NOTEXT
      current = coll->get_current( ).
      if current is not bound.
        return.
      endif.

      entity ?= current.
      coll = entity->get_related_entities(
               iv_relation_name = 'BTStatusHCurrent' ).     "#EC NOTEXT
      current = coll->get_current( ).
      if current is not bound.
        return.
      endif.

      try.
          dref = current->get_property( 'ACT_STATUS' ).     "#EC NOTEXT
        catch cx_crm_cic_parameter_error.
      endtry.

ACT_STATUS is the actual field, same code you can find in the GET_LCSTATUS method.

Hope this helps you. Please reward if it solves .

Regards,

Ruby.

former_member182421
Active Contributor
0 Kudos

Hi,

Agree with Ruby, But I would prefer to reuse the context node instead of recodign the getter or the setter in your event handler

Like me->typed_context->btadminh->get_LCSTATUS

Cheers!

Luis

Former Member
0 Kudos

Thanks  a lot Ruby.  It worked.

Regards,

Kiran Vemula.

Answers (0)