I am trying to add new Items to Vault 2013 Professional through the API.
It seems like I need to use the itemSvc.AddItemNumbers() method to assign the Item Number that I want to my new Item.
That method needs a parameter called numberingSchemeId. Our Item numbering schema is called "Mapped" and is the default item numbering schema.
How can I obtain the ID for this numbering scheme?
Solved! Go to Solution.
Solved by Redmond.D. Go to Solution.
Call GetNumberingSchemesByType and loop through the results until you find the NumSchm object that you want. From your message, it sounds like you are looking for the scheme where Name == "Mapped" or the scheme where IsDflt == true.
Thanks Doug, that seems to work:
//==============================================
private long GetItemNumberingSchemeID(string schemaName)
{
long sId = 0;
NumSchm[] allSchemes = itemSvc.GetNumberingSchemesByType(NumSchmType.All);
foreach (var schema in allSchemes)
{
if(schema.Name == schemaName)
{
sId = schema.SchmID;
break;
}
}
return sId;
}
Can't find what you're looking for? Ask the community or share your knowledge.