RecordModel class | QSYS API Reference Guide

Estimated reading time: 11 minutes

Defines the RecordModel class

Namespace: ASNA.QSys.Expo.Model Assembly: ASNA.QSys.Expo.Model.dll

Inheritance: Object

Remarks

The class RecordModel Class encapsulates methods, property fields to implement the concept of Record-Level entries for IBM i Display File.

SubfileControlModel and SubfileRecordModel are specialized classes based on RecordModel Class.

The following is a typical use of a class derived from RecordModel Class, which describes - among other things - the Display fields in the record.

[
    Record(FunctionKeys = "F4 04;F6 06:!30;F11 11:!30;F12 12",
        EraseFormats = "SFLC KEYS SALESREC"
    )
]
public class CUSTREC_Model : RecordModel
{
    [Char(10)]
    private string CSRREC
    {
        get => CursorLocationFormatName;
        set { }
    }

    [Char(10)]
    private string CSRFLD
    {
        get => CursorLocationFieldName;
        set { }
    }

    [Char(10)]
    public string SCPGM { get; private set; }

    [Dec(6, 0)]
    public decimal SFCUSTNO { get; private set; } // CUSTOMER NUMBER

    [Char(40)]
    public string SFOLDNAME { get; private set; }

    [Char(40)]
    public string SFNAME { get; set; }

    [Char(35)]
    public string SFADDR1 { get; set; }

    [Char(35)]
    public string SFADDR2 { get; set; }

    [Char(30)]
    public string SFCITY { get; set; }

    [Char(2)]
    public string SFSTATE { get; set; }

    [Char(10)]
    public string SFPOSTCODE { get; set; }

    [Dec(10, 0)]
    public decimal SFFAX { get; set; }

    [Char(20)]
    public string SFPHONE { get; set; }

    [Char(1)]
    public string SFSTATUS { get; set; }

    [Char(40)]
    public string SFCONTACT { get; set; }

    [Char(40)]
    public string SFCONEMAL { get; set; }

    [Char(1)]
    public string SFYN01 { get; set; }
}

Properties

Type Name Description
AidProperty AttnKeys Gets or sets the Attention Keys AID Property
String BlueDirection Internal use - Record direction code.
String CursorLocationFieldName Gets or sets the Cursor Location Field Name
String CursorLocationFormatName Gets or sets the Cursor Location Format Name
AidProperty FuncKeys Gets or sets the Function Keys AID Property
Boolean IsActive Gets a boolean value indicating that the Record is active

Methods

Signature Description
AddErrorMessage(String, String) Adds an Error Message to the list of Validation errors
GetMessageText(String, String, Int32, String) Gets a string value with the text corresponding to the message requested.
GetOptionIndicator(Int32) Gets the option indicator value.
GetOptionIndicators() Gets a copy of the array of option indicators.
GetResponseIndicator(Int32) Gets the response indicator value. May be ‘0’, ‘1’ or ‘X’.
GetResponseIndicators() Gets a copy of the response indicators.
IsFalse(String) Gets the resulting value of the evaluation of condition using the optionIndicators.
IsNotFalse(String) Gets the resulting value of the evaluation of condition using the optionIndicators.
IsNotTrue(String) Gets a boolean value indicating the result of evaluation of the condition using the optionIndicators.
IsTrue(String) Gets the resulting value of the evaluation of the condition using the optionIndicators.
ProcessErrorMessages(String, String, ConditionalProperty, ConditionalProperty) Process Error Message for a field in a record if the condition succeeds
ResolveConditionalProperty(String) Gets a string value that indicates the result of the condition in the property given as a string
ResolveConditionalProperty(ConditionalProperty) Gets a string value that indicates the result of the condition in the property given
SetOptionIndicator(Int32, Boolean) Sets the option indicator value.
SetResponseIndicator(Int32, Char) Sets the response indicator value.
WasRecordPosted(String) Gets a boolean value that indicates if the Record was posted

void AddErrorMessage(string errorMessageInfo, string fieldNameID)

Adds an Error Message to the list of Validation errors

void AddErrorMessage(string errorMessageInfo, string fieldNameID)

Parameters

Type Parameter name Description
String errorMessageInfo error information
String fieldNameID field name ID

string GetMessageText(string messageFileName, string messageId, int maxLength, string replacementText)

Gets a string value with the text corresponding to the message requested.

string GetMessageText(string messageFileName, string messageId, int maxLength, string replacementText)

Parameters

Type Parameter name Description
String messageFileName Message filename
String messageId Message ID
Int32 maxLength Maximum chars to copy
String replacementText data to use for replacment text place holders in message, defaults to empty.

Returns

Type Description
String The Message text

bool GetOptionIndicator(int indicator)

Gets the option indicator value.

bool GetOptionIndicator(int indicator)

Parameters

Type Parameter name Description
Int32 indicator 1 … 99

Returns

Type Description
Boolean Boolean value

Boolean[] GetOptionIndicators()

Gets a copy of the array of option indicators.

Boolean[] GetOptionIndicators()

char GetResponseIndicator(int indicator)

Gets the response indicator value. May be ‘0’, ‘1’ or ‘X’.

char GetResponseIndicator(int indicator)

Parameters

Type Parameter name Description
Int32 indicator 1 … 99

Returns

Type Description
Char Char value.

Char[] GetResponseIndicators()

Gets a copy of the response indicators.

Char[] GetResponseIndicators()

bool IsFalse(string condition)

Gets the resulting value of the evaluation of condition using the optionIndicators.

bool IsFalse(string condition)

Parameters

Type Parameter name Description
String condition conditional expression

Returns

Type Description
Boolean Return true only if there is no doubt about it. If anything goes wrong, return false

bool IsNotFalse(string condition)

Gets the resulting value of the evaluation of condition using the optionIndicators.

bool IsNotFalse(string condition)

Parameters

Type Parameter name Description
String condition conditional expression

Returns

Type Description
Boolean Return true only if there is no doubt about it. If anything goes wrong, return false

bool IsNotTrue(string condition)

Gets a boolean value indicating the result of evaluation of the condition using the optionIndicators.

bool IsNotTrue(string condition)

Parameters

Type Parameter name Description
String condition conditional expression

Returns

Type Description
Boolean Return false only if there is no doubt about it. If anything goes wrong, return true

bool IsTrue(string condition)

Gets the resulting value of the evaluation of the condition using the optionIndicators.

bool IsTrue(string condition)

Parameters

Type Parameter name Description
String condition conditional expression

Returns

Type Description
Boolean false only if there is no doubt about it. If anything goes wrong, return true

bool ProcessErrorMessages(string recordName, string fieldNameID, ConditionalProperty errorMessage, ConditionalProperty errorMessageId)

Process Error Message for a field in a record if the condition succeeds

bool ProcessErrorMessages(string recordName, string fieldNameID, ConditionalProperty errorMessage, ConditionalProperty errorMessageId)

Parameters

Type Parameter name Description
String recordName name of record
String fieldNameID field ID
ConditionalProperty errorMessage error message
ConditionalProperty errorMessageId error message ID

Returns

Type Description
Boolean true if error condition and error message was added to the validation error collection

string ResolveConditionalProperty(string conditionalPropertyString)

Gets a string value that indicates the result of the condition in the property given as a string

string ResolveConditionalProperty(string conditionalPropertyString)

Parameters

Type Parameter name Description
String conditionalPropertyString conditional property string

Returns

Type Description
String The value corresponding to the condition

string ResolveConditionalProperty(ConditionalProperty conditionalProperty)

Gets a string value that indicates the result of the condition in the property given

string ResolveConditionalProperty(ConditionalProperty conditionalProperty)

Parameters

Type Parameter name Description
ConditionalProperty conditionalProperty conditional property string

Returns

Type Description
String The value corresponding to the condition

void SetOptionIndicator(int indicator, bool newValue)

Sets the option indicator value.

void SetOptionIndicator(int indicator, bool newValue)

Parameters

Type Parameter name Description
Int32 indicator  
Boolean newValue  

void SetResponseIndicator(int indicator, char newValue01X)

Sets the response indicator value.

void SetResponseIndicator(int indicator, char newValue01X)

Parameters

Type Parameter name Description
Int32 indicator 1 … 99
Char newValue01X New value, may be ‘0’, ‘1’ or ‘X’

bool WasRecordPosted(string recordName)

Gets a boolean value that indicates if the Record was posted

bool WasRecordPosted(string recordName)

Parameters

Type Parameter name Description
String recordName name of the Record to check

Returns

Type Description
Boolean true is the Record was posted