SetDataCell only work on Origin=Forms where data on the Origin=Import member exist
Hi all,
the SetDataCell command I am trying to use is behaving in a strange way and I would like to check if that is a bug, if it is by design, or if I may be doing something wrong.
I am trying to use the SetDataCell command to clear data on the Origin=Forms. The command looks like this (it is part of a custom calc rule):
'Clear data on the Form member
api.Data.SetDataCell("Cb#Main:E#" & MainPovEntity & ":S#" & MainPovScenario & ":A#AC410000:U1#None:U2#None:U3#" & UD3Name & ":U4#None:U5#Local_GAAP:U6#None:U7#None:U8#None:O#Forms", 0, True)
Now, if the UD3 member which I am trying to clear has data on the Origin=Import member, the Forms member is correctly set to zero by the rule. However, if the UD3 member has no data on the Origin=Import member (on that specific Pov intersection defined by the rule above), the Forms member retains its value.
Anyone else experienced this behavior? Thank you
Can you give this a try and check the Error Log? This is to capture the before and after amount in the data cell you are trying to clear. Paste this in to the IsBaseEntity and IsLocalCurrency IF THEN condition.
Dim before As Decimal = api.Data.GetDataCell("Cb#Main:C#Local:V#YTD:I#None:F#NoneE#" & MainPovEntity & ":S#" & MainPovScenario & ":A#AC410000:U1#None:U2#None:U3#" & UD3Name & ":U4#None:U5#Local_GAAP:U6#None:U7#None:U8#None:O#Forms").CellAmount
'SetDataCell Command here
Dim after As Decimal = api.Data.GetDataCell("Cb#Main:C#Local:V#YTD:I#None:F#NoneE#" & MainPovEntity & ":S#" & MainPovScenario & ":A#AC410000:U1#None:U2#None:U3#" & UD3Name & ":U4#None:U5#Local_GAAP:U6#None:U7#None:U8#None:O#Forms").CellAmount
BRapi.ErrorLog.LogMessage(si, "SetCell Before/After check: Et= " & MainPovEntity & ", BeforeAmt= " & before & ", AfterAmt= " & after)