Coming soon: Your brand new Help Center & Community! Get a sneak-peek here

Error when using class in .vb file, but it's Ok to use in dll

Hi

I have tried to use this in a .vb file and dropped it in the SOWeb scripts folder:

Dim SOString As String = SuperOffice.CRM.Globalization.CultureDataFormatter.ParseMultiLanguageString(ContactEntity.UserDefinedFields("SuperOffice:29:DisplayText"), "NO")

But I get an error message:

'CultureDataFormatter' is not a member of 'Globalization'

But when I use the same in an compiled DLL file it works as i hoped it would. Can anyone explain why it doesn't work directly in the .vb file? (Or if it's possible to get it to work there)

(Version 8.0 of SuperOffice if that matters)

RE: Error when using class in .vb file, but it's Ok to use in dll

It's probably because you are missing an assembly reference (to SuperOffice.Plugins which holds the CultureDataFormatter) when running the a script in 'Single Function'-mode. If you do not want to use an assembly you could use a full class and use the $ReferencedAssembly to get the right assembly.

See this https://community.superoffice.com/en/content/content/webclient/Scripting-in-the-NetServer-World/ for more info on the Full Class syntax.

By: Matthijs Wagemakers 26 Jul 2018