Skip to content

/AWS1/IF_CNK=>CREATERELATEDITEM()

About CreateRelatedItem

Creates a related item (comments, tasks, and contacts) and associates it with a case.

There's a quota for the number of fields allowed in a Custom type related item. See Amazon Connect Cases quotas.

Use cases

Following are examples of related items that you may want to associate with a case:

  • Related contacts, such as calls, chats, emails tasks

  • Comments, for agent notes

  • SLAs, to capture target resolution goals

  • Cases, to capture related Amazon Connect Cases

  • Files, such as policy documentation or customer-provided attachments

  • Custom related items, which provide flexibility for you to define related items that such as bookings, orders, products, notices, and more

Important things to know

  • If you are associating a contact to a case by passing in Contact for a type, you must have DescribeContact permission on the ARN of the contact that you provide in content.contact.contactArn.

  • A Related Item is a resource that is associated with a case. It may or may not have an external identifier linking it to an external resource (for example, a contactArn). All Related Items have their own internal identifier, the relatedItemArn. Examples of related items include comments and contacts.

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

  • The type field is reserved for internal use only.

Endpoints: See Amazon Connect endpoints and quotas.

Method Signature

METHODS /AWS1/IF_CNK~CREATERELATEDITEM
  IMPORTING
    !IV_DOMAINID TYPE /AWS1/CNKDOMAINID OPTIONAL
    !IV_CASEID TYPE /AWS1/CNKCASEID OPTIONAL
    !IV_TYPE TYPE /AWS1/CNKRELATEDITEMTYPE OPTIONAL
    !IO_CONTENT TYPE REF TO /AWS1/CL_CNKRELATEDITEMINPCONT OPTIONAL
    !IO_PERFORMEDBY TYPE REF TO /AWS1/CL_CNKUSERUNION OPTIONAL
  RETURNING
    VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_cnkcrerelateditemrsp
  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_type TYPE /AWS1/CNKRELATEDITEMTYPE /AWS1/CNKRELATEDITEMTYPE

The type of a related item.

io_content TYPE REF TO /AWS1/CL_CNKRELATEDITEMINPCONT /AWS1/CL_CNKRELATEDITEMINPCONT

The content of a related item to be created.

Optional arguments:

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

Represents the creator of the related item.

RETURNING

oo_output TYPE REF TO /aws1/cl_cnkcrerelateditemrsp /AWS1/CL_CNKCRERELATEDITEMRSP

Domain /AWS1/RT_ACCOUNT_ID
Primitive Type NUMC

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->createrelateditem(
  io_content = new /aws1/cl_cnkrelatediteminpcont(
    io_comment = new /aws1/cl_cnkcommentcontent(
      iv_body = |string|
      iv_contenttype = |string|
    )
    io_connectcase = new /aws1/cl_cnkcnctcaseinputcont( |string| )
    io_contact = new /aws1/cl_cnkcontact( |string| )
    io_custom = new /aws1/cl_cnkcustominputcontent(
      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_file = new /aws1/cl_cnkfilecontent( |string| )
    io_sla = new /aws1/cl_cnkslainputcontent(
      io_slainputconfiguration = new /aws1/cl_cnkslainputconf(
        it_targetfieldvalues = VALUE /aws1/cl_cnkfieldvalueunion=>tt_slafieldvalueunionlist(
          (
            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_fieldid = |string|
        iv_name = |string|
        iv_targetslaminutes = 123
        iv_type = |string|
      )
    )
  )
  io_performedby = new /aws1/cl_cnkuserunion(
    iv_customentity = |string|
    iv_userarn = |string|
  )
  iv_caseid = |string|
  iv_domainid = |string|
  iv_type = |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( ).
ENDIF.