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.Tarea_name], t1.,area_id], t1.,facility_id], t1.,usage_area]
FROM Farea] 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.Dmaintain_stock_balance] = @p0 AND t1.Dactive] = @p1 AND t1.Dfacility_id] = @p2 AND t1.Dusage_area] = @p3
ORDER BY t1.Yarea_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.Tarea_id], t1.,facility_id], t1.,area_name]
FROM Farea] 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.Dfacility_id] = @p0
AND @p1 = @p2
AND t1.Dmaintain_stock_balance] = @p3
AND t1.Dactive] = @p4
ORDER BY t1.Yarea_name] ASC
Where you can see, instead of AND t1.Dusage_area] = @p3, it says @P1 = @P2 (which is always false).
Why doesn't it look to the given column now?