Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. If you want to configure the initial state of the Part, you can do this by checking selecting or unchecking clearing the "Enable" checkbox option on the Form Template Part itself. All Parts are Enabled by default.

    Tip

    The Enabled checkbox option controls the Form Template Part's appearance in both the web and desktop clients.

     

  2. If your logic deals only with the fields of the record (or the record's parent, grandparent, or great-grandparent), you can use a Form Template Part Binding.

    Tip

    Form Template Part Bindings only affect the Form Template Part's appearance in the web client.



  3. When all else fails and you can't express your conditions in metadata, you can write a layout control for the Form Template and use the Aptify JavaScript API to enable or disable the Part.

    Note

    This code assumes you are in the template layout control, and therefore have the variables _ftpPartName and _ctrlPartName available.

    If you have the control, you can call its enable() method

    Code Block
    languagejs
    titleUsing the control's enable() method
    linenumberstrue
    if (_ctrlPartName) { // check if it exists if you're not sure the variable's been populated yet
    	_ctrlPartName.enable(true); // enables the control
    	_ctrlPartName.enable(false); // disables the control
    } 

    If you only have the element representing the Form Template Part, you can use Aptify.framework.utility.UI.enableControl(). This is a good choice when you have no other reason to have the control around as a separate variable.

    Code Block
    languagejs
    titleUsing Aptify.framework.utility.UI.enableControl()
    linenumberstrue
    if (_ftpPartName) { // check if it exists if you're not sure the variable's been populated yet
    	Aptify.framework.utility.UI.enableControl(_ftpPartName, true); // enables the control
    	Aptify.framework.utility.UI.enableControl(_ftpPartName, false); // disables the control
    }

...