IBM Domino - meeting document reschedule (in db) chair receives email but doesn't update - xpages

I'm running a java XPage rest api that operates on the rooms & resource reservation database. It's executed by a single designated user which has full access to the database.
What I want to do, is to re-schedule someone's else meeting directly via the database. It works when I view it in the database, the meeting is updated successfully, however in the chair's notes client calendar, the meeting still appears as it was, despite receiving an "Accepted: " e-mail with new meeting date (I think it should be "Rescheduled:" though..)
Here's my code that creates a response document & sends it:
DateTime dt_startDateUTC = session.createDateTime(dtStart);
DateTime dt_endDateUTC = session.createDateTime(dtEnd);
Document docNew = reDatabase.createDocument(); // response doc
docAppointment.copyAllItems(docNew, true); // copy items from origianl doc
docNew.replaceItemValue("NoticeType", "U"); // update notice
docNew.replaceItemValue("CalendarDateTime", dt_startDateUTC);
docNew.replaceItemValue("SequenceNum", docAppointment.getItemValueInteger("SequenceNum") + 1); // bump SequenceNum
docNew.replaceItemValue("RmNameUpdated", "");
docNew.replaceItemValue("ResNameUpdated", "");
docNew.replaceItemValue("$RnRVersion", "2");
docNew.replaceItemValue("$CSVersion", "2");
docNew.replaceItemValue("Form", "Notice");
docNew.replaceItemValue("$NoPurge", dt_endDateUTC.getLocalTime());
docNew.replaceItemValue("StartDateTime", dt_startDateUTC);
docNew.replaceItemValue("StartDate", dt_startDateUTC);
docNew.replaceItemValue("StartTime", dt_startDateUTC);
docNew.replaceItemValue("RepeatInstanceDates", dt_startDateUTC);
docNew.replaceItemValue("EndDateTime", dt_endDateUTC);
docNew.replaceItemValue("EndDate", dt_endDateUTC);
docNew.replaceItemValue("EndTime", dt_endDateUTC);
docNew.removeItem("ReserveDate");
docNew.removeItem("step");
docNew.removeItem("$BusyPriority");
docNew.removeItem("$BusyName");
docNew.replaceItemValue("wgcIGNORE", "1");
docNew.replaceItemValue("$CSFlags", "w"); // taken from c&s workflow schema
docNew.replaceItemValue("Form", "Notice");
docNew.replaceItemValue("_ViewIcon", "33");
docNew.makeResponse(docAppointment);
docNew.send();
docNew.save();
docNew.recycle();
In my server log I see:
Router: Message 00325BD6, 0027FEE7 delivered to Room 1/Organization
Router: Message 00325C92 delivered to testuser/Organization
In my user's notes client I can see a new received mail from Room 1 titled "Accepted: Meeting subject" and when I enter it, the dates are correct (rescheduled), but when I click "Open meeting" the meeting still has old dates.
Am I doing something wrong? How can I enforce an update of that meeting? I already tried many different ways but without luck. I cannot modify user's calendar directly because I'd need to assign access to every user's mail database and that wouldn't be secure.

Related

nlapiSendEmail returns SSS_AUTHOR_MUST_BE_EMPLOYEE from correct employee id (on Sandbox)

in a Sandbox environment nlapiSendEmail (defined inside a suitelet) returns SSS_AUTHOR_MUST_BE_EMPLOYEE even when the sender id is correct
My distribution is Kilimanjaro, with SuiteScript 1.0. I have an administrator role, when calling nlapiSenEmail() directly from the backend model with my employee id, the email was sent to my employee profile, but not to the specified email, which is really a company distribution list. Even when I did not specify the logged customer email, a copy was sent to the logged customer email, a gmail account. The backend model operates only for the MyAccount application. It's worth noting that in this scenario nlapiSendEmail() return value was undefined. In my experience, Netsuite is really ambiguous in its behavior returning values or just functioning in an expected way, due to the "execution context". So, with the same data I put my call inside a suitelet, and now I am having the return SSS_AUTHOR_MUST_BE_EMPLOYEE.
function sendEmailWithAPI(request, response)
{
var senderId = request.getParameter('senderId');
var to = request.getParameter('emailTo');
var subject = request.getParameter('subject');
var body = request.getParameter('body');
var cc = request.getParameter('emailCC');
var result = {success:false, errorInfo:''};
try
{
var sendingResult = nlapiSendEmail(senderId, to, subject, body, cc);
result.success = true;
}
catch (errorOnMailSending)
{
result.returnValue = sendingResult;
result.errorInfo = errorOnMailSending.details;
}
response.write(JSON.stringify(result));
}
What is the record type of the senderId? NetSuite only accepts Employee records as sender of script generated emails. Also in Sandbox accounts, the emails are re-routed to the logged in user, specific list, or not at all. This is actually based on the Company preference in your Sandbox account. The reason for this is Sandbox is usually used for testing and you don't want to send test emails to actual customers.
In the end the "problem" was that I was just working in the Sandbox, as I prepared a snippet to test email sending in production everything went right. In the sandbox you can still send emails specifying a list at the subtab "Email options"
with the option "SEND EMAIL TO (SEPARATE ADDRESSES WITH COMMAS)"
this is located at Setup > Company > Email Preferences.

Emails with event invite generated by MVC application not synced with calendar in outlook.com

I am creating ASP.NET MVC5 application. One functionality is to send emails with event invitations. In Gmail client such generated email works fine. But in outlook.com even if the email has correct buttons - accept/tentative/decline - clicking on them won't sync that into the calendar itself.
I took some inspiration here:
StackOverflow Q1
StackOverflow Q2
StackOverflow Q3
Here is my current implementation:
I am using DDay.ical library for creating the event:
IICalendar iCal = new iCalendar();
iCal.Version = "2.0";
iCal.Method = "REQUEST";
iCal.ProductID = "my#product.com";
Event evt = iCal.Create<Event>();
evt.UID = Guid.NewGuid().ToString();
evt.Class = "PUBLIC";
evt.Created = new iCalDateTime(DateTime.Now);
evt.DTStamp = new iCalDateTime(DateTime.Now);
evt.Start = new iCalDateTime(DateTime.Now.AddHours(2));
evt.End = new iCalDateTime(DateTime.Now.AddHours(4));
evt.Location = "Party room";
evt.Description = "Awesome party";
evt.Summary = "Lets get wasted";
evt.Priority = 5;
evt.Transparency = TransparencyType.Transparent;
string res = new iCalendarSerializer().SerializeToString(iCal);
return res;
I am packing this event into email as an alternative view:
MailMessage email = new MailMessage();
email.To.Add(addressesToJoined);
email.Subject = Party;
email.Body = "";
if (!String.IsNullOrEmpty(calendarEvent))
{
System.Net.Mime.ContentType calendarType = new System.Net.Mime.ContentType("text/calendar");
calendarType.Parameters.Add("method", "REQUEST");
AlternateView ICSview = AlternateView.CreateAlternateViewFromString(calendarEvent, calendarType);
email.AlternateViews.Add(ICSview);
}
And here is the .ics itself:
BEGIN:VCALENDAR
VERSION:2.0
METHOD:REQUEST
PRODID:my#product.com
BEGIN:VEVENT
CLASS:PUBLIC
CREATED:20151115T152442
DESCRIPTION:Awesome party
DTEND:20151115T192442
DTSTAMP:20151115T142442Z
DTSTART:20151115T172442
LOCATION:Party room
PRIORITY:5
SEQUENCE:0
SUMMARY:Lets get wasted
TRANSP:Transparent
UID:1735cdca-cb36-4e6b-a1ec-4fb4149f798a
END:VEVENT
END:VCALENDAR
When this email comes to Gmail client, I can correctly see the invitation with option to add event into calendar, which works fine.
But in outlook.com even when the email itself is correctly recognized as invitation and I can see accept/tentative/decline buttons it does not work as expected. When I click for example accept option, new response email is created and when I send it out, I would expect, the event will be set in my calendar, however there is no event synced.
Can someone please see why events are not synced in calendar in outlook.com?
Also, is there possibility in outlook.com to just set event in calendar, without sending response email? - invitations are auto-generated from system no need for response.
Thanks
Finally I've found a solution - there was missing ORGANIZER parameter of the VEVENT part in .ics. Gmail is able to handle that, Outlook.com not. So the trick was to add following line when setting DDay.iCal.Event object:
evt.Organizer = new Organizer("organizer#mail.com");
Everything else remained untouched so the final look of the .ics which works in both - Gmail and Outlook.com is this:
BEGIN:VCALENDAR
VERSION:2.0
METHOD:REQUEST
PRODID:my#product.com
BEGIN:VEVENT
CLASS:PUBLIC
CREATED:20151115T152442
DESCRIPTION:Awesome party
DTEND:20151115T192442
DTSTAMP:20151115T142442Z
DTSTART:20151115T172442
LOCATION:Party room
ORGANIZER:mailto:organizer#email.com
PRIORITY:5
SEQUENCE:0
SUMMARY:Lets get wasted
TRANSP:Transparent
UID:1735cdca-cb36-4e6b-a1ec-4fb4149f798a
END:VEVENT
END:VCALENDAR
Now it works fine.

NetSuite Sublist/child record does not update/refresh in edit mode

If the form I am on is in edit mode, and I add items to the sublist (A child custom record) via my suitescript I can not get the list that is visible to the customer to refresh/update.
I have attempted to use the following command, but then found that it only works on a static / read only list.
// Refresh the package contents list
nlapiRefreshLineItems('recmachcustrecord_myCustomRecord');
Is there a way to force a sublist/child record to update its view when the parent transaction form is in edit mode?
On my form I have clicked my "Do Something" button which is to create child records. After the records are created the transaction form does not update the sublist. When I exit edit mode the form then realizes the new lines and displays them.
Thank you,
You may have other fields on the record that are not saved yet.
In order to do what you want you'd have to save the record and reopen it with your script.
Here is an example from Netsuite help of saving and reopening a record:
try
{
//committing the phone call record to the database
var callId = nlapiSubmitRecord(call, true);
nlapiLogExecution('DEBUG', 'call record created successfully', 'ID = ' + callId);
//Redirect the user to the newly created phone call
nlapiSetRedirectURL('RECORD', 'phonecall', callId, false, null);
}
catch (e)
{
nlapiLogExecution('ERROR', e.getCode(), e.getDetails());
}

Sharepoint Designer 2007 - Form field with an ADDRESS BOOK button

I'm developing an approval workflow in SP Designer 2007. I need a form field that will allow the user to verify that they have entered a working email address from Active Directory into a form field. (This will be the email address of the user's supervisor who grants approval - if this email address is wrong the entire process is derailed). I'm thinking it would work just like the Address Book button in an email form. Or better yet, like the Check Name button that simply checks the email address currently entered and verifies it by underlining it or some other visual cue.
Seems like an obviously useful behavior - I must be missing something - I am new to SP. Thanks!
Can you not run an LDAP query using the current users username, getting the user "Manager" field. Use that to get the managers email address.
That way the user only overrides the email address if they explicitly want someone elses.
Here is a little code to help you do an LDAP query
using System.DirectoryServices;
//DirectoryEntry de = new DirectoryEntry("LDAP://wel0101");
DirectoryEntry de = new DirectoryEntry();
DirectorySearcher deSearch = new DirectorySearcher(de);
//deSearch.PropertiesToLoad.Add("Email");
SearchResultCollection results;
deSearch.SearchScope = SearchScope.Subtree;
deSearch.Filter ="(&(objectClass=user)(cn=bacchu*))";
//deSearch.
results = deSearch.FindAll();
foreach (SearchResult result in results)
{
ResultPropertyCollection props = result.Properties;
richTextBox1.Text += "------------------------\n";
foreach (string propName in props.PropertyNames)
{
richTextBox1.Text += propName + ":\"" + props[propName][0] + "\"\n";
}
}
richTextBox1.Text += "Done" + DateTime.Now.ToString() + "\n";

Couchdb and Sofa Help

I'm new to Couchdb just a few week back I git clone the couchdb app called sofa [what and app] . Over the week It was going great but suddenly today I stumble upon something.
Here what I meant
when I browse the Sofa app and try to create a Post without the title
it prompt with and alert box "The document could not be saved: The database could not be created, the file already exists." which was weird as looking at the source I found that the require (in validate_doc_update.js return its custom json error) something like in this format {"forbidden" : message }) with forbidden as key
v.forbidden = function(message) {
throw({forbidden : message})
};
v.require = function() {
for (var i=0; i < arguments.length; i++) {
var field = arguments[i];
message = "The '"+field+"' field is required.";
if (typeof newDoc[field] == "undefined") v.forbidden(message);
};
};
in validate_doc_update.js
if (newDoc.type == 'post') {
if (!v.isAuthor()) {
v.unauthorized("Only authors may edit posts.");
}
v.require("created_at", "author", "body", "format", "title");
inspecting the response state that the json returned was found to be different from the json had it would have been return by the above require function in validate_doc_update.js
here is the json
{"error":"file_exists","reason":"The database could not be created, the file already exists."}
This make be believe that the validation in validation_doc_update.js only execute during updating of document
to Prove this point I try to update a document without the title, expecting that it would return the error but surprisingly the document just got saved
so Here are my Question regarding all the Point I mention above
Does validate_doc_update.js "validate" work only during updation of document
if YES
then
how can I manage to succeed in updating a post without the error [Weird bypassing the Validation Completely] . + How can execute validation on create of a document
if NO
then
What is the Error {"error":"file_exists","reason":"The database could not be created, the file already exists."} that is prevent a document to be saved
Can anyone please share light on all the questions listed here
Yes, the validate_doc_update functions are run only when updating documents (include creation and deletion).
The function you show here will allow a document without a title as long as its type is not "post". If you could include the actual request you attempted, I could confirm it.
Finally, the ""The database could not be created" is because you are attempting to create the database (by doing PUT /dbname/ instead of PUT /dbname/docid, I would guess) when it already exists. Again, if you would include the actual request, I could confirm that too.

Resources