Skip to main content
June 20, 2023
Solved

Expression evaluation error at function a!forEach [line 51]: Error in a!forEach() expression during iteration 1: Expression evaluation error : Invalid index: Cannot index property 'therapeuticArea' of type Text into type DataSubset

  • June 20, 2023
  • 2 replies
  • 0 views

Hi All, Please help me on this error

a!localVariables(
  local!listOfAmendments: if({
    index(
      index(
        rule!ISR_er_PopulateAmendmentsInExecuteMeetingDataSubset(meetingId: ri!meetingId),
        "data",
        {}
      ),
      "amdId",
      {}
    ) = index(rule!ISR_qry_GetISRAmendmentPrimaryReviewers(
      meetingId: ri!meetingId,
      primaryReviewer: ri!primaryReviewer,
      isActive: true
    ),"amdId",{})
  },rule!ISR_er_PopulateAmendmentsInExecuteMeetingDataSubset(meetingId: ri!meetingId ),{}),
  /*(Amendment Number, Amendment Reason, Proposal Reference Number, */
  /*Study Title, Primary Investigator, Medical Scientist/Proposal Champion (from GIL-134), */
  /*Currency, Budget, Slides (Slide for the Amendment) (GIL-263))*/
  local!tableAmendmentGridStart: "

Amendments to be Reviewed:

", local!tableAmendmentGridEnd: "
TA Ref # PI Country Study Category
", local!amendmentsGrid: a!forEach( items: local!listOfAmendments, expression: " " & fv!item.therapeuticArea & "" & "" & rule!CMN_er_generateRecordLink( label: fv!item.amendmentNumber & " / " & fv!item.proposalNumber, recordType: cons!ISR_RECORD_GS_AMENDMENT, identifier: fv!item.amdId, siteUrl: cons!ISR_GS_AMENDMENT_RECORD_SITE_PAGE_URL ) & "" & /*"" & fv!item.proposalNumber & "" & */ "" & fv!item.primaryResearcher & "" & "" & fv!item.countryName & "" & "" & index( rule!ISR_qry_GetReferenceValueByType( typeCode: cons!ISR_TEXT_TYPECODE_RESTYPE, code: index( rule!ISR_qry_GetStudyRequestsByReferenceNumber( referenceNumbers: fv!item.proposalNumber ), "researchType", {} ), isActiv: true() ), "name", {} ) & " " ), /*local!listOfAmendments*/ concat( local!tableAmendmentGridStart, joinarray(local!amendmentsGrid, " "), local!tableAmendmentGridEnd ) )

    Best answer by stefanhelzle0001

    You code is really hard to read. You try to address the field "therapeuticArea" in a data structure that is of type datasubset.

    In general, this error message means something like: "Hey dude, this data structure does not have a field of that name!"

    2 replies

    stefanhelzle0001
    Brainy
    June 20, 2023

    You code is really hard to read. You try to address the field "therapeuticArea" in a data structure that is of type datasubset.

    In general, this error message means something like: "Hey dude, this data structure does not have a field of that name!"

    June 20, 2023

    Is thee any solution for above error.Because therapeutic area is there in data sub set but still we are getting error