Unable to access Global Variable in a C# project

Hello! I am working on a project (Studio 23.4.5) where I can use global variables just fine in a Windows VB project, but they are not accessible anywhere within a C# project. I have looked but can’t find anything to address this. I have tried two different projects of each type, including the Windows Legacy just to see what the difference is.

My C# project is fine to declare it, but is not readable anywhere, EXCEPT it is read by the global trigger. Using global variables is pretty vital for my workflow so hopefully someone can help.

I’m having a hard time trying to take a screenshot with the popup open, but it says that no variable exists in the current context

Can you call it as below?

GlobalVariablesNamespace.GlobalVariables.global_PatientName

Also check if you have the below Namespaces in Imports:

image

Hi @ekopin @marian.platonov ,

I think it’s a bug in C# mode.

C#

VB

At this time, Adding GlobalVariables works as workaround.

(Studio 23.10.0 CE)

Regards,

1 Like

Thanks for the fast replies! I’m grateful that I can use it now, even if it is buggy in calling. At least it works, so I can continue on:)

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.