Trying to open specific xPage in Notes Client in Edit Mode - xpages

I have an xpage without any data source being used to compile a report. Now I want to send link of this page to different people at 04:00 PM everyday. I am using lotusScript agent to send an email. It's running perfectly fine for web link to open an xpage but notes client link its not opening the page. I am using IBM Notes 9.0.1. Below is the sample code from agent.
Call mailRT.AppendText(" For Web Link ")
Call mailRT.AppendText("http://172.17.5.36/sar.nsf/DailySummaryReport.xsp")
Call mailRt.AddNewline(2)
Call mailRT.AppendText("IBM Notes Client Link --->>> ")
Call mailRT.AppendDocLink(db,"Click to Open Daily Sales Activity System")
Call mailRt.AddNewline(3)
Call mailRT.AppendText("Best Regards, ")
Call mailRt.AddNewline(1)
Call mailRT.AppendText("notes://172.17.5.36/sar.nsf/DailySummaryReport.xsp")
I don't know what is appropriate way to open a an xpages from an email. if i use
Call mailRT.AppendText("notes://172.17.5.36/sar.nsf than it's open launching page of the application otherwise open view last viewed by the user( Call mailRT.AppendText("notes://172.17.5.36/sar.nsf/DailySummaryReport.xsp") ).
Kindly guide me the way forward.
Thanks,
Qaiser

I would send messages always a MIME. It gives you more flexibility in formatting and layout. Stick to the link approach since embedded forms are a security hazard. Start with the eMail bean (you can adopt it to an agent).
When your XPage opens with all the fields you need in edit mode, that's the URL you want to use. if you use http it would open in the browser, use notes it opens in the client.

Related

Lotus Notes #Command([MailForward]) Command issue

Someone please let me know what exactly #Command([MailForward]) command does?
In my organization, I take care of several existing notes based applications. Here, one of the users is getting error message when clicks on 'Email Quote' button in one of the applications. The button contains the formula '#Command([MailForward])'. As the user clicks on the button, he gets following error:
Here in the organization, all the users use 'Outlook/Exchange' for emails, and notes emailing is not enabled. Other users of the application are able to click the button and send quotation via mail. The issue is with this specific user only.
I think there is some configuration settings in location entry or person document (names.nsf) that I am missing. Please guide me.
Thanks
Romil Handoo
#Command([MailForward]) is a command that takes the current Notes document that you are looking at and attempts to create a new email with that document included in the body. This is similar to what you see when you forward an email in Outlook.
Since you aren't using Notes for your mail, this action will not work. The error message you are receiving is there because the current user doesn't have a Lotus Notes mail file configured.

Restrict user from closing outlook mail app, while some action is in progress

I am working on an Outlook mail app, which will be available to user on web only (not of outlook desktop).
A file need to be uploaded from app to azure via custom control in compose form of App, meanwhile the file is uploaded to Azure user should not be able to close the mail. If they try to do so, a warning should be given to them.
Adding to #Slava's answer, I would suggest using addAsync API for notification messages. You can add a notification of type progress indicator until your task is complete and replace it with a notification of type informational message.
Click here for reference
Unfortunately Office.js API does not have the feature you are inquiring. You will not be able to disallow user interaction, as such closing the compose window or closing your add-in. As the API doesn't have "OnSend" or "OnClose" events you will not be able to display any warning either. If this is the new feature you would like to add you may try to send request via Office Developers User Voice.
As the work around you should clearly indicate for the users that they need to wait and do not interup operation. You should display activity indicator, indeed. And finally you should be prepare user still interupt the operation in the middle and work properly with the error occur.
Hope this helps.

xpages File Download control - open instead of save?

When you click on the link for an attachment in the File Download control in XPiNC, you are promoted to save the attachment. Is it possible to configure the File Download control to open the attachment directly instead of prompting the user to save it? We're using 8.5.2 FP3.
Handling of an "attachment" is primarily done by the Browser (XPiNC being a firefox browser inside Notes). If for example, a PDF plugin is installed in the browser and the servers sends the corresponding "application/pdf" mime-type with the file, the browser uses that plugin to display the file. The correlation between mime-type and plugin or external application in the browser is something the server/webapplication can not influence.
What you can do on the server side is sending the mime-type "application/octet-stream" instead of the one corresonding to the file type, causing the browser to display the "Select application or download" dialog. So in Xpages, you would have to redirect the download through a XPage, where you set the corresponding HTTP Headers as shown in Set cache headers on an XPage and How to force PDF files to open in browser?
I haven't used the file download control or XPINC, but it is definitely possible to make your xpage or view control open an attachment directly. This method bypasses the download control.
Please see this post from Stephan Wissel: http://www.wissel.net/blog/d6plinks/SHWL-86QKNM, which gives you some SSJS that you can use to build the URL. You can use it in the onClick method of a button. You are essentially duplicating the functionality of the download control in a way that does what you want it to do.
If you want to do the same thing from a view control, then see this post: http://notesspeak.blogspot.com/2013/02/how-to-launch-attachment-from-view.html
Note that different browsers behave slightly differently but it works in all the majors.
Michael,
Here is code I used:
var unid = rowValue.getUniversalID()
var url = getAttachmentURL(unid, "storetransfer.pdf", "Testing//test.nsf")
url = "/" + url + ";"
view.postScript("window.open('" + url + "', '_blank', 'height=120,width=650,top=10,left=10,resizable=yes');");
I did modify Stephan's code a bit since my data is in a different NSF than my code. You probably know this but the view.postScript allows you to call clientside javascript from SSJS. It always is the last thing to run, hence the name. This is the same code from the Notesin9 video mentioned in the comments. I just tested this and it works like I think you want, but in firefox it does try to block the popup, and then has to push "open". Hope this helps.

Email sent from lotus notes which includes sent form not working in gmail

While sending email from lotus notes to Gmail using Lotus Script, buttons are not visible in Gmail.
As Anders says, Any standard or custom Action Buttons (at the top) will not be available in Gmail. You would need to code your own Gmail interface to reproduce.
If you are talking about buttons in the actual rich text of the mail, these will definitely not get translated when the mail leaves and you should get a message saying...
"The following items cannot be sent or saved in MIME (internet mail) format."
That would be a clear sign that you are going to need to take another look at your assumptions.
If you are planning a migration, you do need to check your assumptions (and your vendor's promises) carefully, there is a lot of infrastructure and functionality that is taken for granted in the Notes/Domino stack and just not available, or significantly different, in others.
Stored forms are a feature that is unqiue to Notes. They contain Notes design elements, formulas and scripts that execute Notes functions that are provided by the Notes API DLLs that are only available in the Notes client. GMail doesn't know anything about them. Outlook doesn't know anything about them.
But if you want to send them to someone who has a GMail address but who also has the Notes client, then there is a way to do it manually using the "Send this email to other Notes mail user(s) through the Internet" feature, which appears in the Advance tab of the Delivery Options dialog that you can bring up when sending a message. There is no simple API for automating the mechanism that is used, but it can be done. It requires creating a new empty database file with a special name (encap.ond), saving your document into that database, and then attaching the the file to a new message, which will be the one that you actually send. I don't recall if any special headers are required for this, so if you want to pursue it you will have to do some investigation by using the manual process and checking out the full headers of the message on the receiving side.

Add custom text to Sharepoint Email Alert

We have an alert set-up for sharepoint list, but I want to add some custom text to the alert email. We do not have any access to SPD or sharepoint server and can make changes to sharepoint client only.
Can anyone please advice?
The code that sends out emails runs on the SharePoint server via the Timer Job. Since you have no access to do anything with the server you've got absolutely no chance of modifying the built in alert emails.
Could you do this with javascript?
You can't send emails with JavaScript directly. You can open up a draft email in a users default email client using a mailto link but this won't achieve what you want as a user will still have to edit it.
You could, I suppose, put some javascript onto an edit page using a content editor web part (which you can do without SPD) to on changes make an AJAX call to a separate web server to do the actual sending.

Resources