Skip to main content
October 12, 2023
Question

Index Error- Cannot index type Number (Integer) into type

  • October 12, 2023
  • 5 replies
  • 0 views

Im getting Cannot index type Number (Integer) into type (DOCUMENT_DETAILS) - which is a cdt. 

local!indexNum is  just a local

                a!radioButtonField(
                  label: "Radio Buttons",
                  labelPosition: "ABOVE",
                  choiceLabels:rule!SKJ_GetForm(
                    {}

                  )['recordType!{228c141f-e2f8-4a93-bf0d-0dfed8c9c6b4}SKJ Form.fields.{af4b3fdd-a9a3-4ea7-82d9-8f16e323e35f}descEn'],
                  choiceValues:rule!SKJ_GetForm(
                    {}

                  )['recordType!{228c141f-e2f8-4a93-bf0d-0dfed8c9c6b4}SKJ Form.fields.{d69bf265-893b-4707-965c-3512e6e1c9bd}itemCode'],
   
            
                  value:
                  ri!DocDetails[local!indexNum].docForm,
       
                 
           
                  saveInto: {


                    ri!DocDetails[local!indexNum].docForm


                  },
                  required: true,
                  choiceLayout: "COMPACT",
                  validations: {}
                )

    5 replies

    October 12, 2023

    October 12, 2023

    and ri!DocDetails type is the CDT , and its an array 

    pls help

    October 12, 2023

    Hi, 

    Is ri!DocDetails is an array? if it is not an array system will through an error when you try to index. Please make it as an array. 

    October 12, 2023

    Yes it is

    harshitb6843
    October 12, 2023
    1. Try to force the variables in their correct types.
    2. Make sure every variable that you're indexing has data. 
    3. Use the index() function instead of [] to avoid these types of errors in future