Expression evaluation error: The save target must be a local variable that does not refresh on every evaluation or on an interval, a process variable, or a node input (or a rule input passed one of those three)

Certified Associate Developer

I am having a wrapper interface and inside that first interface will have links listed in a grid ,on click of that dynamic  link another interface open and has back button ,This wrapper is used as a record summary view.
When I am testing from interface it is working fine but when I am testing from record View It is throwing an error.kindly help me to resolve?

Grid Code:
a!localVariables(

{
a!gridField(
data: ri!relatedTransactionsInfo,
columns: {
a!gridColumn(
label: "Transaction Id",
value: a!richTextDisplayField(
value: a!defaultValue(
value: a!richTextItem(
text: index(fv!row, "transaction_id", {}),
link:a!dynamicLink(

saveInto: {

a!save(ri!currentTransactionId,ri!transactionId),
a!save(ri!transactionId, index(fv!row, "transaction_id", {})),
a!save(ri!showInterface,cons!NWS_TXT_NAVIGATION_TRANSACTION_VIEW)

},

),


),
default: cons!NW_NULL_PLACEHOLDER_VALUE
)
),
align: "START"
),
a!gridColumn(
label: "Type",
value: a!richTextDisplayField(
value: a!richTextItem(
text: a!defaultValue(
value: fv!row.transaction_type,
default: cons!NW_NULL_PLACEHOLDER_VALUE
)
)
),
align: "START"
),
a!gridColumn(
label: "Description",
value: a!richTextDisplayField(
value: a!defaultValue(
value: a!richTextItem(text: fv!row.description),
default: cons!NW_NULL_PLACEHOLDER_VALUE
)
),
align: "START"
),
a!gridColumn(
label: "Status",
value: a!richTextDisplayField(
value: a!defaultValue(
value: a!richTextItem(text: fv!row.status),
default: cons!NW_NULL_PLACEHOLDER_VALUE
)
),
align: "START"
)
}

)

}
)



Wrapper Code:

a!localVariables(


if( ri!showInterface = cons!NWS_TXT_NAVIGATION_RELATED_TRANSACTIONS_AND_REQUIREMENTS,

rule!NWS_displayRelatedTransactionAndRequirements(
transactionId: ri!transactionId,
showInterface: ri!showInterface,
showBackButton: ri!showBackButton,
counter: ri!counter,
transactionList: ri!transactionList




),

rule!NWS_RelatedTransactionSummaryView(

showInterface: ri!showInterface,
showBackButton:true(),
transactionId: ri!transactionId,
currentTransactionId:ri!currentTransactionId





)







)






)

  Discussion posts and replies are publicly visible

Parents
  • +1
    Certified Lead Developer

    When ri!showInterface changes to cons!NWS_TXT_NAVIGATION_TRANSACTION_VIEW, the wrapper tries to call rule!NWS_RelatedTransactionSummaryView but one of its required inputs (probably transactionId or currentTransactionId) is null at that moment.

    Try this below wrapper code.

    a!localVariables(
      local!safeShowInterface: a!defaultValue(ri!showInterface, cons!NWS_TXT_NAVIGATION_RELATED_TRANSACTIONS_AND_REQUIREMENTS),
      local!safeTransactionId: a!defaultValue(ri!transactionId, null),
    
      if(
        local!safeShowInterface = cons!NWS_TXT_NAVIGATION_RELATED_TRANSACTIONS_AND_REQUIREMENTS,
        rule!NWS_displayRelatedTransactionAndRequirements(
          transactionId: local!safeTransactionId,
          showInterface: local!safeShowInterface,
          showBackButton: a!defaultValue(ri!showBackButton, false()),
          counter: a!defaultValue(ri!counter, 0),
          transactionList: a!defaultValue(ri!transactionList, {})
        ),
        rule!NWS_RelatedTransactionSummaryView(
          showInterface: local!safeShowInterface,
          showBackButton: true(),
          transactionId: local!safeTransactionId,
          currentTransactionId: a!defaultValue(ri!currentTransactionId, null)
        )
      )
    )
    

  • 0
    Certified Associate Developer
    in reply to Shubham Aware

    Thankyou so much, It is working fine now

Reply Children
No Data