<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How can I know if I am in the Item Record Window or not? in Vault Customization Forum</title>
    <link>https://forums.autodesk.com/t5/vault-customization-forum/how-can-i-know-if-i-am-in-the-item-record-window-or-not/m-p/3288963#M12213</link>
    <description>&lt;P&gt;Unfortunately there is no navigation context for tab views.&amp;nbsp; It's on our list to fix.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you are in Vault 2012, I have a workaround for you.&amp;nbsp; In your OnStartup function, hook to the application.CommandBegin and application.CommandEnd events.&amp;nbsp; When the Item edit window opens, you will get an event for the "Item.Edit" command.&amp;nbsp; When the window closes, you get the end event for the "Item.Edit" command.&amp;nbsp; So the item is in an editable state between these two events.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is what the C# code would look like....&lt;/P&gt;
&lt;P&gt;----------------------------------------------------------------------------&lt;/P&gt;
&lt;P&gt;private bool m_isItemEditable = false;&lt;BR /&gt;public void OnStartup(IApplication application)&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; application.CommandBegin += new EventHandler&amp;lt;CommandBeginEventArgs&amp;gt;(application_CommandBegin);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; application.CommandEnd += new EventHandler&amp;lt;CommandEndEventArgs&amp;gt;(application_CommandEnd);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return; &lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;void application_CommandBegin(object sender, CommandBeginEventArgs e)&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (e.CommandId == "Item.Edit")&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; m_isItemEditable = true;&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;void application_CommandEnd(object sender, CommandEndEventArgs e)&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (e.CommandId == "Item.Edit")&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; m_isItemEditable = false;&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 11 Jan 2012 17:33:54 GMT</pubDate>
    <dc:creator>Redmond.D</dc:creator>
    <dc:date>2012-01-11T17:33:54Z</dc:date>
    <item>
      <title>How can I know if I am in the Item Record Window or not?</title>
      <link>https://forums.autodesk.com/t5/vault-customization-forum/how-can-i-know-if-i-am-in-the-item-record-window-or-not/m-p/3288775#M12212</link>
      <description>&lt;P&gt;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)?&lt;/P&gt;</description>
      <pubDate>Wed, 11 Jan 2012 15:56:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vault-customization-forum/how-can-i-know-if-i-am-in-the-item-record-window-or-not/m-p/3288775#M12212</guid>
      <dc:creator>smilinger</dc:creator>
      <dc:date>2012-01-11T15:56:54Z</dc:date>
    </item>
    <item>
      <title>Re: How can I know if I am in the Item Record Window or not?</title>
      <link>https://forums.autodesk.com/t5/vault-customization-forum/how-can-i-know-if-i-am-in-the-item-record-window-or-not/m-p/3288963#M12213</link>
      <description>&lt;P&gt;Unfortunately there is no navigation context for tab views.&amp;nbsp; It's on our list to fix.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you are in Vault 2012, I have a workaround for you.&amp;nbsp; In your OnStartup function, hook to the application.CommandBegin and application.CommandEnd events.&amp;nbsp; When the Item edit window opens, you will get an event for the "Item.Edit" command.&amp;nbsp; When the window closes, you get the end event for the "Item.Edit" command.&amp;nbsp; So the item is in an editable state between these two events.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is what the C# code would look like....&lt;/P&gt;
&lt;P&gt;----------------------------------------------------------------------------&lt;/P&gt;
&lt;P&gt;private bool m_isItemEditable = false;&lt;BR /&gt;public void OnStartup(IApplication application)&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; application.CommandBegin += new EventHandler&amp;lt;CommandBeginEventArgs&amp;gt;(application_CommandBegin);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; application.CommandEnd += new EventHandler&amp;lt;CommandEndEventArgs&amp;gt;(application_CommandEnd);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return; &lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;void application_CommandBegin(object sender, CommandBeginEventArgs e)&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (e.CommandId == "Item.Edit")&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; m_isItemEditable = true;&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;void application_CommandEnd(object sender, CommandEndEventArgs e)&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (e.CommandId == "Item.Edit")&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; m_isItemEditable = false;&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Jan 2012 17:33:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vault-customization-forum/how-can-i-know-if-i-am-in-the-item-record-window-or-not/m-p/3288963#M12213</guid>
      <dc:creator>Redmond.D</dc:creator>
      <dc:date>2012-01-11T17:33:54Z</dc:date>
    </item>
    <item>
      <title>Re: How can I know if I am in the Item Record Window or not?</title>
      <link>https://forums.autodesk.com/t5/vault-customization-forum/how-can-i-know-if-i-am-in-the-item-record-window-or-not/m-p/3289011#M12214</link>
      <description>&lt;P&gt;Alternate option is to check type name of parent form:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;if (ParentForm != null)&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;{&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Type formType = ParentForm.GetType();&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (formType.Name.Equals("EditCreateForm", StringComparison.InvariantCulture))&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;...&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;}&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Jan 2012 18:02:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vault-customization-forum/how-can-i-know-if-i-am-in-the-item-record-window-or-not/m-p/3289011#M12214</guid>
      <dc:creator>jan.liska</dc:creator>
      <dc:date>2012-01-11T18:02:31Z</dc:date>
    </item>
    <item>
      <title>Re: How can I know if I am in the Item Record Window or not?</title>
      <link>https://forums.autodesk.com/t5/vault-customization-forum/how-can-i-know-if-i-am-in-the-item-record-window-or-not/m-p/3289041#M12215</link>
      <description>&lt;P&gt;Thank you for the reply! I will try these two methods.&lt;/P&gt;</description>
      <pubDate>Wed, 11 Jan 2012 18:12:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vault-customization-forum/how-can-i-know-if-i-am-in-the-item-record-window-or-not/m-p/3289041#M12215</guid>
      <dc:creator>smilinger</dc:creator>
      <dc:date>2012-01-11T18:12:05Z</dc:date>
    </item>
  </channel>
</rss>

