The OneStream Community is temporarily frozen until June 29th due to the ongoing maintenance. Please read the blog post here to learn more.
Forum Discussion
VVpackers
3 years agoNew Contributor
how to debug a business rule
An allocation business rule is not allocating the rates properly . Hence we would like to debug the business rule and also figure out which intersections are passed and what is the value and allocati...
- 3 years ago
VVpackersYou can use the below methodology to start debugging your rule. I have read the below tip from this community.
1) Simplifying Log Message Define a Boolean Constant LogSwitch Public Const LogSwitch As Boolean = True True- To turn on logging for your business rule False - To turn off logging for your business rule Use the below statement when writing a log If LogSwitch = True Then brapi.ErrorLog.LogMessage(si, "My Workflow name is " &Workflow ) Also, To Log everything in a single string use the below format - Dim log As String = String.Empty 'Append to “log” throughout business rule log += “Message 1” & VbCrLf '<— VbCrLf is a .Net constant for “New Line” log += “Message 2” & VbCrLf 'At the very end of Business Rule I write the log variable to the ErrorLog. BRApi.ErrorLog.LogMessage(si, log)
OS_Pizza
3 years agoContributor III
VVpackersYou can use the below methodology to start debugging your rule. I have read the below tip from this community.
1) Simplifying Log Message
Define a Boolean Constant LogSwitch
Public Const LogSwitch As Boolean = True
True- To turn on logging for your business rule
False - To turn off logging for your business rule
Use the below statement when writing a log
If LogSwitch = True Then brapi.ErrorLog.LogMessage(si, "My Workflow name is " &Workflow )
Also, To Log everything in a single string use the below format -
Dim log As String = String.Empty
'Append to “log” throughout business rule
log += “Message 1” & VbCrLf '<— VbCrLf is a .Net constant for “New Line”
log += “Message 2” & VbCrLf
'At the very end of Business Rule I write the log variable to the ErrorLog.
BRApi.ErrorLog.LogMessage(si, log)
VVpackers
3 years agoNew Contributor
Thanks for all your ideas . I am also trying to get messages out of a formula used in a UD7 member. How can I grab messages out of it ? Because I can see the messages from a business rule and not seeing from the messages I put in UD7 member formula.
- RobbSalzmann3 years agoValued Contributor II
Can you share some screenshots ?
- JackLacava3 years ago
OneStream Employee
Make sure your UD7 member is assigned to a pass in the Formula Type property, or the formula won't run at all. Depending on how you're triggering this, you might need to set the Is Consolidated property too.
As OS_Pizza said, you want to run your action "With Logging" and then look into the Task Activity Log, expanding Child Steps to verify if the formula is ever invoked and where:
Once you're sure the formula is invoked, you can start peppering it with LogMessage calls, which will appear in System Pane -> Error Log.
Related Content
- 4 years ago
- 2 years ago
- 2 years ago
- 3 years ago