Reads a single record.
Note |
The signature of an operation changes if the page contains one
or more unbound fields in the root content area. If there are
unbound fields, then the names from the SourceExpr
property for the unbound fields are added as the first parameters
to the operation. They are added according to the tab order of the
page. For an example, see the Item Journal.
|
Parameters
Parameter |
Description |
no
|
Type: String
The primary key of the requested record.
This argument is a filter on the primary key and returns the
first record that matches the filter. When special characters, such
as an apostrophe, equal sign, or ampersand, are part of the key,
you must surround the argument with quotation marks.
For example, when writing C# code, in addition to standard
quotation marks for strings, you should also provide additional
single quotes around a value, such as "'A&B'" .
|
Results
Result name |
Description |
entity
|
Type: 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 with the given primary key does not exist, then no
value is returned. In .NET, a null reference will be returned.
|
Faults
This operation does not return a fault when a matching record is
not present. Instead, it returns no value. In C#, you should test
if the result is a null reference. Otherwise, you may get a
NullReferenceException exception.
Faults are possible if they are generated by the C/AL code.
Usage Example
C# |
Copy Code |
Customer cust = new Customer();
cust.Name = "Customer Name";
service.Create(ref cust);
cust = service.Read(cust.No);
|
See Also