/scripts/ahub.form.attachments.js
0

Screen Personas 3.0 - Javascript only works with me

Feb 27, 2017 at 07:07 AM

164

avatar image

Hi, I've made this script. It work great on my user, but gets an error on this line:

session.findById("wnd[0]/usr/ctxtERDAT-LOW").text = fraText;

The script will put todays date in HIGH and todays dat - 3 in LOW.

var idag = new Date();

var fra = new Date();

fra.setDate(fra.getDate()-3);

var dd = idag.getDate();

var mm = idag.getMonth()+1; //January is 0!

var yyyy = idag.getFullYear();
if(dd<10) {  
dd='0'+dd;
} 
if(mm<10) {  
mm='0'+mm;
} 
var idagText = dd +'.' + mm +'.'+yyyy; 
dd=fra.getDate();
mm = fra.getMonth()+1;
var fraText = dd +'.' + mm +'.'+yyyy; 
session.findById("wnd[0]/tbar[0]/okcd").text = "iw58";

session.findById("wnd[0]").sendVKey(0);
session.findById("wnd[0]/usr/ctxtERDAT-LOW").text = fraText;
session.findById("wnd[0]/usr/ctxtERDAT-HIGH").text = idagText;

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

5 Answers

Tamas Hoznek
Feb 27, 2017 at 05:02 PM
0

If you mean that the script works for you but not for another user, this can be caused by different date format settings for the other user.

Share
10 |10000 characters needed characters left characters exceeded
Grethe Byrkjedal Feb 28, 2017 at 09:29 AM
0

Hi

How can I fix that?

We all use the same format: dd.mm.yyyy

Share
10 |10000 characters needed characters left characters exceeded
Tamas Hoznek
Feb 28, 2017 at 06:19 PM
0

If everyone uses the same date format setting, then that cannot be the reason for the problem.

What is the error message you get?

Share
10 |10000 characters needed characters left characters exceeded
Chinthan Yajamaan
Mar 01, 2017 at 06:28 PM
0

Can you navigate to IW58 transaction in Original Screen or by disabling Personas with other user login (who is getting script error in Personas) to see if there are any popup window which is blocking access to wnd[0]/usr/ctxtERDAT-LOW field?

Share
10 |10000 characters needed characters left characters exceeded
Grethe Byrkjedal Apr 06, 2017 at 04:35 PM
0

Hi, don't get any pop-ups in original screen

Show 1 Share
10 |10000 characters needed characters left characters exceeded

FYI - when you are replying to an answer use comment on that answer, not another answer. Others are not notified about new answers, they're only notified when you comment on their answer. See this blog.

0
Skip to Content