Skip to content

/AWS1/IF_CNK=>UPDATERELATEDITEM()

About UpdateRelatedItem

Updates the content of a related item associated with a case. The following related item types are supported:

  • Comment - Update the text content of an existing comment

  • Custom - Update the fields of a custom related item. You can add, modify, and remove fields from a custom related item. There's a quota for the number of fields allowed in a Custom type related item. See Amazon Connect Cases quotas.

Important things to know

  • When updating a Custom related item, all existing and new fields, and their associated values should be included in the request. Fields not included as part of this request will be removed.

  • If you provide a value for performedBy.userArn you must also have DescribeUser permission on the ARN of the user that you provide.

  • System case fields cannot be used in a custom related item.

Endpoints: See Amazon Connect endpoints and quotas.

Method Signature

METHODS /AWS1/IF_CNK~UPDATERELATEDITEM
  IMPORTING
    !IV_DOMAINID TYPE /AWS1/CNKDOMAINID OPTIONAL
    !IV_CASEID TYPE /AWS1/CNKCASEID OPTIONAL
    !IV_RELATEDITEMID TYPE /AWS1/CNKRELATEDITEMID OPTIONAL
    !IO_CONTENT TYPE REF TO /AWS1/CL_CNKRLTDITEMUPDATECONT OPTIONAL
    !IO_PERFORMEDBY TYPE REF TO /AWS1/CL_CNKUSERUNION OPTIONAL
  RETURNING
    VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_cnkupdaterltditemrsp
  RAISING
    /AWS1/CX_CNKACCESSDENIEDEX
    /AWS1/CX_CNKINTERNALSERVEREX
    /AWS1/CX_CNKRESOURCENOTFOUNDEX
    /AWS1/CX_CNKSERVICEQUOTAEXCDEX
    /AWS1/CX_CNKTHROTTLINGEX
    /AWS1/CX_CNKVALIDATIONEX
    /AWS1/CX_CNKCLIENTEXC
    /AWS1/CX_CNKSERVEREXC
    /AWS1/CX_RT_TECHNICAL_GENERIC
    /AWS1/CX_RT_SERVICE_GENERIC.

IMPORTING

Required arguments:

iv_domainid TYPE /AWS1/CNKDOMAINID /AWS1/CNKDOMAINID

The unique identifier of the Cases domain.

iv_caseid TYPE /AWS1/CNKCASEID /AWS1/CNKCASEID

A unique identifier of the case.

iv_relateditemid TYPE /AWS1/CNKRELATEDITEMID /AWS1/CNKRELATEDITEMID

Unique identifier of a related item.

io_content TYPE REF TO /AWS1/CL_CNKRLTDITEMUPDATECONT /AWS1/CL_CNKRLTDITEMUPDATECONT

The content of a related item to be updated.

Optional arguments:

io_performedby TYPE REF TO /AWS1/CL_CNKUSERUNION /AWS1/CL_CNKUSERUNION

Represents the user who performed the update of the related item.

RETURNING

oo_output TYPE REF TO /aws1/cl_cnkupdaterltditemrsp /AWS1/CL_CNKUPDATERLTDITEMRSP

Examples

Syntax Example

This is an example of the syntax for calling the method. It includes every possible argument and initializes every possible value. The data provided is not necessarily semantically accurate (for example the value "string" may be provided for something that is intended to be an instance ID, or in some cases two arguments may be mutually exclusive). The syntax shows the ABAP syntax for creating the various data structures.

DATA(lo_result) = lo_client->updaterelateditem(
  io_content = new /aws1/cl_cnkrltditemupdatecont(
    io_comment = new /aws1/cl_cnkcommentupdatecont(
      iv_body = |string|
      iv_contenttype = |string|
    )
    io_custom = new /aws1/cl_cnkcustomupdatecont(
      it_fields = VALUE /aws1/cl_cnkfieldvalue=>tt_fieldvaluelist(
        (
          new /aws1/cl_cnkfieldvalue(
            io_value = new /aws1/cl_cnkfieldvalueunion(
              io_emptyvalue = new /aws1/cl_cnkemptyfieldvalue( )
              iv_booleanvalue = ABAP_TRUE
              iv_doublevalue = '0.1'
              iv_stringvalue = |string|
              iv_userarnvalue = |string|
            )
            iv_id = |string|
          )
        )
      )
    )
  )
  io_performedby = new /aws1/cl_cnkuserunion(
    iv_customentity = |string|
    iv_userarn = |string|
  )
  iv_caseid = |string|
  iv_domainid = |string|
  iv_relateditemid = |string|
).

This is an example of reading all possible response values

lo_result = lo_result.
IF lo_result IS NOT INITIAL.
  lv_relateditemid = lo_result->get_relateditemid( ).
  lv_relateditemarn = lo_result->get_relateditemarn( ).
  lv_relateditemtype = lo_result->get_type( ).
  lo_relateditemcontent = lo_result->get_content( ).
  IF lo_relateditemcontent IS NOT INITIAL.
    lo_contactcontent = lo_relateditemcontent->get_contact( ).
    IF lo_contactcontent IS NOT INITIAL.
      lv_contactarn = lo_contactcontent->get_contactarn( ).
      lv_channel = lo_contactcontent->get_channel( ).
      lv_connectedtosystemtime = lo_contactcontent->get_connectedtosystemtime( ).
    ENDIF.
    lo_commentcontent = lo_relateditemcontent->get_comment( ).
    IF lo_commentcontent IS NOT INITIAL.
      lv_commentbody = lo_commentcontent->get_body( ).
      lv_commentbodytexttype = lo_commentcontent->get_contenttype( ).
    ENDIF.
    lo_filecontent = lo_relateditemcontent->get_file( ).
    IF lo_filecontent IS NOT INITIAL.
      lv_filearn = lo_filecontent->get_filearn( ).
    ENDIF.
    lo_slacontent = lo_relateditemcontent->get_sla( ).
    IF lo_slacontent IS NOT INITIAL.
      lo_slaconfiguration = lo_slacontent->get_slaconfiguration( ).
      IF lo_slaconfiguration IS NOT INITIAL.
        lv_slaname = lo_slaconfiguration->get_name( ).
        lv_slatype = lo_slaconfiguration->get_type( ).
        lv_slastatus = lo_slaconfiguration->get_status( ).
        lv_fieldid = lo_slaconfiguration->get_fieldid( ).
        LOOP AT lo_slaconfiguration->get_targetfieldvalues( ) into lo_row.
          lo_row_1 = lo_row.
          IF lo_row_1 IS NOT INITIAL.
            lv_string = lo_row_1->get_stringvalue( ).
            lv_double = lo_row_1->get_doublevalue( ).
            lv_boolean = lo_row_1->get_booleanvalue( ).
            lo_emptyfieldvalue = lo_row_1->get_emptyvalue( ).
            IF lo_emptyfieldvalue IS NOT INITIAL.
            ENDIF.
            lv_string = lo_row_1->get_userarnvalue( ).
          ENDIF.
        ENDLOOP.
        lv_slatargettime = lo_slaconfiguration->get_targettime( ).
        lv_slacompletiontime = lo_slaconfiguration->get_completiontime( ).
      ENDIF.
    ENDIF.
    lo_connectcasecontent = lo_relateditemcontent->get_connectcase( ).
    IF lo_connectcasecontent IS NOT INITIAL.
      lv_caseid = lo_connectcasecontent->get_caseid( ).
    ENDIF.
    lo_customcontent = lo_relateditemcontent->get_custom( ).
    IF lo_customcontent IS NOT INITIAL.
      LOOP AT lo_customcontent->get_fields( ) into lo_row_2.
        lo_row_3 = lo_row_2.
        IF lo_row_3 IS NOT INITIAL.
          lv_fieldid = lo_row_3->get_id( ).
          lo_fieldvalueunion = lo_row_3->get_value( ).
          IF lo_fieldvalueunion IS NOT INITIAL.
            lv_string = lo_fieldvalueunion->get_stringvalue( ).
            lv_double = lo_fieldvalueunion->get_doublevalue( ).
            lv_boolean = lo_fieldvalueunion->get_booleanvalue( ).
            lo_emptyfieldvalue = lo_fieldvalueunion->get_emptyvalue( ).
            IF lo_emptyfieldvalue IS NOT INITIAL.
            ENDIF.
            lv_string = lo_fieldvalueunion->get_userarnvalue( ).
          ENDIF.
        ENDIF.
      ENDLOOP.
    ENDIF.
  ENDIF.
  lv_associationtime = lo_result->get_associationtime( ).
  LOOP AT lo_result->get_tags( ) into ls_row_4.
    lv_key = ls_row_4-key.
    lo_value = ls_row_4-value.
    IF lo_value IS NOT INITIAL.
      lv_string = lo_value->get_value( ).
    ENDIF.
  ENDLOOP.
  lo_userunion = lo_result->get_lastupdateduser( ).
  IF lo_userunion IS NOT INITIAL.
    lv_userarn = lo_userunion->get_userarn( ).
    lv_customentity = lo_userunion->get_customentity( ).
  ENDIF.
  lo_userunion = lo_result->get_createdby( ).
  IF lo_userunion IS NOT INITIAL.
    lv_userarn = lo_userunion->get_userarn( ).
    lv_customentity = lo_userunion->get_customentity( ).
  ENDIF.
ENDIF.