Table of Contents

Class Record

Namespace
Sage.CRM.Data
Assembly
SageCRMNet.dll

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

tableName string

Table Name.

machineName string

Machine Name.

Record(string)

Initializes a new instance of Record.

public Record(string tableName)

Parameters

tableName string

Table Name.

Properties

DeleteRecord

If this is set to true then SaveChanges() will delete the current record.

public bool DeleteRecord { set; }

Property Value

bool

IdField

The name of the field within the table that holds the ID value.

public string IdField { get; }

Property Value

string

OrderBy

Sets "order by" fields for records.

public string OrderBy { get; set; }

Property Value

string

RecordCount

The number of records that the record object is currently pointing at.

public int RecordCount { get; }

Property Value

int

RecordId

A read-only property to get the ID of the current record.

public int RecordId { get; }

Property Value

int

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 string

Name of the field. Must be a date time field.

Returns

DateTime

GetFieldAsDouble(string)

Get field value as a floating point number.

public double GetFieldAsDouble(string fieldName)

Parameters

fieldName string

Field name whose value to retrieve.

Returns

double

GetFieldAsInt(string)

Gets field value from the database as an integer.

public int GetFieldAsInt(string fieldName)

Parameters

fieldName string

Field name whose value to retrieve.

Returns

int

GetFieldAsObject(string)

Gets the value from a field as an object.

public object GetFieldAsObject(string fieldName)

Parameters

fieldName string

The field name whose value to retrieve.

Returns

object

GetFieldAsString(string)

Gets the value from the database for the specified field.

public string GetFieldAsString(string fieldName)

Parameters

fieldName string

The 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 string

The 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 string

Field name of field to update.

fieldValue DateTime

DateTime 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 string

Field name of field to update.

fieldValue double

Floating 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

fieldName string

Field name of field to update.

fieldValue int

Integer value to save in field.

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

fieldName string

Field name of field to update.

fieldValue string

Value to set into field.

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)

Parameters

workflowName string

The name of the workflow as it appears within the Admin workflow configuration screen.

workflowState string

The name of the state within the given workflow in which the record should be saved.