Click or drag to resize

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.20.39432
Syntax
public Item getItemById(
	string itemTypeName,
	string id
)

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.
Exceptions
ExceptionCondition
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