Order of links in Settings Charm - settings

Does anyone know how I can position a link inside the settings charm to always appear at the bottom?
Our UI team would like the "Sign out" link to always be position last, unfortunately the "Permissions" link, which is automatically added, shows below it, even though I use the append call on the applicationCommands object.
var signOutCommand = new Windows.UI.ApplicationSettings.SettingsCommand(
"sign-out",
"Sign out",
signOutHandler,
);
e.detail.e.request.applicationCommands.append(signOutCommand);

I haven't found anything explicitly stating so, but I don't think it's possible to get in below the Permissions link.

Related

Condition in IF-Condition in UiPath

Due to the fact, that i´m completly new to UiPath, I need some minor help implementing an if condition.
My Problem:
Im using the Bot to search for several Post sendings in the Browser on the DHL-Homepage. The Bot works fine, but due to changes on the Homepage, minor changes have to be done.
The tasks are: Open Browser, clicking a field, type something in the field, click the button for search. In some cases, after clicking the search button, the system wants to know the shipping date. Now I need to implement an if-condition. If the field for Shipping date appears, then type the date and click the search button again. Else go ahead with the next step. The If and Else sequences are implemented already, but i cant figure out how to implement the necessary condition [VB-Ausdruck eingeben].
You can see the If-Else Condition below.
Hope the problem is clear and someone can help me.
Thanks a lot!
Found a solution.
I´ve added an 'Element Exists' before the If-Activity. Declared an Variabletype 'boolean', and wrote in the If Condition 'booleanOutput=True' -> If the field, which is indetified by the Element Exists- activity, the Then part will start, otherwise the empty Else part starts.

Link directly to a notebook page in a view

I have an view that extends the current project view, where we add multiple tabs (notebook pages) to show information from other parts of a project.
One of these pages is an overview page that summarizes what is under the other tabs, and I'd like to link the headlines for each section directly to each displayed page. I've currently solved this by using the index of each tab and calling bootstrap's .tab('show') method on the link within the tab:
$(".overview-link").click(function (e) {
e.preventDefault();
var sel = '.nav-tabs a:eq(' + $(this).data('tab-index') + ')';
$(sel).tab('show');
});
This works since I've attached a data-tab-index="<int>" to each header link in my widget code, but it's brittle - if someone adds a tab later, the current indices will be broken. Earlier I relied on the anchor on each tab, but that broke as well (and would probably break if a new notebook page were inserted as well).
Triggering a web client redirect / form link directly works, but I want to show a specific page in the view:
this.do_action({
type: 'ir.actions.act_window',
res_model: 'my.model.name',
res_id: 'my.object.id',
view_mode: 'form',
view_type: 'form',
views: [[false, 'form']],
target: 'current'
});
Is there any way to link / redirect the web client directly to a specific notebook page tab through the do_action method or similar on FormWidget?
If I understood well you want to select the tab from the JavaScript (jQuery) FormWidget taking into account that the id could change if anybody install another module that adds another tab
Solution 0
You can add a class to the page in the xml form view. You can use the id of the element selected by this class name in order to call the right anchor and select the right tab item. This should happen when the page is completely loaded:
<page class="nb_page_to_select">
$('a[href=#' + $('.nb_page_to_select').attr('id') + ']').click()
NOTE: As you have said the following paragrah I assume that you know where to run this instruction. The solution I suggest is independent of the index.
This works since I've attached a data-tab-index="<int>" to each
header link in my widget code, but it's brittle - if someone adds a
tab later, the current indices will be broken. Earlier I relied on the
anchor on each tab, but that broke as well (and would probably break
if a new notebook page were inserted as well).
Solution 1
When the page is loaded you can get the tab list DOM object like this:
var tablist = $('ul[role="tablist"]')
And then you can click on the specifict tab, selecing by the text inside the anchor. So you don't depend on the tab index:
tablist.find('a:contains("Other Information")').click()
I think if you have two tabs with the same text does not make any sense, so this should be sufficient.
Solution 2
Even if you want to be more specific you can add a class to the notebook to make sure you are in the correct notebook
<notebook class="nt_to_change">
Now you can use one of this expressions in order to select the tab list
var tablist = $('div.nt_to_change ul.nav-tabs[role="tablist"]')
// or
var tablist = $('div.nt_to_change ul[role="tablist"]')
Solution 3
If the contains selector doesn't convince you because it should be equal you can do this as well to compare and filter
tablist.find('a').filter(function() {
return $.trim($(this).text()) === "Other Information";
}).click();
Where "Other Information" is the string of the notebook page
I didn't tried the solution I'm giving to you, but if it doesn't work at least may be it makes you come up with some idea.
There's a parameter for XML elements named autofocus (for buttons and fields is default_focus and takes 1 or 0 as value). If you add autofocus="autofocus" to a page in XML, this page will be the displayed one when you open the view.
So, you can try to add this through JavaScript, when the user clicks on the respective link -which honestly, I don't know how to achieve that by now-. But you can add a distinctive context parameter to each link in XML, for example context="{'page_to_display': 'page x'}". When you click on the link, I hope these context keys will arrive to your JS method.
If not, you can also modify the fields_view_get method (here I wrote how to do that: Odoo - Hide button for specific user) to check if you get the context you've added to your links and add the autofocus parameter to the respective page.
As you said:
This works since I've attached a data-tab-index="" to each header
link in my widget code, but it's brittle - if someone adds a tab
later, the current indices will be broken.
I assume that your app allow multi-user interaction in realtime, so you have to integrate somewhere in your code, an update part function.
This function will trig if something has changed and cleanout the data to rebuilt the index in order to avoid that the current indices will be broken.

How do I refresh a "form element" when it is changed through a webbrowser control?

I am using VB6 (yes, I know it's 10 years old :), but it works). VB.NET answers may work as well, so if you know the answer, please answer too!
I am "manually" setting a dropdown box in a form, yet the 'webbrowser' doesn't seem to update.
Here's an example
If you notice in the form, it has a place where it asks you to fill in a state. (I.e., california, etc). It looks like a javascript/DHTML popup box in MSIE (firefox doesn't do the same, so you need to use MSIE, since that is what the webbrowser control relies on). If I 'click' on the "state" field, a popup box appears. I then can say select "CA" for california, and it updates it. (It now says "CA").
If I progrmatically do it, I would do something like:
WebBrowser1.forms(2).elements(13).value = "CA" ' (sets it to 'california')
WebBrowser1.forms(2).elements(13).item(9).selected = true (makes sure it is 'selected')
However -- within the webbrowser control -- it still appears as if nothing has changed. (In reality it has, i.e., if I submit the form it will submit the correct info), but it just doesn't "update" it.
Do you have any idea how I can do a "forced" refresh (either progrmatically or through some javascript/dhtml refresh), that will correctly then 'update' the field to show that "CA" has been selected?
Thanks very much!
The last VB version I used was VB3 so forgive my VB grammar :)
If the change event has a handler that you want to simulate
WebBrowser1.forms(2).elements(13).item(9).fireEvent ("onchange",WebBrowser1.Document.createEventObject())

Making a field unavailable to a user with javascript in MS CRM 4

I am trying to disable a field, i.e. grey it out and not allow the user to select it. To achieve this effect I am currently calling
crmForm.all.new_attribute1.disabled = true;
crmForm.all.new_attribute2.Disabled = true;
The Disable, with a capital D, makes the field grayed out but the user can still put the cursor in that field or tab to it.
The disable, with a little d, makes the field unavailable to the cursor and via tab, but gives no visual indication that it can't be interacted with.
Is there a better way to do this, one call that will achieve similar results or am I stuck having both there?
Using "Disabled" property should work.
You can try putting this code in OnLoad event of Account entity (don't forget to enable Event and Publich entity!):
crmForm.all.accountnumber.Disabled = true;
And "Account Number" will be blocked and greyed as seen in this picture:
(source: vidmar.net)
You are talking about readOnly and disabled.
A great article was posted http://customerfx.com/pages/crmdeveloper/2006/03/06/readonly-and-disabled-fields.aspx ... maybe this could help.

sIFR - override link click with onRelease?

I've got sIFR setup to replace a navigation menu (looks pretty slick). It's individually replacing the LIs and their internal links. I have an onRelease tag that throws properly, extracts the actual href link address, all good so far. I want to tie this into an AJAX page loader, with backwards-compatability (+SEO) for the individual pages being able to load themselves. I've tried return false like I would for standard links, no dice.
I'm assuming it doesn't work because it's onRelease, not onClick or something BEFORE it is already changing the page? onClick doesn't seem to be a valid sIFR function, documentation at http://wiki.novemberborn.net/sifr3/JavaScript+Methods says onRollOver, onRollOut, and onRelease. It would be a shame to have to pitch my entire AJAX system, there is hopefully a good workaround!
There isn't really an option to prevent the default behaviour. You can change it in sIFR.as though. Assuming the <li> contains just a <a> remove the following around line 505:
getURL(sIFR.instance.primaryLink, sIFR.instance.primaryLinkTarget);
That will prevent sIFR from following the URL when you click on the link. It'll still work with right-click though, but you might be able to fix that by changing (line 508):
menu.customItems = menuItems;
to
menu.customItems = [];

Resources