Windows Phone 7 WebBrowserTask problem - windows-phone-7

I'm trying to open this url using a WebBrowserTask in WP7, and it doesn't work (I get a custom error on our website), but when I type it in by hand, it works fine. Any ideas?
It also works perfectly fine in Google Chrome and IE7.
This is the url:
http://www.symfonee.com/Improv/addison/comedians/Bio.aspx?ShowDate=12/15/10&ShowTime=8:00p&Uid=54918a0d-1beb-4552-bdc8-2d474e3ea5ae
And this is my code:
string url = "http://www.symfonee.com/Improv/addison/comedians/Bio.aspx?ShowDate=12/15/10&ShowTime=8:00p&Uid=54918a0d-1beb-4552-bdc8-2d474e3ea5ae";
WebBrowserTask browser = new WebBrowserTask();
browser.URL = url;
browser.Show();
Thanks!
EDIT:
Without any of the solutions below, this code works fine:
WebBrowserTask browser = new WebBrowserTask();
browser.URL = "http://www.youtube.com/results?search_query=Windows+Phone+7&aq=f";
browser.Show();
I don't understand what is different?

There is a bug with the SDK. In URL that contains &, you need to escape it.
For example:
... Uri.EscapeDataString("&") + "ShowTime=8:00p"

This is most likely because your query string parameters are not URL-encoded. Modern web browsers will attempt to compensate when you paste that into the address bar because it's hard to URL-encode in your head. But when you're using an API, you should really URL-encode those pieces yourself.
Use the Uri.EscapeDataString method to encode each part of the query string individually. For example.
string url = "http://www.symfonee.com/Improv/addison/comedians/Bio.aspx" +
"?ShowDate=" + Uri.EscapeDataString("12/15/10") +
"&ShowTime=" + Uri.EscapeDataString("8:00p") +
"&Uid=" + Uri.EscapeDataString("54918a0d-1beb-4552-bdc8-2d474e3ea5ae");

The following code worked for me:
s = "www.. "; //url
s = Uri.EscapeUriString(s);
task.URL = HttpUtility.UrlEncode(s);

You're URI needs to be escaped indeed. As simpler way I think is :
string url = "http://www.symfonee.com/Improv/addison/comedians/Bio.aspx?ShowDate=12/15/10&ShowTime=8:00p&Uid=54918a0d-1beb-4552-bdc8-2d474e3ea5ae";
WebBrowserTask browser = new WebBrowserTask();
browser.URL = Uri.EscapeUriString(url);
browser.Show();

Related

QuerySchedule WebAPI function call

I am using Web API calls to Dynamics 365 to get result for function QuerySchedule. I have tried using this as a bound function as well. But none of them returns the expected result. Below is documentation on this:
https://learn.microsoft.com/en-us/dynamics365/customer-engagement/web-api/queryschedule?view=dynamics-ce-odata-9
I have tried different resource id, different ways to specify the enum type in the call, fully qualified function name, etc but I always get error.
Following is my call:
https://mycrm.com/api/data/v9.0/QuerySchedule(ResourceId=#p1,Start=#p2,End=#p3,TimeCodes=#p4)?#p1=resourceguid&#p2=2019-01-05T09:27:39Z&#p3=2019-01-05T21:27:39Z&#p4=Available
The output is expected to be QueryScheduleResponse as mentioned in below link:
https://learn.microsoft.com/en-us/dynamics365/customer-engagement/web-api/queryscheduleresponse?view=dynamics-ce-odata-9
But I keep getting error message:
Object reference not set to an instance of an object.
Could anyone who has done web api calls to Dynamics 365 using OData or has any experience with this kindly help?
Quickly did a browser console test, the code snippet from this blog post works fine.
Pasting part of the snippet from the blog, your code may break as you are passing "Available" instead of ['0'] for TimeCodes.
var requestUrl = "/api/data/v9.0/QuerySchedule(ResourceId=#p1,Start=#p2,End=#p3,TimeCodes=#p4)";
requestUrl += "?#p1=" + context.getUserId().replace("{", "").replace("}", "");
//put Id of resource you want get data for as parameter 1
requestUrl += "&#p2=" + JSON.stringify(start).replace(/"/g, "");
requestUrl += "&#p3=" + JSON.stringify(end).replace(/"/g, "");
requestUrl += "&#p4=" + JSON.stringify(['0']);
Even you can paste this url in your browser address bar to smart test:
Request:
https://test.crm.dynamics.com/api/data/v9.0/QuerySchedule(ResourceId=#p1,Start=#p2,End=#p3,TimeCodes=#p4)?#p1=0EEE678F-C4FF-E711-A959-000D3A1A941E&#p2=2019-01-15T09:27:39Z&#p3=2019-01-15T21:27:39Z&#p4=['0']
You may notice ['0'] turn into [%270%27] but the below expected response will appear.
Response:
{"#odata.context":"https://test.crm.dynamics.com/api/data/v9.0/$metadata#Microsoft.Dynamics.CRM.QueryScheduleResponse","TimeInfos":[{"Start":"2019-01-15T00:00:00Z","End":"2019-01-16T00:00:00Z","TimeCode":"Available","SubCode":"Schedulable","SourceId":"15f40c32-1609-46db-93da-1bbb8eb19c9d","CalendarId":"69b0ee2b-bad7-4b8e-9bcc-d03e76b45a03","SourceTypeCode":4004,"IsActivity":false,"ActivityStatusCode":-1,"Effort":1.0,"DisplayText":""}]}

Replacing portion of a URL in HPE UFT / VBscript

So I am trying to get a script to work that will obtain the current URL of the open tab, replace a portion of the URL, and enter in/navigate to the new URL which has the replaced text.
I'm struggling with the replace function as well as how to launch the edited URL in the current tab.
Here a rough idea of how I think it should look. If this worked worked it would open up a new browser with the new URL but I'd like it to be on the tab I'm currently in.
Would I need to crate an object for the result of the replace function?
If I were currently at
abc123.UZ.com/xaxsxa
I'd like to go to the page
xyz789.UZ.com/xaxsxa
Code:
Browser("Edge").Page("Loan#").WebButton("LoanConditions").Click
Browser("Edge").Page("Loan#).GetROProperty("url")
Result = Browser("Edge").Page("Loan#").GetROProperty("url")
replace (Result,"abc123","xyz789")
Systemutil.Run "Chrome.exe", "Result"
Use the Navigate method of the Browser object.
You just need to replace the last 2 lines with:
Result = replace(Result,"abc123","xyz789")
Browser("Edge").Navigate Result
Update(Based on the issue mentioned in Comments):
Try this code. This is still untested by me. So, let me know if it works for you.
set odesc = Description.create
odesc("micclass").value = "Browser"
intBefore = Desktop.Childobjects(odesc).count
Browser("Edge").Page("Loan#").WebButton("LoanConditions").Click
Browser("Edge").Page("Loan#").Sync
intAfter = Desktop.Childobjects(odesc).count
if intAfter = intBefore + 1 then
intIndex = intAfter-1
set objBro = Desktop.Childobjects(odesc).item(intIndex)
Result = objBro.getRoProperty("url")
Result = replace(Result,"abc123","xyz789")
objBro.Navigate Result
end if

TextBox1.Text string on end of a link

I wanted to make an application that checks if a link was blocked on steam.
I used the linkfilter page. (https://steamcommunity.com/linkfilter/?url=)
I tried doing it like this:
WebBrowser1.Url = https://steamcommunity.com/linkfilter/?url=(TextBox1.Text)
But I got two errors. Is there a way to do this?
Did you try setting your string values as actual strings?:
WebBrowser1.Url = new Uri("https://steamcommunity.com/linkfilter/?url=" + TextBox1.Text);
or:
WebBrowser1.Url = new Uri(string.Format("https://steamcommunity.com/linkfilter/?url={0}", TextBox1.Text));

Error when setting new routes in codeigniter

i have an URL: mydomain.com/view/page/about
then i want change it to be: mydomain.com/page/about
i’ve tried add a new routes:
$route[‘page/(:any)’] = ‘view/page/$1’;
but when i refresh my browser, it always show the page in: mydomain.com/view/page/index
any advice to solve my problem?
thank you before
Note that mydomain.com/page won't get you to view/page. Your regexp expects there to be a ending / in the url.
Either do a
$route[‘page/?(:any)’] = ‘view/page/$1’;
Or
$route[‘page’] = ‘view/page’;
$route[‘page/(:any)’] = ‘view/page/$1’;
If you wish to be more accurate.

Ajax + qtranslate

Hi I ran into the same problem as Rik had here
The answer given was that he had to "Search in code for link request "ajax.php". Replace "ajax.php" with ajax.php/?lang='.qtrans_getLanguage()" "
My question is this (I know it might sound stupid, I suck at this stuff), what code does this answer refer to and where do I find it? I've searched all php files in the qtranslate and ajax plugins but cannot find where it is.
It depends on which WP ajax-plugin you have a problem with. In case "Category-Post AJAX Tree" I had to replace
$localize = array ('ajaxurl' => admin_url('admin-ajax.php'),
with
$localize = array ('ajaxurl' => admin_url('admin-ajax.php?lang='.qtrans_getLanguage()),
in cat-post-tree-ajax.php and to replace
var url = CatPostAjax.ajaxurl + '?action=myajax-submit&category=' + id; // compose url
with
var url = CatPostAjax.ajaxurl + '&action=myajax-submit&category=' + id; // compose url
in cat-post-tree-ajax.js. Please tell us what plugin you mean so we'll be able to help.

Resources