<?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 How to get correct DocumentID right after Requirement creation in a trigger? in Systems/Software Engineering</title>
    <link>https://www.ptcusercommunity.com/t5/Systems-Software-Engineering/How-to-get-correct-DocumentID-right-after-Requirement-creation/m-p/926533#M7995</link>
    <description>&lt;P&gt;Hello team,&lt;/P&gt;&lt;P&gt;How to get correct DocumentID right after Requirement creation in a trigger?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="001.png" style="width: 740px;"&gt;&lt;img src="https://www.ptcusercommunity.com/t5/image/serverpage/image-id/97114i7425609B7ED232B0/image-dimensions/740x161?v=v2" width="740" height="161" role="button" title="001.png" alt="001.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;very simple code returns 0&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;theRequirementDocumentID = delta.getDocumentID();&lt;BR /&gt;print("*** Requirement Document ID for " + delta.getType() + " " + delta.getID() + " is: " + delta.getDocumentID());&lt;/P&gt;&lt;P&gt;After second Text edit it goes ok though.&lt;/P&gt;&lt;P&gt;But I need to get DocID right after Requirement creation.&lt;/P&gt;&lt;P&gt;Problem in trigger Rule definition?&lt;/P&gt;&lt;P&gt;Now set as Type = New [Requirement]&lt;/P&gt;&lt;P&gt;Many thanks,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 29 Jan 2024 14:11:41 GMT</pubDate>
    <dc:creator>AN_10548594</dc:creator>
    <dc:date>2024-01-29T14:11:41Z</dc:date>
    <item>
      <title>How to get correct DocumentID right after Requirement creation in a trigger?</title>
      <link>https://www.ptcusercommunity.com/t5/Systems-Software-Engineering/How-to-get-correct-DocumentID-right-after-Requirement-creation/m-p/926533#M7995</link>
      <description>&lt;P&gt;Hello team,&lt;/P&gt;&lt;P&gt;How to get correct DocumentID right after Requirement creation in a trigger?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="001.png" style="width: 740px;"&gt;&lt;img src="https://www.ptcusercommunity.com/t5/image/serverpage/image-id/97114i7425609B7ED232B0/image-dimensions/740x161?v=v2" width="740" height="161" role="button" title="001.png" alt="001.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;very simple code returns 0&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;theRequirementDocumentID = delta.getDocumentID();&lt;BR /&gt;print("*** Requirement Document ID for " + delta.getType() + " " + delta.getID() + " is: " + delta.getDocumentID());&lt;/P&gt;&lt;P&gt;After second Text edit it goes ok though.&lt;/P&gt;&lt;P&gt;But I need to get DocID right after Requirement creation.&lt;/P&gt;&lt;P&gt;Problem in trigger Rule definition?&lt;/P&gt;&lt;P&gt;Now set as Type = New [Requirement]&lt;/P&gt;&lt;P&gt;Many thanks,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 29 Jan 2024 14:11:41 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Systems-Software-Engineering/How-to-get-correct-DocumentID-right-after-Requirement-creation/m-p/926533#M7995</guid>
      <dc:creator>AN_10548594</dc:creator>
      <dc:date>2024-01-29T14:11:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to get correct DocumentID right after Requirement creation in a trigger?</title>
      <link>https://www.ptcusercommunity.com/t5/Systems-Software-Engineering/How-to-get-correct-DocumentID-right-after-Requirement-creation/m-p/927326#M7996</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://www.ptcusercommunity.com/t5/user/viewprofilepage/user-id/656492"&gt;@AN_10548594&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;"Document ID" field is being calculated after creation of an item.&lt;/P&gt;&lt;P&gt;Try to execute your logic in a "Post" trigger which will run after your new requirement is saved to DB.&lt;/P&gt;</description>
      <pubDate>Wed, 31 Jan 2024 17:49:06 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Systems-Software-Engineering/How-to-get-correct-DocumentID-right-after-Requirement-creation/m-p/927326#M7996</guid>
      <dc:creator>Karol_Arorian</dc:creator>
      <dc:date>2024-01-31T17:49:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to get correct DocumentID right after Requirement creation in a trigger?</title>
      <link>https://www.ptcusercommunity.com/t5/Systems-Software-Engineering/How-to-get-correct-DocumentID-right-after-Requirement-creation/m-p/927345#M7997</link>
      <description>&lt;P&gt;Hi pal,&lt;/P&gt;&lt;P&gt;Thanks for help!&lt;/P&gt;&lt;P&gt;I can't use post trigger as i'm going to modify my requirement.&lt;/P&gt;&lt;P&gt;I'm trying to set computed upstream and downstream object names in custom fields to make them look nicer in Excel.&lt;/P&gt;&lt;P&gt;Anyway in my case the solution could be the fact that a computed number should have a version number as a postfix. That means to make it all work user should hit F3 on content to create a mior or major version. After that all triggers are ok to run.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 31 Jan 2024 19:30:54 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Systems-Software-Engineering/How-to-get-correct-DocumentID-right-after-Requirement-creation/m-p/927345#M7997</guid>
      <dc:creator>AN_10548594</dc:creator>
      <dc:date>2024-01-31T19:30:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to get correct DocumentID right after Requirement creation in a trigger?</title>
      <link>https://www.ptcusercommunity.com/t5/Systems-Software-Engineering/How-to-get-correct-DocumentID-right-after-Requirement-creation/m-p/927409#M7998</link>
      <description>&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Hi&amp;nbsp;&lt;a href="https://www.ptcusercommunity.com/t5/user/viewprofilepage/user-id/656492"&gt;@AN_10548594&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;There is possibility to modify item in post trigger by using CLI commands instead of trigger API.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;It's not very sophisticated and recommended and you need to be careful with that but sometimes there is no other way to achieve the goal.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Here is an example of command execution in script, you can find more options in the documentation.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var apiSession = environmentBean.createAPISessionBean();
var runner = apiSession.createAPICommandRunnerBean();
runner.setCommand("im", "&amp;lt;command&amp;gt;");
runner.execute();&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Using "Document ID" field with versioning is quite risky as it could be not available for versioned item (usually it's there only for live items).&lt;/P&gt;</description>
      <pubDate>Thu, 01 Feb 2024 08:06:56 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Systems-Software-Engineering/How-to-get-correct-DocumentID-right-after-Requirement-creation/m-p/927409#M7998</guid>
      <dc:creator>Karol_Arorian</dc:creator>
      <dc:date>2024-02-01T08:06:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to get correct DocumentID right after Requirement creation in a trigger?</title>
      <link>https://www.ptcusercommunity.com/t5/Systems-Software-Engineering/How-to-get-correct-DocumentID-right-after-Requirement-creation/m-p/927411#M7999</link>
      <description>&lt;P&gt;Thanks a lot again!&lt;/P&gt;&lt;P&gt;Very usefull and seems like a solution for my case.&lt;/P&gt;&lt;P&gt;Will check and let you know,&lt;/P&gt;&lt;P&gt;PS. Hi )))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Feb 2024 08:10:30 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Systems-Software-Engineering/How-to-get-correct-DocumentID-right-after-Requirement-creation/m-p/927411#M7999</guid>
      <dc:creator>AN_10548594</dc:creator>
      <dc:date>2024-02-01T08:10:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to get correct DocumentID right after Requirement creation in a trigger?</title>
      <link>https://www.ptcusercommunity.com/t5/Systems-Software-Engineering/How-to-get-correct-DocumentID-right-after-Requirement-creation/m-p/927653#M8001</link>
      <description>&lt;P&gt;Hi again,&lt;/P&gt;&lt;P&gt;And this is what TS says about this:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;"The document ID is stored in a field named Document ID.&amp;nbsp;When a new item is created, the value of the Document ID field hasn't been commited yet during the PRE trigger phase.&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;To get the document ID of a newly created item in a PRE Trigger, use the&lt;FONT face="arial black,avant garde"&gt; &lt;STRONG&gt;getNewFieldValue("Document ID")&lt;/STRONG&gt; &lt;/FONT&gt;method on the ScriptIssueDeltaBean."&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Regards&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Feb 2024 06:22:55 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Systems-Software-Engineering/How-to-get-correct-DocumentID-right-after-Requirement-creation/m-p/927653#M8001</guid>
      <dc:creator>AN_10548594</dc:creator>
      <dc:date>2024-02-02T06:22:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to get correct DocumentID right after Requirement creation in a trigger?</title>
      <link>https://www.ptcusercommunity.com/t5/Systems-Software-Engineering/How-to-get-correct-DocumentID-right-after-Requirement-creation/m-p/927766#M8002</link>
      <description>&lt;P&gt;And this is wrong answer from TS&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Feb 2024 15:18:40 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Systems-Software-Engineering/How-to-get-correct-DocumentID-right-after-Requirement-creation/m-p/927766#M8002</guid>
      <dc:creator>AN_10548594</dc:creator>
      <dc:date>2024-02-02T15:18:40Z</dc:date>
    </item>
  </channel>
</rss>

