Forum Discussion

agoralewski's avatar
agoralewski
Community Manager
2 years ago

Fact or Fiction? All rules in business rules page must be written in Visual Basic.

All rules in business rules page must be written in Visual Basic..

Question Credit: Andrea Tout

Is this statement fact or fiction?

Comment your best guess below! Answers will be revealed in one week.

* This question is applicable to Platform 7.3.0 and may not be relevant to future releases

  • Fiction. BRs can be written in VB.NET (as opposed to VB!) and more recently C#

  • DanielWillis's avatar
    DanielWillis
    Valued Contributor

    Fiction. BRs can be written in VB.NET (as opposed to VB!) and more recently C#

  • ChrisLoran's avatar
    ChrisLoran
    Valued Contributor

    In other words, it depends on whether it's an old OS version or not.
    This is why the database upgrade utility adds a language field to the BusinessRules table, and you get errors trying to open business rules from an older version that hasn't had the schema update tool applied to the application database.

    But just because Business Rules can have VB.Net or C# , that does not mean the same is true for Member Formula: those currently can only be VB.NET, however a member formula (in VB.NET) can run a method in a Business Rule that was built in C#.  The advantage with this (using a C# Business Rule here) is that you can define common functions in a [Static] class in C# (which you can't really do in VB.NET) , so that way your Member Formula don't need to continually create and destroy new instances of a shared BR class every time it executes.