SystemConstant.SelectById(ID, Query).Save()

Saves the system constant that is stored locally in an object.

Applies To

Description

Saves the system constant that is stored locally in an object. When the system constant is saved, Deacom will automatically update the dxmod table for the system constant.

Note: Do not write continuous logs to a system constant. If you plan to write a log to a system constant, just save the most recent log value in the constant. Because Deacom is automatically updating the modifications table, you can retrieve log history from there. If you write a continuous log to a system constant, eventually, you will explode your modifications table as that table will store the entire old log plust the new log in the old memo and new memo fields. We have seen instances where users' modification table was 40GB in size and the entire rest of their database was ~20GB.

Properties and Methods

None

Available

The .Save() method is available in:

  • 15.03.090
  • 15.04.059
  • 15.05.034
  • 16.00.039
  • 16.01.011
  • 16.02.004
  • 16.03.001
  • All newer builds

Type

Method

Syntax

SystemConstant.SelectById(ID, Query).Save();

Parameters

None

Example

//--Get the system constant

let loConstant = SystemConstant.SelectByID(5, Query);

 

loConstant.co_notes = 'This is a note for my system constant. It will overwrite what is already there.';

//--Save the constant

loConstant.Save();

//--get the co_notes value

let lcNotes = loConstant.co_notes;

Event.Form.MessageBox(`The co_notes text is:\n${lcNotes}`);

 

/*

Expected prompt result is:

The co_notes text is:

This is a note for my system constant. It will overwrite what is already there.

*/