Chin's Musings - How to Update a Field

Welcome to another installment of Chin's Musings! In this series, Systems Controller Chin Chuah will create helpful rundowns of various system features and processes to help you better understand the SmartSimple platform.

SmartSimple is continually becoming more robust and enhanced with new features. This sometimes results in the ability to configure the same end functionality through the use of a variety of different techniques. This post will help you decide on the best approach for your situation by discussing different ways to update a field value.

Default Text

This is the simplest way to store a value into a field. Default Text is configured through the custom field settings page for open text input fields such as Text Box - Single Line. This setting works by populating the input field on the form with the specified default value when a field does not already have a value stored in it. This requires the user to save the form to actually save the field value.

Advantages:
  • Simple and efficient.
  • Flexibility offered through custom field configuration. This can be used as a one-time store to prevent users from editing the default field value. This can be hidden/shown on page, or alternatively allow users to edit the default field value.
  • Visibility. Users can see the field and verify the default value before it is actually saved and stored into the field. 

Calculated Value Field

This is a way to update a field based upon an expression that is run on 'page load'. This applies only to the Special - Calculated Value custom field type. This setting is configured using Javascript syntax and works by populating the input field on the form with the specified expression every time the form is loaded. This requires the user to save the form to actually save the field value.

Advantages:
  • Simple and efficient.
  • Complex calculations can be performed via Javascript syntax.
  • Sequential processing. On a page load, each Calculated Value field is evaluated in the order of their display order.
  • Visibility. Users can see the field and verify the default value before it is actually saved and stored into the field.

Value Stores To

This is a way to duplicate a field value and store it into another field. This is configured through the custom field settings page. This setting works by duplicating a field value into another field anytime the first field is saved. This requires the user to save a value into the first field.

Advantages:
  • Simple and efficient
  • Synchronization. In the case that you have multiple fields that represent the same data set, this can be used to synchronize the values between these fields.
  • Transparency (i.e. works behind the scenes).

Template Formula

Template formulas update a field value behind the scenes. They are available in various areas and can be configured through Universal Tracking Application settings page, User Roles, or Company Categories pages. This setting is configured using MySQL syntax and works by directly updating the stored value of a field. This requires the user to save the form and runs after the form is saved thereby referencing the latest field values that were saved.

Advantages:
  • Ability to update different areas other than the form the user is directly on (e.g. a L2 formula can be used to update an L1 field).
  • Server-side validity. This can be used for date/time functions to reference server time at exact time of saving.
  • Complex calculations can be performed via MySQL syntax.
  • Sequential processing. For instance, you can save L3 results in L3 formulas, then L2 formulas, then L1 formulas to be run consecutively. Also, within a template formula block, each individual line is processed consecutively. This enables you to update a field value in one line, and then reference the new field value in the next line.
  • Transparency (i.e. works behind the scenes).

Workflow Update Custom Field Task

This is a way to update a field value behind the scenes. This is configured as a task within a workflow and requires the workflow to be triggered against the object whose field you wish to update.

Advantages:
  • Ability to update different areas other than the form the user is directly on.
  • Server-side validity. This can be used for date/time functions to reference server time at exact time of workflow run time.
  • Inherent audit trail of when the workflow was triggered and who triggered it.
  • Sequential processing (i.e. the ability to process other workflow tasks before or after). Note: while workflow tasks run sequentially, the workflows themselves run asynchronously on the server.
  • Transparency (i.e. works behind the scenes).

Learn more about field values by reading the SmartSimple Wiki. Contact us at info@smartsimple.com or visit our main website  for more information.

Comments

Popular posts from this blog

Introducing 24/5 Technical Support

SmartSimple Attends the Conference Board of Canada’s Corporate Social Responsibility Conference

Dedicated vs. Non-Dedicated Servers – What’s best for me?