PLM 360 General

Reply
Mentor
dkeeley
Posts: 214
Registered: ‎10-04-2012
Message 1 of 9 (237 Views)

Advanced Print View Script Problem

237 Views, 8 Replies
03-21-2013 04:05 PM

Hi,

 

I have a test script that I use to send an email containing an advanced print view to a all the members of a group. When I try and run the script I get a script timeout error message (the group contains two members). I have attached the error message. The script is as follows;

 

var email = new Email();
email.subject = 'Emergency Problem Report Notification';
//email.body = 'Test';
email.body = getPrintView('Emergency Email');
var users = Security.listUsersInGroup('ST Test');
for (var index in users) {
    email.to = users[index].email;
    //email.to = '[personal]@hotmail.com';
    email.send();
}

 

When I reduce the number of members in the group to 1 person the script works fine. I have tried making the following changes to begus the script but it continues to fail;

 

- change the group members

- change the advanced print view

- change the test dmsID

 

It seems that I cannot get the script to send the advanced print view to more than one person.

 

When I change the email body from an advanced print view to a text body the script runs fine and sends the email to all group members;

 

var email = new Email();
email.subject = 'Emergency Problem Report Notification';
email.body = 'Test';
//email.body = getPrintView('Responsible Person Email');
var users = Security.listUsersInGroup('ST Test');
for (var index in users) {
    email.to = users[index].email;
    //email.to = '[personal]@hotmail.com';
    email.send();
}

 

Please can you assist?

 

 

Product Support
mazerab
Posts: 203
Registered: ‎11-20-2012
Message 2 of 9 (210 Views)

Re: Advanced Print View Script Problem

03-22-2013 10:13 AM in reply to: dkeeley

Hi, 

 

I have not been able to reproduce the script error with a group of 4 users using an advanced print view found in my Items and BOMs workspace. Testing the action script showed that it executed successfully.

 

Is your advanced print view very complex? Could you try to call the advanced print view from one of your item and see if that works outside of the scripting environment? Could there be something unique about the group? I understand you have tried changing various parameters but not sure if you have tried changing the group itself. Also please look into whether issue is reproducible in another browser.



Bastien Mazeran
Support Specialist
Product Support
Autodesk, Inc.
Mentor
dkeeley
Posts: 214
Registered: ‎10-04-2012
Message 3 of 9 (207 Views)

Re: Advanced Print View Script Problem

03-22-2013 01:16 PM in reply to: mazerab

Hi Bastien,

 

I performed the following further tests. In each instance I continue to get the same script timeout error.

 

1. I tested the script in IE, Firefox & Chrome

2. I tried using two different users in the group

3. I tried using a completely different group

4. I tried using a very simple test advanced print view (see attached image 'Simple APV)

 

I also checked to see if I can generate the print views within the item view by pressing 'print' (i.e. outside of scripting). In each case the print view generated correctly and without any problem.

 

Regards,

 

David

Mentor
dkeeley
Posts: 214
Registered: ‎10-04-2012
Message 4 of 9 (181 Views)

Re: Advanced Print View Script Problem

04-06-2013 08:33 AM in reply to: dkeeley
Hi,

Any updates on this?

David
Product Support
mazerab
Posts: 203
Registered: ‎11-20-2012
Message 5 of 9 (172 Views)

Re: Advanced Print View Script Problem

04-08-2013 10:51 AM in reply to: dkeeley

Hi David,

No updates at this present time. I will follow-up and update you as soon as possible.

Thank you.



Bastien Mazeran
Support Specialist
Product Support
Autodesk, Inc.
Product Support
mazerab
Posts: 203
Registered: ‎11-20-2012
Message 6 of 9 (168 Views)

Re: Advanced Print View Script Problem

04-08-2013 12:21 PM in reply to: mazerab

Hi David,

 

Upon further review of your script, we believe we found an issue. Could you please try this new script instead and let me know if that works better for you? Notice the + sign for append in the if / else loop within the for loop.

 

var email = new Email();
email.subject = 'Emergency Problem Report Notification';
email.body = getPrintView('Emergency Email');
var users = Security.listUsersInGroup('ST Test');
var emailsTo ='';
for (var index in users) {
if(emailsTo === ''){
emailsTo = users[index].email;
}else{
emailsTo += ',' + users[index].email;
}

}
email.to = emailsTo;
email.send();



Bastien Mazeran
Support Specialist
Product Support
Autodesk, Inc.
Mentor
dkeeley
Posts: 214
Registered: ‎10-04-2012
Message 7 of 9 (165 Views)

Re: Advanced Print View Script Problem

04-08-2013 12:53 PM in reply to: mazerab

Hi Bastien,

 

I just tested the script. Same error message ;-(

 

David.

Mentor
dkeeley
Posts: 214
Registered: ‎10-04-2012
Message 8 of 9 (145 Views)

Re: Advanced Print View Script Problem

04-17-2013 02:19 AM in reply to: dkeeley

Hi,

 

Can someone provide me with an update on this issue?

 

David.

Product Support
mazerab
Posts: 203
Registered: ‎11-20-2012
Message 9 of 9 (140 Views)

Re: Advanced Print View Script Problem

04-17-2013 10:40 AM in reply to: dkeeley

Hi David,

I will follow-up with you shortly.

Regards,



Bastien Mazeran
Support Specialist
Product Support
Autodesk, Inc.

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Ask the Community