'si' is not declared. It may be inaccessible due to its protection level.

Mel5049
New Contributor

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)

 

5 REPLIES 5

ChristianW
Valued Contributor

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

Richard_Mayo
New Contributor III

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

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.

Brilliant, thanks Jack - very clear, a good learning for me - always wondered what it meant!

tomdarnall
New Contributor III

Not sure where you're running this, but there are some areas within OS that require api.si, instead of just si.

Tom Darnall, CPA
CFO Solutions LLC
Solution Architect
Please sign in! Mel5049