2 Replies Latest reply: Sep 20, 2012 11:47 AM by Segal RSS

    Reference Object for Nav button

      We need to dynamically pass the SAPMM Equivalent to a url in a new toolbar button.
      I found in the Navigation manual the example for referencing active objects:
      Referencing the Active Object
      Some out of the box JavaScript functions are available so you can pull the active object’s identity information. These can be used to directly attach to a URL or even to supplement code extensions. For example, you can grab the object’s pkid and use it inside custom code to pull additional data from the specification

      GetObjectHeader_ObjectPKID()      Pulls the active object’s pkid
      GetObjectHeader_ObjectTitle()      Pulls the active object’s title. This can be up to 256 characters.
      GetObjectHeader_ObjectType()      Pulls the active object’s type and returns it in number format. For example 1004 is a material specification

      Example 1: Opening a popup window and appending the pkid to a URL
      <MenuItem ID="lblNewMenuItem" DisplayText="NavB" TranslationRef="ApplicationMenu"
      ClientSideCommand="window.open('${dc:GSM}/getspec.aspx?SpecID=' + GetObjectHeader_ObjectPKID(), 'mywindow','height=350,width=400,status=no,toolbar=no,menubar=no,location=no,dependent=yes,scrollbars=yes');"/>

      I have created a new toolbar button in GSM for Trade Specs using the Navigation extensions in SiteMap-Extensions.xml as follows:

      <MenuItem ID="GSMNavSpec" configChildKey="ID">
           <MenuItem MenuType="icon" ID="lblPrintView" DisplayText="PrintView" SecurityProfileRef="" Visible="eval:${ObjectType}==2147" ClientSideCommand="window.open('http://workflow-dev.tyson.com/MDRSServices/GetOfficalProductSpecDocument.ashx?SapMaterialNumber=*005120-0928'*,'PrintView','height=350,width=400,status=no,toolbar=no,menubar=no,location=no,dependent=yes,scrollbars=yes');" />

      Can you please tell us how to reference the SAPMM Equivalent?