Expression rule with same rule inputs should produce different results

I have the following situation:

- search text field for entering the client's ID

- ADD button that does the search and adds the client to the grid

- pretty complex UI which has this part regarding ADD button:

a!buttonArrayLayout(
                      buttons: {
                        a!buttonWidget(
                          label: "Add",
                          saveInto: {
                            a!save(local!addbButtonSwitch, not(local!addbButtonSwitch)),
                            a!localVariables(
                                local!client: a!refreshVariable(
                                  value: rule!APP_getclient(
                                  clientGroup: fv!item.id,
                                  clientCheckCdt: ri!clientCheck_cdt,
                                  clientRequestCdt: ri!request_cdt,
                                  searchString: trim(
                                    local!searchId[fv!index]
                                  ),
                                  global: not(
                                    fv!item.local
                                  ),
                                  isValid: local!isValid
                                ),
                                refreshOnVarChange: local!addbButtonSwitch
                                ),

Action order is as follows.

- client with some ID does not exist inside some remote database

- user searches for this client's ID via mentioned UI

- user receives the message NOT FOUND inside the text field (message replaces the ID that was used for search within local variable local!searchId)

- user adds client's data to the remote database without navigating away from the current UI (opens new tab and adds client via some third party application)

- user enters the same ID and clicks ADD again

- user should successfully add the client to the grid since it exists inside the remote database

However, this doesn't happen.

Since there are multiple grids on screen ("client buckets"), attempt to add the same client to any other bucket is successful. Attempt to search for another client, adding it to the grid and then searching for the first client again is also successful.

But, attempt to add the first client to the grid where it was searched for before it was added to the remote database results always with the message NOT FOUND.

It seems that this local variable local!client is never refreshed if rule inputs for rule rule!APP_getclient are unchanged.

I've tried to add some "switch" variable (local!addbButtonSwitch) that will cause the local!client to be refreshed upon each click on ADD button but it seems that result stays the same - empty result set since that client didn't exist upon first search attempt.

Is there any way to force the expression rule rule!APP_getclient to return new result set even though rule inputs are unchanged?

Just to mention, I do not have an option to change rule inputs or paradigm that uses array of search IDs or anything like that. This is the legacy code and cannot sustain major refactoring at this point. Maybe I can modify expression rule itself or the way it is referenced inside this a!localVariables block?

  Discussion posts and replies are publicly visible