lotus notes: #Command(fileprint) with the print/page setup box - lotus-notes

#Command([FilePrint]; "1"; ""; ""; ""; "printview";""; "";"";"")
I'm using this formula in an action button inside a view for printing all documents listed by the view.
I've looked in the Domino Designer but I didn't found any parameter for the page setup which I want to appear.
I appreciate your time.

You can use:
#Command([FilePageSetup]);
To display the page setup dialog just before the FilePrint command.
http://publib.boulder.ibm.com/infocenter/domhelp/v8r0/topic/com.ibm.designer.domino.main.doc/H_FILEPAGESETUP.html

Related

How to create in XPages a submit button to discard the current and create a new document?

I need to create a link on a XPage to refresh the panel with a new document.
The current document must not be saved.
Thank you!
Just create a link with the URL to the page where this link is on, e.g.
<xp:link text="Discard and start over" value="/thepage.xsp?action=newDocument"></xp:link>
you can reinstatiate a data source bound to a panel using the following code. Try running that before you submit.
var c = getComponent("mypanel");
var ds = c.getData();
ds.get(0).refresh();

CRM 2013: Supported way to display dialogs

What is the supported way to display an HTML webresource as a dialog ?
I have tried Xrm.Utility.openWebResource(webResourceName) but it's displayed as a webpage
Thanks
At the moment the only way to open your webresource in dialog mode is to use showModalDialog method of window. Check following url please - showModalDialog
If you're looking to display webpages inside a dialog in CRM 2013, as per my knowledge that is not possible.
However, in order to simulate what you're trying to achieve, you could design the entire dialog in HTML itself (having buttons like Next, and pages, etc.) and then display the HTML page as a popup using OpenWebResource. You can make use of the REST api of CRM to carry out the CRUD operations during the dialog progress.
Did you check the MSDN reference? You can control the width and height if that is what you are trying to achieve.
You can use:
Xrm.Internal.openDialog(address, settingsobject, null, null, return function)
var settingsobject=new Xrm.DialogOptions;
settingsobject.height = 420;
settingsobject.width = Xrm.Page.context.client.getClient() === Xrm.ClientNames.mobile ? 500 : 450;

How can i get data from another document when i creat a new document on my XPage?

I've start to develop XPage 7 weeks ago, and i have a problem with "getting data".
On my first page i have a view with a lot of documents, and a button who redirect me on a new page, to create a new document. On my first page i can select a document and when i click on the button i put my id document selected on a sessionSCope.
Button script:
var viewPanel=getComponent("viewPanel1");
var docIDArray=viewPanel.getSelectedIds();
var docUID=database.getDocumentByID(docIDArray[0]).getUniversalID();
sessionScope.put("docUID", docUID);
context.redirectToPage("AjoutSuivi");
On my new XPage i want to get some data on my selected document so on clientLoad of the XPage i execute this script:
var docUID = sessionScope.get("docUID");
var doc:NotesDocument = database.getDocumentByUNID(docUID);
getComponent("contactname1").setValue(doc.getItemValueString("ContactName"));
On my database i have a field "ContactName" and on my XPage i have a field contactname1. I have try with "database.getDocumentByID(docUID)" and i'm sure that "database" is the good link of the database.
When i try it, there is nothing on the field contactname1 have u an idea why that's doesn't work ?
So much thank's if you can help me
Yann
PS: sorry for my bad english
Put your code into the event afterPageLoad and it should work (for the execution order of events take a look at XPage Cheat Sheet #1 - The Page Lifecycle).
Y4nn welcome to the XPages club. When you bind a control to a data source it is better to set the value in the data source than in the control. So you write:
document1.getDocument().replaceItemvalue(...)
(picking on a glass now, watch out for correct syntax)

Action (button) to open an existing form

I have created a view which displays some informations.
Also, on top of view I created an action bar containing 2actions: New entry & Delete entry. There is also a form called 'formmain', where I have some fields & listboxes where I insert the informations that will appear on the view.
What I want to do and I ask for your help: I want when i click the action button 'New entry', the form called 'formmain' will open/be displayed. Thank you!
You can use the #Compose Formula command for this. Here's an example for your specific form:
#Command([Compose]; ""; "formmain")
I will recommend that you take a look at the Lotus Domino Designer Help database which is part of your Notes installation. It has a lot of useful information including code examples.

Sharepoint links - how to open in new tab/Window

I've noticed with Sharepoint 2010, many of the links do not the support open in new tab/window feature. For example, items on the quick menu do not. Is it possible to enable?
Use the JavaScript function to open a new window in SharePoint 2010.
Create the function to open your target window as sample provide below.
function load_url(externallink)
{
window.open(externallink,target='_blank')
}
Place the function load_url in JavaScript file
Click site actions, select manage content and structure.
Suppose you want to change the links in the page
http://someserver/sites/Dev/Help/HelpLinks/AllItems.aspx
Then select the List named HelpLinks in the sub site Help. Dev will be the top most node(site). Help will be a sub site and inside Help you can find List by name HelpLinks.
All the links in the page and their title will be displayed
Select the title of link which you want to open in new tab and right click.
Select Edit properties. Then in the URL field and call the function as javascript:load_url('http://www.google.co.in'); instead of http:// www.google.co.in
Or Else
Suppose you want to change the links in the below URL.
URL: http:// someserver/sites/Dev/Help/HelpLinks/AllItems.aspx
Go To
open to the link http:// someserver/sites/Dev/Help/HelpLinks/AllItems.aspx
You will find the columns of the List (Title Column, URL column, Summary etc).
Select the Title and click Edit property which you want to edit
Then in the URL field and call the function as javascript:load_url('http://www.google.co.in'); instead of http:// www.google.co.in
This answer is a recap of this article and is not an answer I came up with: http://sharepointsolutions.blogspot.com/2007/09/make-selected-links-in-links-list-open.html
Step 1: Add #openinnewwindow to the end of all hyperlinks you want to open in new window.
Step 2: Then you will need to add the follow script to your SharePoint pages.
[script language = "JavaScript"]
//add an entry to the _spBodyOnLoadFunctionNames array
//so that our function will run on the pageLoad event
_spBodyOnLoadFunctionNames.push("rewriteLinks");
function rewriteLinks() {
//create an array to store all the anchor elements in the page
var anchors = document.getElementsByTagName("a");
//loop through the array
for (var x = 0; x < anchors.length; x++) {
//does this anchor element contain #openinnewwindow?
if (anchors[x].outerHTML.indexOf('#openinnewwindow') > 0) {
//store the HTML for this anchor element
oldText = anchors[x].outerHTML;
//rewrite the URL to remove our test text and add a target instead
newText = oldText.replace(/#openinnewwindow/, '" target="_blank');
//write the HTML back to the browser
anchors[x].outerHTML = newText;
}
}
}
[/script]
Whats the 'Quick menu'? Do mean list item context menu or something else? Can you post a screenshot?
There are two types of links used.
Normal HTML anchors - You can hold down the CTRL key when clicking.
JavaScript links (menus and such) the CTRL key doesn't work. If you're working with the Edit/View forms then this may be of interest
SharePoint - Editing The SharePoint List Item Menu
Especially look for Part II where it talks about changing this behaviour in List Settings > Advanced Settings > Dialogs
This is actually an Internet Explorer specific bug. The navigation links in SharePoint 2010 are regular links but have two nested span tags around the text of the link. This confuses IE which doesn't realise that the text you are right-clicking up is a link and so doesn't give the correct context menu. If you right-click just to the left of the text of the link (the cursor should still show as the "hand") the context menu appears as expected.
For Sharepoint 2013, I used Keith's code with a delayed call.
<script type="text/javascript">
// Add an entry to the _spBodyOnLoadFunctionNames array
// so that our function will run on the pageLoad event
_spBodyOnLoadFunctionNames.push("rewriteLinks");
function rewriteLinks() {
$('a').attr("target","_blank");
}
</script>
In the SharePoint Wiki Editor, you can click the "From Address" Link you added, and a LINK menu will appear in the ribbon bar. Inside that, you can click "Open in New Tab" It's not exactly New Window, but it's close and easy.
Add this to the end of the link.
#openinnewwindow
example: http://www.bing.com**#openinnewwindow

Resources