Virtual Coding

 

Virtual Coding refers to the ability to create and use functions that change data or perform functions when fields on an object change, when a custom button is clicked, or when a workflow runs.  Virtual Code functions can also be developed by third party developers and incorporated into existing applications and plug ins.

 

Permissions are required for Setup and Virtual Coding.

 

A virtual function can be created for an object by a PerfectMind user, or come pre-coded and be included with an object or application or custom block.  Virtual functions can be created and used in all objects.  A function can be made to run by attaching it to a custom button so the function runs when the button is clicked, or it can be run when the information in one or more fields on the object is changed, such as a user editing the information, or it can be used in a workflow as the action for the workflow.  Because the virtual code can be used in these different ways

 

Function Types

 

Add / Remove Child Records

This allows you to select a related child (dependant) object and delete records from that object.  An object must have child objects linked to it to use this function.  You need a field on the parent object (the object the virtual code is being created on) to specify how many records will be deleted from the child object.    

 

Add Values

This allows you to select up to six columns (fields), add the values in those fields together, and display it in a different field.  This can be useful for doing calculations or estimates and seeing the results by clicking a button, rather than having to use a formula field and save the record each time to show the calculation.

 

Create Transaction

This allows you to select fields for the different amounts, values, or records to create a transaction automatically.  For example, if the user clicked a "Complete Order" button, it could run a workflow that automatically creates a billing record for a customers purchase based on the existing customer information and the information entered for the order transaction.  The Show Popup option lets the user select and fill in this information themselves instead of having it all happen in the background.

 

Multiply Values

This allows you to select up to six columns (fields), multiply the values in those fields together, and display it in a different field.  This can be useful for doing calculations or estimates and seeing the results by clicking a button, rather than having to use a formula field and save the record each time to show the calculation.

 

Recurrence

This allows the user to automatically create a specific event that occurs more than once.  The type of occurrence, start time, end time, and other details can be selected from the fields on the object and the event will be created.  This can save time by quickly creating events in the Planner without having to load the Planner, create a new event, and so on.

 

Subtract Values

This allows you to select up to six columns (fields), subtract the values in those fields together, and display it in a different field.  This can be useful for doing calculations or estimates and seeing the results by clicking a button, rather than having to use a formula field and save the record each time to show the calculation.

 

Create a Virtual Function

 

Virtual functions are available for all objects.  If you create a function in an object, that particular functionality will only be in the object itself.

 

To create a virtual function, start from Setup > Development > Objects.  Select the object you want to work with.  

  1. Click the Virtual Coding tab.  If there are other functions they will be in a list.

  2. Click the New button.

  3. Enter a Name for the function.  It should be descriptive of what the function does or is used for.

  4. Enter a Description for the function so that other users will know what the function does.

  5. If you want the function to be triggered by a change in one or more fields on the object, select the field(s) from the list.  The function will run immediately upon the field being changed, such as when a user is editing the field or a formula is being updated.

  6.  

     

     

  7. To define the function and what it does, click the New button.

  8. Select the Function Name from the drop down list.  This determines what the function will do.

  9. From the Input list, select one or more columns for the input values for the function.  If the object is related to other objects, such as a Customer object related to an Invoice object, click on the object's name in the list to see the related objects.  You can then choose a related object and pick a field from that object for the virtual function as well.

  10. In the Output list, select where the results of the function will be displayed.

  11.  

     

     

  12. Click OK.

  13. To keep adding to the function, click the New button again, and repeat steps 7 through 10.  The functions will run in the same order as the list, from top to bottom.  This means that one function can produce a result, and the next function in the list can use that result for it's own use.  For example, the first function could add two fields together, then a second function could multiply the result of the first function by another field, and so on.

  14. Click Save to finish.  

 

Note that you can create functions with custom buttons instead of using the fields from the object to run the function.  From the Custom Button tab, create a new button, add a new action, and select the Virtual Code option from the list.

 

See Also

Create a Custom Button

 

Feedback

Did you find what you were looking for? Yes  No

Did this help you?    Very Helpful 5  4  3  2  1  Not Helpful  

 

How can we improve this topic?

     

 

Send Feedback: