Forum Discussion
AndreaF
3 years agoContributor III
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 ...
- 3 years ago
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)
MikeG
3 years agoContributor III
I have not experienced this behavior and could try to replicate it for you in my environment. As a best practice I would include the C#Local and either V#Periodic or V#YTD in the api.Data.SetDataCell line. Maybe also add I#None so as to not assume it is grabbing the IC Dimension member I#Top from the session POV.
- AndreaF3 years agoContributor III
Thank you for your reply, I've added the Consolidation, View, Intercompany and Flow (C#Local:V#YTD:I#None:F#None) to the expression, but with the same outcome.
(On a side note, the command is within the very common "If ((Not api.Entity.HasChildren()) And (api.Cons.IsLocalCurrencyforEntity())) Then" condition, so the consolidation member in the expression should not be needed, but I added it just to be sure anyway for the test).
Related Content
- 2 years ago
- 4 years ago
- 7 months ago