I am trying to create a dynamic grid that can add lines in a form. but I am getting an error

Certified Lead Developer
I am trying to create a dynamic grid that can add lines in a form. but I am getting an error inside the call and im not sure what it is pointing me to

Interface Definition: Expression evaluation error at function a!gridLayout [line 243]: Type Validation: com.appiancorp.core.data.Dictionary cannot be cast to com.appiancorp.core.data.Record


here is the code near the error it is inside an a!gridLayout

rows: {

if(isnull(ri!OtherDocumentAnalysis_CDT),
{},
{ rows: a!applyComponents(
function: rule!SB_RowEachforegulatoryfileingform(
taskItem_cdt: ri!OtherDocumentAnalysis_CDT,
index: _
),

array: 1 + enumerate(

count(

ri!OtherDocumentAnalysis_CDT
)
)
)
}

)

...

OriginalPostID-247922

  Discussion posts and replies are publicly visible

Parents
  • @christhopherr I think the way you are using the rows attribute(based on code snippet mentioned in the post) might be one of the reasons that's contributing to the error being experienced by you. It might be worth trying as follows:

    rows: if(
    isnull(ri!OtherDocumentAnalysis_CDT),
    {},
    a!applyComponents()
    /*Expand the applyComponents() as per the code snippet mentioned in your post*/
    )

    Also I believe there isn't a need to wrap the definition of if() or a!applyComponents() inside curly braces, as you are already doing that explicitly when the value is null(in case of true, {} is being returned) and implicitly in case of a!applyComponents(in case of false, this is returning a list or an array).
Reply
  • @christhopherr I think the way you are using the rows attribute(based on code snippet mentioned in the post) might be one of the reasons that's contributing to the error being experienced by you. It might be worth trying as follows:

    rows: if(
    isnull(ri!OtherDocumentAnalysis_CDT),
    {},
    a!applyComponents()
    /*Expand the applyComponents() as per the code snippet mentioned in your post*/
    )

    Also I believe there isn't a need to wrap the definition of if() or a!applyComponents() inside curly braces, as you are already doing that explicitly when the value is null(in case of true, {} is being returned) and implicitly in case of a!applyComponents(in case of false, this is returning a list or an array).
Children
No Data