ReadByRecId Operation

Reads the record that is identified by the record ID.

Method Signature

Entity ReadByRecId(string formattedRecId)

Parameters

ParameterDescription
formattedRecIdType: String

The RecId that is used to read the record.

Results

Result nameDescription
entityType: Entity

A variable of a specific object type that represents the page. Contains the latest values that are present on the page.

If the record is not found, then the operation returns null.

Faults

This operation does not return a fault when a matching record is not present. Instead, it returns null. In C#, you should test whether the result is a null reference. Otherwise, you may get a NullReferenceException exception.Faults are possible if they are generated by the AL code.

Usage Example

public void ReadById(String id)
{
  Customer_Service service = new Customer_Service();
  Customer cust = new Customer();
  service.UseDefaultCredentials = true;
  cust = service.ReadByRecId(id.ToUpper());
}

Basic Page Operations