Autodesk Vault Customization
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
How can I know if I am in the Item Record Window or not?
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
If I add a detail tab for items, it will show in both Item master and the Item Record window (right click and select Edit), is there any attribute in the context or sth. so that I can realize whether I am in the Item Record window (where the item is already editable) or not (where I must call EditItems to get it editable)?
Solved! Go to Solution.
Re: How can I know if I am in the Item Record Window or not?
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Unfortunately there is no navigation context for tab views. It's on our list to fix.
If you are in Vault 2012, I have a workaround for you. In your OnStartup function, hook to the application.CommandBegin and application.CommandEnd events. When the Item edit window opens, you will get an event for the "Item.Edit" command. When the window closes, you get the end event for the "Item.Edit" command. So the item is in an editable state between these two events.
Here is what the C# code would look like....
--------------------------------------------------
private bool m_isItemEditable = false;
public void OnStartup(IApplication application)
{
application.CommandBegin += new EventHandler<CommandBeginEventArgs>(application_Co
application.CommandEnd += new EventHandler<CommandEndEventArgs>(application_Comm
return;
}
void application_CommandBegin(object sender, CommandBeginEventArgs e)
{
if (e.CommandId == "Item.Edit")
m_isItemEditable = true;
}
void application_CommandEnd(object sender, CommandEndEventArgs e)
{
if (e.CommandId == "Item.Edit")
m_isItemEditable = false;
}
Re: How can I know if I am in the Item Record Window or not?
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Alternate option is to check type name of parent form:
if (ParentForm != null)
{
Type formType = ParentForm.GetType();
if (formType.Name.Equals("EditCreateForm", StringComparison.InvariantCulture))
{
...
}
}

Jan Liska
Technical Consultant
Autodesk, Inc.
Re: How can I know if I am in the Item Record Window or not?
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Thank you for the reply! I will try these two methods.

