Forum Discussion

BSK's avatar
BSK
New Contributor III
2 years ago

Dashboard XFBR String Rules - api.data.GetDataCell

We want to make some forecast periods read only ( Data seeded periods from Actuals) in a Data submission cube view by referencing the period count submitted in another Cube View. Basically, this is to deal forecast data submission.
Trying to achieve this by Dashboard XFBR string and that string is referenced into the Form template -> CubeView to make certain periods as readonly, so that they cannot submit the forecast data for those periods.
Below is the script that we are using the get the Period count submitted in a specific POV( to start with, hard coded all the POV members)
----------------------------------------------------
Dim strActMonths As String = api.data.GetDataCell("E#FC_Seed_Entry:P#:C#Local:S#FC11:T#2023M12:V#Periodic:A#FC_Seeding:F#None:O#Forms:I#None:U1#None:U2#None:U3#None:U4#None:U5#Text3:U6#None:U7#None:U8#None").CellAmount
Dim iActMonths As Decimal = 0
iActMonths = strActMonths.XFConvertToInt
----------------------------------------------------
We have called this into a Form tempplate and then to CubeView to display the columns.
But, when we try to open the Cube View it's giving the error " Object variable or With block variable not set"
It looks like there is some gap in pulling the POV value and converting to integer. Appreciate your thoughts on this.
If we hardcode the iActMonths value to certain number as below, it's working as expected.
"Dim iActMonths As Decimal = 5"
also, the same logic is working fine in Finance rules section to seed the data from Actuals, But not in the DashBoard XFBR type.
Appreciate your thoughts on this.

BSK

  • MikeG's avatar
    MikeG
    Contributor III

    Hi BSK , take a look on the Scenario properties, of the Scenario member in the dimension library.  This setting here locks the Actual periods, this is a 7+5 single year forecast scenario and locks the first 7 periods for No Input.  

    You don't need to write code to lock the Actuals periods, use this Scenario property.

    Hope this helps.

    • BSK's avatar
      BSK
      New Contributor III

      Hi Mike, thanks for the responce.

      We want to avoid metadata changes as it required to follow internal change management process.

       

      Thanks

  • JackLacava's avatar
    JackLacava
    Honored Contributor

    Isolate which of those lines actually results in the error, by placing a BRApi.ErrorLog.LogMessage call in between each. I'd also check your variable types, they look confused - you take a CellAmount (Decimal) and put it in a String variable, then convert it to Integer, then store it in a Decimal...?

    I agree with MikeG that could be done more easily with the proper Scenario property. If you really want to give the user control of that property, just build a Dashboard that will modify that property.

    • BSK's avatar
      BSK
      New Contributor III

      Hi Jack,

      Thanks for the responce.

      I tried initially with Integer and it didn't work.  Then was playing with other data types.

      Currently we are handling handling through Text 3 and changing the metadata scenario property to the number of periods required.

      The actual seeding periods into Forecast scenario will vary from time to time in our application, and we don't want to update the Scenario metadata properties, because we need to follow a huge change management process. 

      I will try to use the error log and see if it gives anythings.

       

       

  • Why not use a slice security on input (this way, it'll even prevent data imports)

     

    • BSK's avatar
      BSK
      New Contributor III

      Thanks Celvin. We want this to be very dynamic as it varies for each forecast scenario. and also, we need seed the data for that specific periods.