Forum Discussion

Mel5049's avatar
Mel5049
New Contributor
12 months ago

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

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)

 

  • tomdarnall's avatar
    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.

  • Richard_Mayo's avatar
    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

    • JackLacava's avatar
      JackLacava
      Community Manager

      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.

      • Richard_Mayo's avatar
        Richard_Mayo
        New Contributor III

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

  • ChristianW's avatar
    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

    • mjs22's avatar
      mjs22
      New Contributor

      How do you pass the SI variable?