Forum Discussion

ajackett's avatar
ajackett
New Contributor III
5 months ago

Value from CustomCalc not storing after processing cube - DM Roll Forward Form job

Hi all, 

I have developed a process to rollover a form from one period to the next. Specifically prepayments, where the monthly movement is explained for 4 GL accounts using 20ish flows. The user enters a value in the value cell and the commentary cell. 

I have created a button to run a CustomCalc DM job to copy the values entered from the prior month form and past it to the current month form. I managed to get it working for both the Values and Annotations, so that it shows the rolled forward amount on the new month form. However, when I step through Input Form > Process > Confirm, it then wipes the value at the Process stage. The rolled forward annotation does remain. I notice that when I roll forward, the value is stored as "Calculation" and in blue font. When I type a value in manually, it is in black font and it remains when processed. The main thing that I am finding weird though, is that I developed this in v7.2 and it worked. However, we have upgraded to v8.2 and now it doesn't seem to work. 

I have attached my BR and a some screenshots to see if anyone has any ideas. Highlighted where the value has changed (annotation remains) after processing. 

Thanks in advance!

 

 

 

 

 

  • Hi, you need to set the IsDurableData boolean on the api to TRUE, e.g 

    api.Data.Calculate("A#myTargetAccount = A#mySourceAccount", True)

    Otherwise, all calculated data gets cleared each time a normal calculation is executed.

    For sake of completeness, one can also set this setting to FALSE on the scenario. However, I have never seen anyone actually doing this. Market practice is to leave this and use Durable Calculations where necessary.

     

  • Henning's avatar
    Henning
    Valued Contributor II

    Hi, you need to set the IsDurableData boolean on the api to TRUE, e.g 

    api.Data.Calculate("A#myTargetAccount = A#mySourceAccount", True)

    Otherwise, all calculated data gets cleared each time a normal calculation is executed.

    For sake of completeness, one can also set this setting to FALSE on the scenario. However, I have never seen anyone actually doing this. Market practice is to leave this and use Durable Calculations where necessary.

     

  • ajackett's avatar
    ajackett
    New Contributor III

    Thank you Henning, that's solved the problem. I'm still learning business rules as I go, so I do miss some of the syntax rules every so often. 

    In hindsight, maybe I hadn't previously processed the rollforward values in v7.2 so hadn't noticed the balance removed. 

    Thanks again!

  • T_Kress's avatar
    T_Kress
    Contributor III

    Just another tip.  You will want to consider using RemoveZeros or RemoveNoData on the right hand side of your equation.  This is a best practice to avoid increasing the DU size and loading zeros into next period.

    But glad your durable data is sticking now!