Forum Discussion

BobNelson's avatar
BobNelson
New Contributor III
2 days ago
Solved

What is Api.Cons.IsCurrency?

I came across this piece of code today:

If (((Not api.Entity.HasChildren()) And (api.Cons.IsLocalCurrencyForEntity())) And api.Cons.IsCurrency())

I'm guessing the last statement is to be sure that your Cons dimension POV is not on a "non-currency" member such as Elimination.  Have I guessed correctly?  And if so, then wouldn't this already be accounted for in the api.Cons.IsLocalCurrencyForEntity condition?

If I haven't guessed correctly, then my question is what does this condition check for?

 

  • Yes, Api.Cons.IsCurrency checks to see if the supplied ID is a currency.
    I agree with your analysis "wouldn't this already be accounted for in the api.Cons.IsLocalCurrencyForEntity condition"

    I think you can get the same result with:
    If Not api.Entity.HasChildren() AndAlso api.Cons.IsLocalCurrencyForEntity() Then ...

1 Reply

  • RobbSalzmann's avatar
    RobbSalzmann
    Valued Contributor II

    Yes, Api.Cons.IsCurrency checks to see if the supplied ID is a currency.
    I agree with your analysis "wouldn't this already be accounted for in the api.Cons.IsLocalCurrencyForEntity condition"

    I think you can get the same result with:
    If Not api.Entity.HasChildren() AndAlso api.Cons.IsLocalCurrencyForEntity() Then ...