Returns an Item object that matches the ItemType name and ID for the Item.

Namespace:  Aras.IOM
Assembly:  IOM (in IOM.dll) Version: 11.0.0.6296

Syntax

C#
public Item getItemById(
	string itemTypeName,
	string id
)
Visual Basic (Declaration)
Public Function getItemById ( _
	itemTypeName As String, _
	id As String _
) As Item
J#
public Item getItemById(
	String itemTypeName,
	String id
)
JScript
public function getItemById(
	itemTypeName : String, 
	id : String
) : Item

Parameters

itemTypeName
Type: System..::.String
Name of the ItemType.
id
Type: System..::.String
Item's ID.

Return Value

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.

Remarks

The method sends a request to Innovator server in order to find the required item.

Examples

C#
CopyC#
...
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 );
...

Exceptions

ExceptionCondition
System..::.ArgumentException
  • Item type is not specified.
  • Item ID is not specified.

See Also