20
Views
2
Comments
Solved
How to write "If" condtion correctly
Question
How to write correctly? I need it to take data from 007 product

If(GetApplicationById.List.Current.ProductCategory.Code = "007", TextToDecimal(GetApplicationById.List.Current.Pledge.AmountBuilder) * (GetApplicationById.List.Current.PledgeBuilders.Amends) / 100
mvp_badge
MVP
Rank: #78
Solution

Hi,

In addition with Daniel's note, I also observed that the inline-IF condition is also missing the False part

If(GetApplicationById.List.Current.ProductCategory.Code = "007", (TextToDecimal(GetApplicationById.List.Current.Pledge.AmountBuilder) * (GetApplicationById.List.Current.PledgeBuilders.Amends)) / 100, 0)


Syntax for Inline IF: 

If(Conditional Statement, True, False)


Kind regards,

Benjith Sam

mvp_badge
MVP
Rank: #17

Hi,

The question you should ask yourself is how to create a datamodel correctly.

You are converting a text field to Decimal prior to using it in calculation.

You should define AmountBuilder in your datamodel as Currency (or Decimal if that is what you prefer).

And this is the corrected syntax.

If(GetApplicationById.List.Current.ProductCategory.Code = "007", TextToDecimal(GetApplicationById.List.Current.Pledge.AmountBuilder) * GetApplicationById.List.Current.PledgeBuilders.Amends / 100, 0)

Regards,

Daniel

mvp_badge
MVP
Rank: #78
Solution

Hi,

In addition with Daniel's note, I also observed that the inline-IF condition is also missing the False part

If(GetApplicationById.List.Current.ProductCategory.Code = "007", (TextToDecimal(GetApplicationById.List.Current.Pledge.AmountBuilder) * (GetApplicationById.List.Current.PledgeBuilders.Amends)) / 100, 0)


Syntax for Inline IF: 

If(Conditional Statement, True, False)


Kind regards,

Benjith Sam