Solved

Win vs Universal Task parameter

  • 15 February 2023
  • 9 replies
  • 136 views

Userlevel 3
Badge +5

Hello,

I am trying to upgrade my applications to the Universal GUI, however when testing I am experiencing the following problem.

I have a screen, which has parameters which are dependent on each other. In this case, I first need to choose a 'Gebouw’ (facility), after that, the related Naar ruimte: (area) can be chosen based on the chosen facility.

 

So when I choose 114. It will only show the area's in that facility:

The area which has been chosen also should be not a 'usage_area’. As this task can be used for multiple purposes, this is being done with a task parameter.

The lookup for the area is defined as below.

Which says, give me the area's which are available in te facility, and has the column usage_area to what the parameter value has.

When running a trace on the database, I can see in the Windows GUI the following statement:



DECLARE @p0 bit,@p1 bit,@p2 int,@p3 bit
SELECT @p0=1,@p1=1,@p2=1,@p3=0
SELECT t1.[area_name], t1.[area_id], t1.[facility_id], t1.[usage_area]
FROM [area] t1
WHERE (t1.facility_id IN (
SELECT allowed_facility_id
FROM dbo.users AS u
CROSS APPLY (
SELECT
CASE WHEN u.allowed_114 = 1 THEN
1
END AS allowed_facility_id
UNION
SELECT
CASE WHEN u.allowed_350 = 1 THEN
2
END AS allowed_facility_id
) a
WHERE u.tsf_user = dbo.tsf_user()
)
)
AND t1.[maintain_stock_balance] = @p0 AND t1.[active] = @p1 AND t1.[facility_id] = @p2 AND t1.[usage_area] = @p3
ORDER BY t1.[area_name] ASC

Which works as expected.

However, when testing in universal I don't see any area's displayed AND I see a strange change happening in the query:



DECLARE @p0 int,@p1 int,@p2 int,@p3 bit,@p4 bit
SELECT @p0=1,@p1=1,@p2=0,@p3=1,@p4=1


SELECT t1.[area_id], t1.[facility_id], t1.[area_name]
FROM [area] t1
WHERE (t1.facility_id IN (
SELECT allowed_facility_id
FROM dbo.users AS u
CROSS APPLY (
SELECT
CASE WHEN u.allowed_114 = 1 THEN
1
END AS allowed_facility_id
UNION
SELECT
CASE WHEN u.allowed_350 = 1 THEN
2
END AS allowed_facility_id
) a
WHERE u.tsf_user = dbo.tsf_user()
)
)
AND t1.[facility_id] = @p0
AND @p1 = @p2
AND t1.[maintain_stock_balance] = @p3
AND t1.[active] = @p4
ORDER BY t1.[area_name] ASC

Where you can see, instead of AND t1.[usage_area] = @p3, it says @P1 = @P2 (which is always false).

Why doesn't it look to the given column now?

icon

Best answer by Vincent Doppenberg 17 February 2023, 16:13

View original

This topic has been closed for comments

9 replies

Userlevel 6
Badge +4

Hello Peter,

The most likely cause is that one of the lookup filter parameters on the task is null. In your screenshot I can see that to_area_id is the lookup task parameter and both to_facility_id and boolean_0 are filter parameters for that lookup. It looks like the to_facility_id parameter has the value 1 and in the Windows GUI the boolean_0 parameter appears to have the value 0. In the query made by Indicium, there is no filter on the usage_area column, which would happen if the boolean_0 parameter is null and in this case, Indicium will indeed add a 1=0 condition to the query.

So the question boils down to why does the boolean_0 parameter have a value in the Windows GUI, but not in the Universal GUI? Can elaborate on how this parameter gets its value in the Windows GUI? It appears to be hidden, so I'm assuming it's a column → task parameter mapping, a default value, an expression or a value set by the default procedure.

Userlevel 3
Badge +4

So the question boils down to why does the boolean_0 parameter have a value in the Windows GUI, but not in the Universal GUI? Can elaborate on how this parameter gets its value in the Windows GUI? It appears to be hidden, so I'm assuming it's a column → task parameter mapping, a default value, an expression or a value set by the default procedure.

In the task a default value is given for this specific task parameter:
 

 

Userlevel 6
Badge +4

That looks like it should work. There might be an issue in Indicium, either related to the default value or the fact that the task parameter is hidden.

I think the easiest way to troubleshoot this issue at this point is to change the type of that parameter from Hidden to Regular and to confirm that it indeed receives the value 0. And if it does receive the value 0, can you test if the lookup works as expected now? If it does not receive the value 0, can you enter 0 yourself (or uncheck the checkbox if that’s the control type) and test if the lookup works then?

Userlevel 3
Badge +5

Hi Vincent,

Can it be that it is empty because of the order of the parameters, as there is a Constant value defined:

Can it be that the order of the parameters has influence on this?:

Userlevel 3
Badge +5

That looks like it should work. There might be an issue in Indicium, either related to the default value or the fact that the task parameter is hidden.

I think the easiest way to troubleshoot this issue at this point is to change the type of that parameter from Hidden to Regular and to confirm that it indeed receives the value 0. And if it does receive the value 0, can you test if the lookup works as expected now? If it does not receive the value 0, can you enter 0 yourself (or uncheck the checkbox if that’s the control type) and test if the lookup works then?

That's a great suggestion, we will give it a try and get back with the results.

Userlevel 3
Badge +4

That looks like it should work. There might be an issue in Indicium, either related to the default value or the fact that the task parameter is hidden.

I think the easiest way to troubleshoot this issue at this point is to change the type of that parameter from Hidden to Regular and to confirm that it indeed receives the value 0. And if it does receive the value 0, can you test if the lookup works as expected now? If it does not receive the value 0, can you enter 0 yourself (or uncheck the checkbox if that’s the control type) and test if the lookup works then?

Your assumption that boolean_0 becomes NULL is correct.
We made this parameter editable and when I start the task it is nicely set to 0 but as soon as I select the “facility/gebouw” I can see the checkbox change to NULL.
When I manually make it 0 again everything works as expected.

Userlevel 3
Badge +4

Hi Vincent,

Can it be that it is empty because of the order of the parameters, as there is a Constant value defined:

Can it be that the order of the parameters has influence on this?:

I've tried this and the result is still the same.

@Vincent Doppenberg it seems to be an issue that exclusively occurs in Universal.
The default value is transfered to the dialog when it first opened but as soon as I change ANY value (only editable parameter that didn't make boolean_0 NULL was another checkbox) boolean_0 becomes NULL.

I added SET @boolean_0 = 0 to the default for now. But that shouldn't be nessecary ;)
 

Userlevel 6
Badge +4

Hello @Alban_T and @Peter Kruis,

I have found the cause of this issue in Indicium. Indicium currently always clears reference columns when a reference column with a lower order number is changed (i.e. boolean_0 is always cleared when to_facility_id is changed, even though the two are not related). It should only do this if the reference column itself is a lookup column. It is quite rare for an application model to contain a situation like this, but it should definitely be supported.

We will work on resolving this issue very soon. I can’t promise that we can release a fix for this problem on the 24th of February, but it will definitely be released on March 17th in that case.

For now, setting the value in the default procedure is a good workaround. Please keep an eye on the release notes of Indicium to check when you’ll be able to remove this workaround.

Thank you for your input on this issue.

Userlevel 6
Badge +4

Hello @Alban_T and @Peter Kruis,

This issue has been fixed and is scheduled for release on March 17th.