Calem Blogs

Blogs of CalemEAM

How to Configure Default Values for Lookup Fields

​Default values can be configured in Calem Enterprise since the beginning. In Calem Enterprise R2019a the default values for lookup fields can also be configured. For instance, the "Unit" field in items table is a lookup field. A default value "EA" (each) can be configured so when you create a new item, the "Unit" field will be filled out with "EA" in the screenshot below. 

The Unit field is a lookup field referencing "Unit of measure" table below. 

The default values are configured in Calem_Home/client/conf/CmConf.custom.js. Customers of cloud service can request Calem to add default values for them. Customers with on-premise deployment may use Admin Guide to add configuration lines. A typical default value is configured by a value field. For instance, a default value for item stock type is a dropdown value. It is default value is configured by a value 'ist_stock' below:

CmMetadata['cm_in']['fields']['stock_type_id']['default']='ist_stock'; 

A lookup field default needs to have both an Id and a value. 

    • "id" is the Id of the lookup record. You may use a browser tool such as "Inspection" of web page to copy the id string from Calem form (use right-click in the caption of a list view to show the Id of a lookup table).
  • "value" is the name of the lookup record
CmMetadata['cm_in']['fields']['uom_id']['default']=
{id: '728d7ad5-4293-79b1-fc25-2de4964a7ee2', value: 'EA'}; 
How to Set Up Vendor Tax Codes
How to Change Asset Items in Assets?

By accepting you will be accessing a service provided by a third-party external to https://calemeam.com/