Script Error: Microsoft.ClearScript.Windows.WindowsScriptItem

When returning to my PMS integration project I seem to be getting an error of;


Even on the most basic auth_test request.
Updated samba to .54 - no change.


function authtest()
    var url = '';
 	var username       	    	= 'xxxxx';
	var password        	   	= 'xxxxx';
	var apikey          	   	= "instances_xxxxxx";
	var requestdata = new Object();
	requestdata.api_key = apikey;
	var requestjson = JSON.stringify(requestdata);
	/*--- JSON POST & RESPONCE---*/ 
	var response = web.PostJson(url,requestjson,username,password);
	var responseObject = JSON.parse(response);
 return response;

@emre any sugestions, was working few weeks ago when last worked on the script.
Tested the REST and user/pass etc in another program and all still valid.

Let me test that too. Can you PM me details so I can execute your code?

Will pm the full script.

Am a little confused as to what this messaged means?

This is what happens for me. Strange.

Hmmm, interesting, if had only tried on desktop i might think it was some other software conflicting in its use of jscript (have allot of clutter software on that) but the tablet have pretty much samba and vlc installed on it.

Not sure how to test what might be causing…
If it posible for other scripts to conflict?

I don’t think so. You can try removing lines or adding some returns in flow to spot at which point it generates that error.

You mean to return each var value at a time?
I presume the error suggests is a Microsoft based difference? Ie updates or win7 vs win10 differ eve between your machine and mine?
Although desktop is win7 and tablet is win10 so shouldn’t be that.

Very little has changed on my desktop since when it was working and absolutely nothing has changed on tablet, other than samba has only been used for watching breaking bad in bed since I last had the scripts working.

Defiantly not a problem on the rest side.
The message says to me that it’s a local issue.

Even if the user, pass or api-key were wrong would still return a req auth or incorrect api-key responce…

I mean if you insert a return 'blah'; after 5th line and if it works without that error you’ll know first 5 lines does not throws that error.

Well that can be anything. Generally it is the least thought thing :slight_smile:

FFS… Just noticed something so so so so stupid,
Think I forgot the () after the test field - embarrassing if that’s all it was :frowning:
Will check tomorrow, while in one breath I hope it wasn’t something so stupid on the other I hope it is LOL

Haha. I’ve did that few times too… On next version it will append () if test value does not contain parenthesis.

1 Like

How embarrassing, spent over an hour trying to simplify script to find if I’d messed it up somewhere :frowning:

1 Like

On the subject of scripts for the pms intergration kendash said report expressions won’t work in scripts, is there any alternatives for a total sales by product group expressions which can go in scripts other than SQL?
Given the potential of scripts I’m suprised report tags aren’t usable in scripts.

You can pass report tag values into scripts but you can’t just use them inside the script.

Report system designed to cache work period data locally and this is not a suitable way to access data inside scripts. Until I improve that for uses other than reporting SQL is the only solution.

1 Like

Could SQL return total orders by order state (which are not room post - payments ie cash or card as these will be posted on per ticket/room basis as charged)?
Am still undescided about where to just post sales as wet/dry or to break down to extent of product group.

At the minute am thinking wet/dry will be enough for general reporting in pms accounts and more detailed group based can be reported through samba which will also simplify the rest posts in the script.
Would allocate an order state using a product tag and order added tag–>state rule.

Just trying to visualise the best way to be able to diferentiate till sales vs room posts for accumulative ‘non room post’ sales for end of day post.