Conditional for someone in an availability group?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • teedle
    Mini Mivite

    • Mar 2017
    • 53

    #1

    Conditional for someone in an availability group?

    I'm thinking about adding a few internal custom order fields for employees to fill, but would like to only show the fields for members of an availability group. This should be easy but the answers I found googling seem a little old. (Also I have the toolkit if that has the easiest way.)
    Thank you
  • Brennan
    Super Moderator









    • Jun 2009
    • 3481

    #2
    You can use toolkit or we have built in functions to do it. It would look something like this:

    Code:
    <mvt:comment>Load Availability Group by Name</mvt:comment>
    <mvt:do file="g.Module_Feature_AGR_DB" name="l.success" value="AvailabilityGroup_Load_Name('MyAvailGroupName', g.availabilitygroup)" />
    
    <mvt:comment>Check if customer is assigned to the group</mvt:comment>
    <mvt:do file="g.Module_Feature_AGR_DB" name="l.success" value="AvailGroupXCustomer_Load(g.availabilitygroup:id, g.basket:cust_id, l.settings:availgroupxcustomer)" />
    
    
    <mvt:if expr="NOT ISNULL l.settings:availgroupxcustomer:agrp_id">
        //Customer is part of the availability group
    <mvt:else>
        //customer is not part of the availability Group
    </mvt:if>
    Brennan Heyde
    VP Product
    Miva, Inc.
    [email protected]
    https://www.miva.com

    Comment

    • teedle
      Mini Mivite

      • Mar 2017
      • 53

      #3
      Oh I see. Thanks for the help

      Comment

      Working...
      X