16
Views
4
Comments
Solved
If condition don t work
Question
If(GetApplicationById.List.Current.ProductCategory.Code = "012",
(GetApplicationById.List.Current.ApplicationAdd.SpecialConditionAdd)  + " - TEXT NUM 1: " + GetPledgeAddressUNI(PledgeIdCredit: GetPledgesByApplicationId.List.Current.Pledge.Id, IsRus: True)
+ "; ", If(GetApplicationById.List.Current.ProductCategory.Code = "016",
(GetApplicationById.List.Current.ApplicationAdd.SpecialConditionAdd)  + " - TEXT NUM 2 " + GetPledgeAddressUNI(PledgeIdCredit: GetPledgesByApplicationId.List.Current.Pledge.Id, IsRus: True)
+ "; ", "") )+ NewLine()


I need if the user used 012 product - one version of the text "TEXT NUM 1"  output


if the user selects 016, then another version of the text "TEXT NUM 2" output




Incorrectly displays only the text 012 product, although I selected 016 product

mvp_badge
MVP
Rank: #18
Solution

Hi,

First of all your expression can be coded more readable:

Second, as Maria da Graça Peixoto already mentioned is that the most likely reason you don't see what you expect is because you don't have the correct record as current record. You can use the debugger to debug your code. That way you can see what is in the current record.

Regards,

Daniel

Reactive / Mobile or traditional Web? 

Where are you selecting the product? 

It seems  

GetApplicationById.List.Current.ProductCategory.Code 

is always the field from same record!!


Regards

Graça

Well , I'm not seeing your code so let us try some thing :

-you go to the expression  that shows you the product text (as you have written program show me 016 product text)

and see what record you are using , 

- use that records "code" field in your if . 

In the if you send above the record is 

GetApplicationById.List.Current.ProductCategory

In the expression where you see the 016 product text you probably have other. 

Hope what I've written make sense for you. 

Graça

mvp_badge
MVP
Rank: #18
Solution

Hi,

First of all your expression can be coded more readable:

Second, as Maria da Graça Peixoto already mentioned is that the most likely reason you don't see what you expect is because you don't have the correct record as current record. You can use the debugger to debug your code. That way you can see what is in the current record.

Regards,

Daniel