Change the Number Format of a column in an Entity Selection listbox at runtime

Hi all,

I have been trying to change between numerical formats at runtime (On load for a form really).

In the On Load event for the form I have the following code:

<code 4D>
Case of
: (<>Country=“United Kingdom”)
OBJECT SET FORMAT(*;“Balance_Col”;"|Pounds")

: (<>Country="Spain")
	OBJECT SET FORMAT(*;"Balance_Col";"|Euros")
	OBJECT SET FORMAT(*;"Balance_Col";"|Dollars")

End case
</code 4D>

Which does not seem to have any effect. I have added the following code to try and get more information about what is going on:
<code 4D>
$vP_BalCol:=OBJECT Get pointer(Object named;“Balance_Col”)
$vT_tmp:=OBJECT Get format(*;“Balance_Col”)

</code 4D>

The $vP_BalCol variable is always Nil, and the $vT_tmp var is always empty.

I can sort of work around it by replacing the data source expression with String(This.Balance;Form.balance_format) but that will break the default sort behaviour for the column but I would like to avoid reproducing the default sort behaviour manually.

Does anyone know why this (OBJECT Set Format not changing) might be happening?


Never mind.

I think I have finally found it.

If I set the Data Source -> Data Type in 32 bit v17 it does not stay as Numeric. Once I re-opened the editor as 64-bit I could correctly set the type as numeric, and then the set format had the desired effect.

I have had a similar issue before with getting a checkbox in the listbox in 32bit.