How to re-initialize the local variable which is created while start of the expression rule? and how to execute a block of code in the 'Else' part of the 'If' condition.

Hi,

1) May I know how to change or re-initialize the local variable which has been initialized in the starting of the expression rule. (I have marked the local variable which needs to be re-initialized in 'Green' color).

2) Also may I know how to execute queryentity or execute a block of code in the 'Else' part of the 'If' condition. (I have marked the block of code which needs to be executed in the 'Else' part of 'If' condition in 'Yellow' color)

load(
  local!QuoteDetails: null,
  local!quoteSection: tointeger({}),
  if(
    ri!action = "Start",
    cons!QUOTE_UI_ROUTE_NAMES[3],
    {
      local!QuoteDetails: a!queryEntity(
        cons!MONITOR_QUOTE_SECTION,
        a!query(
          selection: a!querySelection(
            columns: {
              a!queryColumn(
                field: "Quote_Section"
              ),
              a!queryColumn(
                field: "Created_On"
              )
            }
          ),
          filter: a!queryFilter(
            "Policy_Id",
            "=",
            if(
              ri!policyId = "",
              0,
              ri!policyId
            )
          ),
          pagingInfo: a!pagingInfo(
            startIndex: 1,
            batchSize: 1,
            sort: a!sortInfo(
              "Created_On",
              false()
            )
          )
        )
      ).data,
      local!quoteSection: index(
        local!QuoteDetails,
        "Quote_Section",
        ""
      ),
      if(
        isnull(
          local!quoteSection
        ),
        cons!QUOTE_UI_ROUTE_NAMES[1],
        cons!QUOTE_UI_ROUTE_NAMES[local!quoteSection]
      )
    }
  )
)


Regards,

Balaji.R

  Discussion posts and replies are publicly visible