I’m going crazy on a flex repeater populated with query binding
this is the query:
select
l.sap_code,
w.nome,
w.description,
l.validated_on "valid" ,
w.qty ,
w.pos
from
wl_warehouse_log l
inner join wm_warehouse_masterdata w on
w.sap_code = l.sap_code
where
l.created_on::date = :data
as you can see the column valid is reflected in the repeater and moreover is also used as a condition in another field which is working properly
When the flex repeater is filled the column valid is correctly populated "(column VALIDATO) but in the instances there is no trace of “valid”. See below
so as soon as I run a script on the flex repeater the attribute valid is not found
I’m running a change script on the flex repeater which is the following one:
insta = self.props.instances
cond = True
for ix in insta:
if ix.valid:
cond = False
else:
cond = True
self.view.custom.valid = cond
This is the error
Error running property change script on FlexRepeater.props.instances: Traceback (most recent call last): File "<function:valueChanged>", line 5, in valueChanged AttributeError: 'com.inductiveautomation.perspective.gateway.script' object has no attribute 'valid'
Adding that as soon as I change the query in the binding ,for example adding new column .. the column are correctly shown until I run the page in demo mode
Are you sure that's what you want to do ?
This code snippet will only reflect the valid field of the LAST ix in insta.
Which could be written like this:
self.view.custom.valid = not self.props.instances[-1].valid