Skip to main content
13-Aquamarine
October 23, 2023
Solved

Script to create a Change Request is no longer working for me...

  • October 23, 2023
  • 1 reply
  • 1465 views

I have some script that has been working for months...

 

String varName = <some text>;
String varDesc = <some text>;

<some code>

wt.change2.WTChangeRequest2 cr = wt.change2.WTChangeRequest2.newWTChangeRequest2();
cr.setName(varName);
cr.setDescription(varDesc);

<more code>

cr = (wt.change2.WTChangeRequest2) wt.fc.PersistenceHelper.manager.save(cr);

 

The result was a new Change Request with my preset field values for my business case.  As of today, this code fails on the cr.setDescription() call with the following message:

 

Message: Resource bundle/Message key = wt.introspection.introspectionResource/21

 

I haven't found any reason or solution yet... but I am assuming someone has.  Anyone have some ideas?

 

 

 

Best answer by HelesicPetr

Hi @BjoernRueegg 

In Windchill 12.0.0.0 is still possible to use setDescription(String)

WTIntrospectionException exception is thrown if the string is longer then 4000 characters

HelesicPetr_0-1698132953719.png

and the error message 21 is: 

HelesicPetr_1-1698133201099.png

 

It seams that string is null

 

PetrH

 

1 reply

17-Peridot
October 24, 2023

Between 11.1 and 12.0 (I belief) the description field changed from a normal text field to a WYSIWYG field. Perhaps you can't set the description field anymore with setDescription(String string) rather than using the function setLongDescription(HTMLText htmlText)?

HelesicPetr
22-Sapphire II
22-Sapphire II
October 24, 2023

Hi @BjoernRueegg 

In Windchill 12.0.0.0 is still possible to use setDescription(String)

WTIntrospectionException exception is thrown if the string is longer then 4000 characters

HelesicPetr_0-1698132953719.png

and the error message 21 is: 

HelesicPetr_1-1698133201099.png

 

It seams that string is null

 

PetrH

 

RFS13-AquamarineAuthor
13-Aquamarine
October 24, 2023

It wasn't null, but it was empty and that caused it.  Thanks for the message details.