Understanding the Formula Syntax

    The page layout designer of Magentrix offers many built-in features you can use to customize your pages. In this example, we are going to hide a section of the page using Magentrix's formula builder. To begin this example, follow these steps:

    1. Open the Setup menu.
    2. Under "Entities", click on the entity that you would like to edit.
    3. Under the "Page Layouts" tab at the bottom of the page, click on the page layout you wish to work with.
    4. Select the Section you would like to work with. If you do not yet have a "Section" of the page you'd like to work with, drag one onto the page layout from the left under the heading "Elements."
    5. Hover your mouse over the section name. At the far right of the section, you will see a wrench. Click on it.

    A pop-up window will appear. Within that window, at the bottom, there is a box with the header, "Visibility." Here there are two drop-down lists that Magentrix automatically populates. One is populated with fields from the database with which you can work, based on the entity selected, and the other dropdown list contains built-in functions. However, the formula builder is not simply a matter of clicking a series of fields and functions to achieve the desired functionality. Instead, it will take a little modification.

    In this example, we have a custom field in our entity named "Hide__c." This field is a checkbox and a boolean type, meaning that it only accepts two values: true and false. This field will be visible on the page, but if the user leaves the checkbox checked, it will hide the section we're working on. However, if it is unchecked, the section being edited will remain visible to users.

    In this example, it is necessary to start with selecting a function to determine how we want this to work. Because we're working with a boolean, we know its value can only be equal to true or false. We begin by selecting "Not Equal" from the list of functions. Notice that it appears like this:

    {!NotEqual(value1,value2)}

    This is a function. All functions are wrapped in curly braces ( "{ }" ). When beginning a function, Magentrix requires that the exclamation point begin your statement. Lastly, "Not Equal" demands that you have two values and, in our example, we're going to input the field we'd like to hide and the value of the checkbox.

    However, it's first necessary to format the "Not Equal" statement to its proper form. Separate the word "Not" from "Equal" so that the field looks like this:

    {!Not(Equal(value1,value2))}

    "Equal" on its own is another operator. In this case, "Not" is simply reversing the logic of how "Equal" works. We are using the "Equal" function that is available in the drop down list but reversing its logic.

    Now, we need to place the appropriate values in our statement. Our formula should look like this:

    {!Not(Equal(Hide__c,true))}

    First, we provide the field we're modifying, then we provide the value it should hold. This indicates to the system that "Hide__c is not equal to true (or checked), so hide this field." The field will now successfully be hidden from view if the checkbox is checked.

    For more information on the Functions and Merge Fields in Magentrix, see the Help Documentation.

    « Previous ArticleNext Article »


    3.0 (10)


    Comments

    No records to display

    Subscription
    Follow Knowledge posts
    Please enter your email address to subscribe:

    Email:
    Subscribe
    Follow us on Twitter