Custom Value for Edit Tag SELECT

Change the EditValue for SELECT using the Server Script.The field ‘year’ has been selected as SELECT from the EDIT Tag
and on the User Value
Value Label
2020 2020
2021 2021Now I try to change the value dynamically using the Server Script under Row_Rendered
$years = [[2001,2001],[2002,2002]];
$this->year->EditValue = $years;and also I try under Row_RenderingThe value does not change. It show the old value 2020 and 2021

This might help: https://discourse.hkvstore.com/t/populate-a-select-tag-with-dynamic-values-or-from-table/4362/3

here in my case I would not like to use any lookup table.
I simply need a static lookup without using the lookup table
and only using the static User Values

This might help: > https://discourse.hkvstore.com/t/populate-a-select-tag-with-dynamic-values-or-from-table/4362/1

I try with this, in my case as there is no lookup table I am unable to solved the issue.I just select a random table as lookup table and put the code under the Lookup_Selecting

if ($fld->Name == "year"){
        $fld->Lookup->setOptions([
            ["2001", "2001", "", "", ""],
            ["2002", "2002", "", "", ""],
            ["2003", "2003", "", "", ""],
            ["2004", "2004", "", "", ""]
        ]);
    }

Here the $fld->Lookup->setOptions value is showing on the Add page and Edit Page
But in the search field, the $fld->Lookup->setOptions value is not showing.

If you read the post from link above, in the conclusion has been informed, you have to enable Use lookup table option from Edit Tag pane. After that, just select a table to define the lookup table from Lookup Table pane, even you will not use this lookup table, and you will use the code later in Lookup_Selecting server event.

Yes sir I have done that now it is working. I have already re-post again regarding with it.

Here the $fld->Lookup->setOptions value is showing on the Add page and Edit Page
But in the search field, the $fld->Lookup->setOptions value is not showing.

Now the lookup is working only on Add and edit
but it is not working on the External Search.

You may post your complete code in that Lookup_Selecting server event for more discussion.

I am sharing the full the code again -

// Lookup Selecting event
function Lookup_Selecting($fld, &$filter)
{
    //var_dump($fld->Name, $fld->Lookup, $filter); // Uncomment to view the filter
    // Enter your code here
    if ($fld->Name == "year"){
        $fld->Lookup->setOptions([
            ["2001", "2001", "", "", ""],
            ["2002", "2002", "", "", ""],
            ["2003", "2003", "", "", ""],
            ["2004", "2004", "", "", ""]
        ]);
    }
}

bui wrote:

but it is not working on the External Search.

Did you mean Extended Search? If so, I cannot reproduce the issue.I just tested on my machine, it works properly in Extended Search. Make sure you did not enable Use modal dialog for lookup option from Edit Tag pane.