How to do a force consolidate in a Business Rule

Marco
Contributor

Hi, Is there a way to perform a force consolidate in a BR? since running a datamgmtsequence isn't working properly for me. Example:

Select Case api.FunctionType
				
					Case Is = FinanceFunctionType.CustomCalculate
					
					
						'If args.CustomCalculateArgs.FunctionName.XFEqualsIgnoreCase("Test") Then
						'api.Data.Calculate("A#Profit = A#Sales - A#Costs")
						'End If
						brapi.utilities.ExecuteDataMgmtSequence(si, "PLN_Consolidate_AnyScenario", Nothing)
				
					End Select

Marco_0-1706802523428.png

And with this, the consolidation doesn't run; I'm not sure if I'm missing sending information or something like that.

1 ACCEPTED SOLUTION

MikeG
Contributor III

Add a Step in the DM Sequence to run the Force Consolidate, as the final step.  After your Custom Calculate DM Step.  Data Management Sequences can have one to many steps in that Sequence.

Hope this helps,

View solution in original post

4 REPLIES 4

NicolasArgente
Valued Contributor

Hi @Marco 
The PLN_TestConsol Business Rule can then run a DM job that uses the Force. But it can not be done directly in the CustomCalculate. 

Connect with me on:
LinkedIn: https://www.linkedin.com/in/nicolas-argente/
Website: https://aiqos.io
If you want to lift yourself up, lift up someone else.

So what kind of BR do you recommend for running that? Since I also use a sequence to execute this BR.

MikeG
Contributor III

Add a Step in the DM Sequence to run the Force Consolidate, as the final step.  After your Custom Calculate DM Step.  Data Management Sequences can have one to many steps in that Sequence.

Hope this helps,

rhankey
New Contributor III

I see at least two problems:

First, in your ExecuteDataManagementSequence() call to you are passing Nothing where you should be passing in a Dictionary(Of String,String) of resolved Dashboard Parameter values.  Without which |!PLN_ParamWFScenario!| will not resolve to anything when OS attempts to run the DM Sequence.

Second, it looks like you are trying to execute a DM Sequence from within a CustomCalculate.  While you can technically invoke a DM Sequence from anywhere, I'm not sure it makes any sense to do so from within a CustomCalculate.  I would think a far better approach would be to add the PLN_Consolidate_AnyScenario DM Sequence Steps to the DM Package that was actually invoking the CustomCalculate.