InnovatorgetItemById Method |
Returns an Item object that matches the ItemType name and ID for the Item.
Namespace:
Aras.IOM
Assembly:
IOM (in IOM.dll) Version: 14.0.9.36244
Syntaxpublic Item getItemById(
string itemTypeName,
string id
)
Public Function getItemById (
itemTypeName As String,
id As String
) As Item
public Item getItemById(
String itemTypeName,
String id
)
public function getItemById(
itemTypeName : String,
id : String
) : Item
Parameters
- itemTypeName
- Type: SystemString
Name of the ItemType. - id
- Type: SystemString
Item's ID.
Return Value
Type:
Item
If request to the server failed the method returns an "error" item; if no item with specified type and id
found in the database the method returns 'null'; otherwise the method returns the found item.
ExceptionsException | Condition |
---|
ArgumentException | -
Item type is not specified.
-
Item ID is not specified.
|
Remarks
The method sends a request to Innovator server in order to find the required item.
Examples
C#
...
string type = "Part";
string id = "01234567890123456789012345678901";
Item result = myInnovator.getItemById( type, id );
string status_msg = string.Empty;
if( result == null )
status_msg = string.Format( "Item of type '{0}' with id '{1}' was not found", type, id );
else if( result.isError() )
status_msg =
string.Format( "Request to find item of type '{0}' with id '{1}' has failed: {2}", type, id, result.getErrorDetail() );
else
status_msg = string.Format( "Item of type '{0}' with id '{1}' was successfully found", type, id );
...
See Also