Skip to main content
Known Participant
Mar 17, 2022 9:15 PM UTC
Question

Error- at function a!textField :invalidindex:Cannot index property(UZCd of type string into type list of variant

I am facing this error in UI when m trying to modify the UZ. Code which I used is below:

a!localvariable(
 with(
    local!uzReadOnly: rule!TM_QR_getListUzById(UzIds:ri!formReportableSegment.UzId),
  
   a!sectionLayout(
    label: " Details",
    columns:{
     
     a!textField(
      label: "UZ",
      labelPosition: "ADJACENT",
      value: local!uzReadOnly.UzCd & " - " & local!uzaReadOnly.UzName,
      readOnly: true
     )},

I tried indexing it  but still throwing same error.

    6 replies

    andrewh0007
    Inspiring
    Mar 17, 2022 9:43 PM UTC

    Is UzCd an array? Can you show us what the local!uzReadOnly returns and if it's a CDT the CDT info?

    Known Participant
    Mar 17, 2022 9:51 PM UTC

    this rule :rule!TM_QR_getListUzById(UzIds:ri!formReportableSegment.UzId) , the UzIds is an array.

    harshitb6843
    Brainy
    Mar 18, 2022 4:45 AM UTC

    Hi there,

    Here is some sincere advice. Please AVOID using the [dot] operator. It causes a lot of trouble when you don't get the expected value in the variable. 
    Instead, use index() or property() function. Your error should be resolved. 

    Known Participant
    Mar 18, 2022 8:22 PM UTC

    Thanks, it resolved .Indexing didnt worked somehow but property() function worked.