Issue {Call:x} in a Navigation Tile

Hi @emre

This does not seem to work in some cases? I use {CALL:x} in other cases no problem but there is something about the script - it runs from TEST, but from the Tile it soes not even hit the dlg.ShowMessage!

SCRIPT:

function Send(strxml)
{
	dlg.ShowMessage("In Script: " + strxml) ;
	
	var url = "http://test.miclub.com.au/services/UpdateAccounts";
	var lib = host.lib("System");
	var request = new lib.System.Net.WebClient();
	
    request.Headers.Add("Content-Type", "text/xml");  
    request.Headers.Add("SOAPAction", "http://test.miclub.com.au/services/UpdateAccounts.updateAccountDetails");  
	
	var header = 	
	'<?xml version="1.0"?>\n' + 
    '<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"\n' + 
    ' soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"\n' + 
    ' xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" xmlns:xsd="http://www.w3.org/1999/XMLSchema">\n' + 
    '<soapenv:Body>\n' + 
    '<updateAccountDetails xmlns="http://www.miclub.com.au/XMLSchema/WebServices/V1.0.0.0" >\n' + 
    '<Accounts EffectiveDate="{DATE:yyyy}-{DATE:MM}-{DATE:dd}">\n';
    
    var footer = 
    '</Accounts></updateAccountDetails>\n' +
    '</soapenv:Body>\n' +
    '</soapenv:Envelope>';
    
	var data = header + strxml + footer; 

	var result = request.UploadString(url, data);
	request.Dispose();
	
	//return result;	
	return "In Script"
}

Your thoughts please.

See this sample.

See my code above doing exactly all that and have another function already working.
For some reason it does not like the content of the script - as I say it does not get to line 1?

If I was in your position I would usually work through in parts.
Comment out all but return, then slowly un-comment sections to narrow down the issue.

Since test works obviously double check the script name first :stuck_out_tongue:

Not fully understanding your script, guessing the show message is just for testing?

Yes done all that - it does not make the first line see it is a show message?

UNBELIEVEABLE! It seems it does not like the Handler Name… Double checked for duplicates already so don’t care working I think…

Account? might be used in something hardcoded maybe…

Interesting note to keep in mind.

I bet if you named the handler “Entity” is might break too :wink:

While I have a few eyes - can we do this?

It seems the REPORT Tag is not evaluated and passed as is to the function which then just spits it out to the POST :frowning:

Any way to break it down 1 step further?. Use Update Program Setting, like “reportData”. Assign the {REPORT ENTITY DETAILS:x} to that program setting, then do your call.

Or maybe just take out all the newline/breaks in the Template. It might be getting confused.

1 Like

Will Program Setting (and this raw function) be able to cope with 3,000 lines or more?

Sorry, I am confused. You want to run your script in a Tile for 3000 entities… why would you do that?

The Script is sending up 3,000 lines of XML to a Web Service and updating Account Balances.

Hey @emre

Can you please comfirm that we CANNOT run a {REPORT:x} Tag output and pass it to a Script in a Navigation Tile?

Here is the Navigation Tile Code:

<size 50><bold>Web Updated</bold></size>
{TIME}
{CALL:Web.Send('{DATE:yyyy}-{DATE:MM}-{DATE:dd}','{REPORT ENTITY DETAILS: E.Name, E.Balance.Sum;0.00;-0.00;0.00:(ET=Customers) && E.AccountId>0 && E.Name="90000":
  <Account AccountName="Bar" Reference="{0}">
      <Balances>
         <Balance>{1}</Balance>
      </Balances>
   </Account>}')} 

I have also taken the lines out but the TAG is not evaluated when passed.

Thats what stumped me, why are you wanting to trigger that from the tile template?
Do what I did on PMS and automate a normal script including an update program settings value you want to be show like last update etc.
I set a trigger to routinely sync and then the tile button triggers a manual run.
Also set to trigger update on end of work period.

1 Like

Right, but why do the call in a Tile? Because of the automatic refreshes? Might be better to use a Trigger…

1 Like

Ok I am out of steam here, so BLANK in my head - how do we do this again?

Yes see your reply, thought of a trigger just like the idea of setting the Tile to a long refresh 2-3 times day and displaying the time when it was done. Al that works effortlessly.

You are thinking too much. I think Q mean just simple Update Program Setting with the value {REPORT ENTITY DETAILS:x}.

That wouldnt be the case though would it… the tile will refresh on each time you go to main menu.
The refresh is how long after that to update if you dont go away from menu…

I think if you set the Cache it will not as Emre did that so with the weather API we do not chew through our free credit,.

1 Like