03-27-2024 09:58 AM
I am receiving this error when writing a business rule, any idea on how I can remove this error?
Here is the portion of the business rule where I am using 'si':
Dim objXFResult As XFResult = BRApi.Finance.Data.SetDataCellsUsingUsingCsvFile(si, filePath, delimiter, originFilter, targetOriginMember, loadZeros)
03-27-2024 10:15 AM
Hi Mel
Your code is probably located in a function or a procedure where si doesn't exist. If you like to use si, you must pass the si variable to it.
I hope this helps and cheers
Christian
03-27-2024 11:31 AM
Hi Christian,
Thanks for replying on this topic, as a little tangent - could you give a quick explanation of what "si" is simplistically? I've seen it around a lot and I've had to include it in certain bits of code without really understanding what it means (apart from the code doesn't work without it)!
Just intrigued what it actually does...!
Thanks,
Richard
03-27-2024 11:37 AM
It's an instance of the SessionInfo class, basically an object containing some basic stuff like who you are, when you logged on, etc. OneStream passes it to every Main function defined on the Main class of every custom business rule; if inside that function you then invoke some other function or sub, you have to explicitly pass the object around.
Most BRApi calls will require it, in order to define whether you're actually allowed to perform this or that action.
03-27-2024 11:54 AM
Brilliant, thanks Jack - very clear, a good learning for me - always wondered what it meant!
03-28-2024 10:51 AM
Not sure where you're running this, but there are some areas within OS that require api.si, instead of just si.