Class Record
Used to create and update records from CRM tables. FindRecord(string, string) CreateRecord(string)
public class Record : IDisposable
- Inheritance
-
Record
- Implements
- Derived
- Inherited Members
Constructors
Record(string, string)
Initializes a new instance of Record.
public Record(string tableName, string machineName)
Parameters
Record(string)
Initializes a new instance of Record.
public Record(string tableName)
Parameters
tableName
stringTable Name.
Properties
DeleteRecord
If this is set to true then SaveChanges() will delete the current record.
public bool DeleteRecord { set; }
Property Value
IdField
The name of the field within the table that holds the ID value.
public string IdField { get; }
Property Value
OrderBy
Sets "order by" fields for records.
public string OrderBy { get; set; }
Property Value
RecordCount
The number of records that the record object is currently pointing at.
public int RecordCount { get; }
Property Value
RecordId
A read-only property to get the ID of the current record.
public int RecordId { get; }
Property Value
Methods
Dispose()
public void Dispose()
Eof()
Used to check if there are any records remaining.
public bool Eof()
Returns
- bool
true/false
~Record()
Disposes of a Record object.
protected ~Record()
GetFieldAsDateTime(string)
Gets the value from the database as a datetime.
public DateTime GetFieldAsDateTime(string fieldName)
Parameters
fieldName
stringName of the field. Must be a date time field.
Returns
GetFieldAsDouble(string)
Get field value as a floating point number.
public double GetFieldAsDouble(string fieldName)
Parameters
fieldName
stringField name whose value to retrieve.
Returns
GetFieldAsInt(string)
Gets field value from the database as an integer.
public int GetFieldAsInt(string fieldName)
Parameters
fieldName
stringField name whose value to retrieve.
Returns
GetFieldAsObject(string)
Gets the value from a field as an object.
public object GetFieldAsObject(string fieldName)
Parameters
fieldName
stringThe field name whose value to retrieve.
Returns
GetFieldAsString(string)
Gets the value from the database for the specified field.
public string GetFieldAsString(string fieldName)
Parameters
fieldName
stringThe field name whose value to retrieve.
Returns
- string
The String value or Empty String
GetFieldAsStringOrNull(string)
Gets the value from the database for the specified field. This function was add for keep the compatibility with 1.0 version and instead of convert the COM result to String it will try to cast and may return null for empty strings.
public string GetFieldAsStringOrNull(string fieldName)
Parameters
fieldName
stringThe field name whose value to retrieve.
Returns
- string
Returns the String value or null if the value is empty
GoToFirst()
Reopens the query so it is pointing at the first record in the original query.
public void GoToFirst()
GoToNext()
Moves to the next record if the original query selected more than 1 record.
public void GoToNext()
SaveChanges()
Updates the database with the new or updated values (as set by SetField). If this object was created with a FindXX method then that record will be updated. If this object was created with a NewXX method then a new record will be inserted.
public void SaveChanges()
SaveChangesNoTLS()
Updates the database with the new or updated values (as set by SetField). Prevents the triggering of table level scripts for the entity in question.
public void SaveChangesNoTLS()
SetField(string, DateTime)
An overload to set a datetime value into a field. Values are stored and saved when SaveChanges is called.
public void SetField(string fieldName, DateTime fieldValue)
Parameters
fieldName
stringField name of field to update.
fieldValue
DateTimeDateTime value to save in field.
SetField(string, double)
An overload to set a floating point value into a field. Values are stored and saved when SaveChanges is called.
public void SetField(string fieldName, double fieldValue)
Parameters
fieldName
stringField name of field to update.
fieldValue
doubleFloating point value to save in field.
SetField(string, int)
An overload to set an integer value into a field. Values are stored and saved when SaveChanges is called.
public void SetField(string fieldName, int fieldValue)
Parameters
SetField(string, string)
An overload to set a text value into a field. Values are stored and saved when SaveChanges is called.
public void SetField(string fieldName, string fieldValue)
Parameters
SetWorkflowInfo(string, string)
Specifies what workflow state the record should be in when it is saved. Values are stored and applied when SaveChanges is called.
public void SetWorkflowInfo(string workflowName, string workflowState)