Skip to main content
Newcomer
Feb 8, 2024 3:04 AM UTC
Solved

UserState Parameter in the Api.Data.Calculate

May I have an example of using UserState Parameter in the Api.Data.Calculate? Thank you

 

RobbSalzmann
Employee - Advisor
Feb 8, 2024 2:14 PM UTC

Hi  Kai,

you may have noted this is an optional parameter, so you can leave it out.

Instantiating a XFUserState object involves this API:
Dim objXFUserState As XFUserState = BRApi.State.GetUserState(si, isSystemLevel, clientModuleType, relatedObjectType, relatedObjectName, key1, key2)

XFUserState appears to be related to the user's session state and activitiy.  It seems pretty useless in the context of writing business rules in a business setting.

MMomentoff #Abstraction.  The exposed method signature for Api.Data.Calculate could be wrapped within a method whose signature only requires arguments a business user can reasonably supply.

 

2 replies

RobbSalzmann
Employee - Advisor
Employee - Advisor
Feb 8, 2024 2:14 PM UTC

Hi  Kai,

you may have noted this is an optional parameter, so you can leave it out.

Instantiating a XFUserState object involves this API:
Dim objXFUserState As XFUserState = BRApi.State.GetUserState(si, isSystemLevel, clientModuleType, relatedObjectType, relatedObjectName, key1, key2)

XFUserState appears to be related to the user's session state and activitiy.  It seems pretty useless in the context of writing business rules in a business setting.

MMomentoff #Abstraction.  The exposed method signature for Api.Data.Calculate could be wrapped within a method whose signature only requires arguments a business user can reasonably supply.

 

Newcomer
Jan 2, 2025 5:59 PM UTC

I'm seeing an api.Data.Calculate statement with a script, followed by blank commas for the dimension filters, then an "onEval" statement, a final comma, then the word False.  Can I assume that the final comma refers to the IsDurableCalculatedData Boolean, even though no blank has been assigned to userState?