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
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)
AndreaF
3 years agoContributor III
Thank you, this really helped me a lot! The SetDataCell command was enclosed in a loop that was lopping a data buffer, like this:
For Each sourceCell As DataBufferCell In targetDataBuffer.DataBufferCells.Values
If Not sourceCell Is Nothing And sourceCell.CellAmount <> 0 Then
'Clear data on the Form member
api.Data.SetDataCell(...)
'Calculate the Import member
api.Data.Calculate(...)
End If
Next
With your error logging code I have been able to verify the data buffer was not including the UD3 I was trying to clear.
Related Content
- 2 years ago
- 4 years ago
- 7 months ago