FabioG
21 hours agoContributor
Calculate values in different scenarios
Hi all,
I tried to issue an api.Data:calculate with the following (fake) formula :
A#ACCXXX:F:MYFLOW:S#MYSCEN = A#ACC001:F#CHI:S#ACT
Of course OS complains because I'm reading from the current Scenario (ACT) but I want to write in a different Scenario that implies a different Data Unit (is it ?)
While being in ACT scenario, if I would switch to DataBuffers to write in the destination Scenario (is it?)
Could someone point me in the right direction ?
I did this, but looks like it doesn't write a **bleep** !
Dim _srcDC As DataCell = api.Data.GetDataCell("A#ACC001:F#CHI:S#ACT")
Dim _targetDB As New DataBuffer()
Dim _dcNew As DataCell = New DataCell(_srcDC)
_dcNew.SetScenario(api, "MYSCEN") ' This WON'T CHANGE <===================
_dcNew.SetAccount(api, "ACCXXX") ' This Change
_dcNew.SetFlow(api, "MYFLOW") ' This Change
_targetDB.SetCell(si, _dcNew)
api.Data.SetDataBuffer(_targetDB, _destinationInfo)
In the end, works fine... just doesn't change the Scenario... :-/ What am I doing wrong ?
Thanks in advance for your help
FabioG