cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Did you get called away in the middle of writing a post? Don't worry you can find your unfinished post later in the Drafts section of your profile page. X

Does anyone know how to make "No Content" default for some wtDocuments, and have a template automatically selected for others?

tgudobba
14-Alexandrite

Does anyone know how to make "No Content" default for some wtDocuments, and have a template automatically selected for others?

We have a number of wtDocuments that require "No Content" & others that require a template to be selected. Our users continually make the mistake of not selecting the template, and complain why we can't make "No Content" as a default for documents.

ACCEPTED SOLUTION

Accepted Solutions
tgudobba
14-Alexandrite
(To:tgudobba)

Looks like I was able to do this by modifying the documentManagement.js file.

View solution in original post

4 REPLIES 4

Hello Tim,

I believe I have done this before. Let me go through my archived emails and I will share steps with you.

Thanks,

Shirish

Hi Tim,

Wanted to confirm which Windchill release & datecode you are using so I can validate the steps for this perticular release.

Additionally are you also looking for a way to hide "Local File" option from drop down list?

Best Regards,

Shirish

tgudobba
14-Alexandrite
(To:tgudobba)

Looks like I was able to do this by modifying the documentManagement.js file.

Hi Tim,

You can also achieve this using JavaScript. For an example, you can below JavaScript function in "<WT_HOME>\codebase\netmarkets\jsp\document\create.jspf":

<script language="JavaScript">

     PTC.driverAttributes.on("afterRefresh",function() {

          setTimeout(function(){ customPrimaryContent(); }, 100);

     });

     function customPrimaryContent(){

          var element = document.getElementById("createType").value;

          var desiredDoc = "wt.doc.WTDocument";

          var list = document.getElementsByName('___primary0contentSourceList___combobox');

          var fileInput = document.getElementById("primaryFileWidgets");

          if(element.toLowerCase() === desiredDoc.toLowerCase()) {

               list[0].selectedIndex = 0;

               fileInput.style.display = "none";

          } else {

               list[0].selectedIndex = 1;

               fileInput.style.display = "initial";

          }

     }

</script>

By doing this I am able to make "No Content" to Document type. See below:

Thanks,

Shirish

Document Type.png

Announcements


Top Tags