InnovatorgetItemByKeyedName Method |
Returns an Item object that matches the ItemType name and keyed name for the Item.
Namespace:
Aras.IOM
Assembly:
IOM (in IOM.dll) Version: 14.0.9.36244
Syntaxpublic Item getItemByKeyedName(
string itemTypeName,
string keyedName
)
Public Function getItemByKeyedName (
itemTypeName As String,
keyedName As String
) As Item
public Item getItemByKeyedName(
String itemTypeName,
String keyedName
)
public function getItemByKeyedName(
itemTypeName : String,
keyedName : String
) : Item
Parameters
- itemTypeName
- Type: SystemString
Name of the ItemType. - keyedName
- Type: SystemString
Keyed name for the searched item.
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.
-
Keyed name 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 keyedName="part1";
Item result = myInnovator.getItemByKeyedName( type, keyedName );
string status_msg = string.Empty;
if( result == null )
status_msg = string.Format( "Item of type '{0}' with keyed name '{1}' was not found", type, keyedName );
else if( result.isError() )
status_msg =
string.Format( "Request to find item of type '{0}' with keyed name '{1}' has failed: {2}", type, keyedName, result.getErrorDetail() );
else
status_msg = string.Format( "Item of type '{0}' with keyed name '{1}' was successfully found", type, keyedName );
...
See Also