Add link to contacts in outlook Appointment Module Form using custom fields - vb.net

I'm a long date leecher of this site... this is the first time I'm not able to find a response (Google didn't help too).
Well, what I am trying to do is to add an active link to a contact to a custom field in an Appointment Module Form.
I can put the address I want in the appointment custom fields using this code (vb.net):
Dim extendedPropertyDefinition = New ExtendedPropertyDefinition(DefaultExtendedPropertySet.PublicStrings, "MyField", MapiPropertyType.String)
item.SetExtendedProperty(extendedPropertyDefinition, "address#iwant.com")
I am able to view MyField using a custom field in my Appointment Module Form.
Setting "To" field to the value (in custom field properties) i can transform the e-mail into the corresponding contact name (obviously if it exists in contacts list).
Here comes the trouble:
I would like to add a link to contact card when clicking the contact name.
I don't really know if it is even possible...
Thank you very much for any help... "It is not possible" will be an appreciated response too.

Related

Populating Fields in InfoPath using the People Picker

I've got an InfoPath form and have set up a Data Connection to enable me to retrieve details of a persons account using the people picker.
I've got the First Name/Last Name/Department and Job Title. When I open up the People Picker the only fields I'm getting are Display Name/AccountId and Account Type (as pictured).
Is there a way of getting the information I want?
You can try to get it with the UserProfile webservice of sharepoint. (_vti_bin/UserProfileService.asmx)
f.e:
https://blogs.technet.microsoft.com/anneste/2011/11/02/how-to-create-an-infopath-form-to-auto-populate-data-in-sharepoint-2010/
For anyone still looking for an answer to this:
Unfortunately the UserProfile webservice no longer works in Sharepoint online and produces error 5566.
The best work around for this I've found would be to use a data connection to the hidden User Information List on the root of your page.
So step-by-step:
Add a new data connection for User Information List at the stem of your site
Select the needed fields (in your case First_name, Last_name, Department and Title)
Leave "Store a copy of the data in the form template" unchecked and click "Next >"
Uncheck "Automatically retrieve data when form is opened" to query based on selected users, instead of downloading all user data
Create Rule on change (no condition) on your First and Last Name fields and run the following actions in them:
Set a field's value for first and last name:
in "Field" select queryFields First_name/Last_name of your data connection
in "Value" select your first/last name field
Query using a data connection your Sharepoint List data connection or to User Information List data connection to find any user in the members AD group
Set a field's value on your people picker:
in "Field" select the Displayname of your forms people picker (only available in advanced view)
in "Value" select the dataFields > People Picker > Displayname of your data connection
Hope that helps, I'll edit to include pictures soon.
Please let me know if you wanted to set First name, Lastname, Department and Job title based on the people picker, because this would also be possible. Thank you in advance!

creating fields in lotus notes document?

I am trying to export items from my access database into lotus notes. The document I am trying to export to is a stationary, and has all the data written into it, I just need to somehow mark placeholders and then update the values. I have read the documentation and it appears I will need to address fields and then call a method to replace the text like so:
'where body is the field and the following string is what to replace field with
Call doc.ReplaceItemValue("body", "REPLACE BODY")
To be clear, my entire code looks like:
Set session = CreateObject("Notes.NotesSession")
Set maildb = session.GetDatabase("server", "mail\box.nsf")
Set View = maildb.GetView("Stationery")
Set entries = View.AllEntries
Set entry = entries.GetFirstEntry
Set doc = entry.Document
Call doc.ReplaceItemValue("Subject", "Report - " & Date)
'add code here
Call doc.send(False, "person.to.receive#thisemail.com")
End Sub
I have noticed that while perusing documentation, there seems to be an ability to create fields, and then address those fields to update values. So for example, if I have a field named $COST, then one could do:
Call doc.ReplaceItemValue("$COST", "The cost is $3000")
And that field should be updated to reflect the value I passed through the method. My big problem is, even looking through documentation, I cannot figure out where I need to go to add in my custom fields. It seems that the documentation assumes that you know how to create these fields and just address them. Or am I only supposed to create these fields programatically and then fill in the data? My client is Lotus Notes 8. Thanks!
Yes, that is the cool thing about IBM Lotus Notes databases: you can put items (=fields) in a Notes document without a prior definition of fields.
If you create items in a document with doc.ReplaceItemValue() and save or send the document then the items are just there. You can check the items when you open the property box for a selected document. All items are listed on document properties' second tab.
Another question is of course to define fields in a form so that the created items are visible to user without looking at document properties box. Open database in Designer and put the fields in right position and size to form.
Your question and comments telling that you want to create a document, fill it with data and send it to users.
If all users have access to your Notes server then you can create that document in your existing database and send just a link mail to users. This way you can create a good looking form and position all your data fields. Users will access the document in database through link.
An alternative is to create an nice looking HTML file, attach it to the mail and send it.
In this case you would add this code to your example at 'add code here:
Call doc.RemoveItem("Body")
Set rtitem = doc.CreateRichTextItem( "Body" )
Call rtitem.AppendText("your mail text")
Call rtitem.EmbedObject(EMBED_ATTACHMENT, "", "report.html")
Based on the comment thread on #Knut Herrmann's answer, I believe that the solution you really want involves using "stored form". The first argument to the NotesDocument.Send() method is a boolean that specifies whether you want to store the form or not.
Normally, you would use Domino Designer to create a stored form. You would not need Designer rights to anyone's mailbox. You would just need to create an empty database of your own, and put a form into it. You woould change your code to open that database and create the document in there instead of in a mailbox database as you are doing now. (One of the other cool things about Notes is that you don't actually have to be working in a mailbox database in order to mail a document. You can mail any document from any database, as long as you put the approporiate fields into it.)
There is also a way to do this without Domino Designer, and you could even dynamically generate the form with truly custom fields that your code only discovers as it runs. You could do this with DXL, which is an XML format for describing Lotus Notes objects, including forms. You would just need some sample DXL to work from. Preferably that should be of an empty database that contains a simple form that is set up more or less in the layout that you would want, though again you would need Domino Designer for that. You could just use the same mailbox database that your code is currently using, but that will leave you with a lot of extra stuff in the DXL that doesn't need to be there; and given that you're not all that familiar with Notes, it would likely be difficult for you to navigate through it all to find what you need.
Either way, though, you could use the NotesDXLExporter class to generate the DXL file. Your code could manipulate the DXL, adding/changing elements as needed (following the pattern that you see in sample, of course), and they you could use NotesDXLImporter to create the database that your code will actually use to create the document in and mail the message with the stored form.

How to find owner of a shared calendar in appointment and meeting window?

There is no field in the appointment Item or the meeting item that determines the current calendar which i am accessing is shared calendar or my own calendar folder?
How do i get this? Is there is a way in outlook object model to get this?
You can access the meetingItem.Parent.StoreId (not the AppointmentItem, I believe). What you get then is a HexId string that, if converted to a plain text string, contains the MS Exchange account name after /cn= (I think at the end of the string).
With that name, you can do a CreateRecipient(thatName) and Outlook.Recipient.Resolve() it.
After that, you can access the name of the account by using recipient.Name
Sorry, I tried to paste code in this answer, but it didn't work as expected and took too long. Please ask if you need more directions.

Syntax for SharePoint 2010 BCS URL Action to populate New form

Have seen several posts with solutions for native SharePoint lists, including the very useful SPUtility.js (only for native SharePoint lists). But nothing to pass a value from a BCS list to a new BCS list. The Query string filter will not connect on the New form (no web part to connect it to) and does me no good on the lists page (already have that working).
A "go write custom code for everything" is not a solution for me.
There should be a way to 1) pass the value in the URL (ideal - what's the syntax?) or 2) make some other simple change, perhaps to the select list for the item -- I just can't find it. Have seen quite a few posts with similar questions. The Microsoft documentation is not useful and there are more questions on the "social" topics than answers.
Here's what I have:
I have a BCS list (sends item) tied to a BCS related list (receives item).
I have an action on the related list (ECT) to create a new item. Works fine with no parameters. I get a blank new form. The new form allows me to enter two items and choose two items (exactly as intended).
What I would like to have is the necessary ?something=something string so that my user does not have to select one of the choice items (MNumber - set as a key / required value)
User selects "New" from Actions.
Form Opens
MNumber is automatically filled in based on the MNumber of the current item displayed in the BCS related list.
The string I supply is accepted. Does nothing.
/intake/Lists/ContactsList/NewForm.aspx
/intake/Lists/ContactsList/NewForm.aspx?MNumber=1234
The string I supply is rejected - cannot be saved or insufficient values.
/intake/Lists/ContactsList/NewForm.aspx?MHICNumber={$MHICNumber}
Have also tried passing a string to one of the text fields (instead of the select field). Can't get that to work either. I've spent quite a few hours with the various boards. Nothing helpful.
Would also be nicer if I could set the New form to display in a pop-over window (as it does when I select New from the list view). Opening a new browser window is hokey and replacing the existing one is a navigation pain for the user.
Have this working ... Thanks to Kit Menke!
Created an Action on the External Content Type in the BCS....
/intake/Lists/ContactsList/NewForm.aspx?IDnumber={0}&Source=/intake/scheduling.aspx
where
parameter property 0 is the IDNumber from the ECT
The NewForm.aspx was edited to add a hidden content editor web part with references to three scripts Kit wrote - two supporting and one that sets the values.
http://site/list/NewForm.aspx?toolpaneview=2
User selects the Action on the displayed ECT list
Action uses the URL to go to the New page with the data
Kit's script adds the data to the form and puts in the date and time.
Note: The ID field needs to be a text field. Cannot be a selection list.

How can retrieve email address from the Infopath people/Group picker

How can retrieve email address from the Infopath people/Group picker?When I add the people/Group picker into the infopath form, I only get 3 fields DisplayName,AccountId,AccountType.Can anyone show me how can I get the email either by configurations or by code.
In SharePoint Designer, when setting up a workflow to respond to an InfoPath people picker field, I simply map the "TO:" field of my "Send Email" action to whatever people picker field I have (even if it's set to pull the Display Name)... and the email will successfully send out regardless. Now, your mileage may vary and perhaps it's due to our Exchange server settings and small company size which allows this to work.
Anyways, try it out. Maybe extracting an email address from the people picker is a superflous step.
I have a simpler solution.
Assume you are using the connection wizard to send an email to a person selected from a people picker.
in the to field -
concat(substring-after(AccountId, "\"), "#domain.com")
assuming your companies mail accounts have an entry for username # domain.
because AccountId = domain\username
so we end up with username#domain.com
Worked for me
Create a button and the following rules for that button.
Create a data Connection to retrieve from GetUserProfileByName.
Create a field to store the email you are retrieving.
Rules for the button
Rule 1 Set a fields value. Set the value of the AccountName of GetUserProfileByName to equal the AccountID from the people picker.
Rule 2 Add an Action to to Query the Data Connection GetUserProfileByName
Rule 3 set a fields value to the email address of the query you just performed
Filter Data
Change value to name
If you simply want to populate a field with the email address from your domain this works perfectly. I have been banging my head on the double eval trick for two days. I got it to work but the form rendering in SharePoint took 2 minutes and 46 seconds.
I know this is too late for the answer but still i am writing this so that someone can get help in future.
When we keep People picker it gives us three values which you specified (AccountId, DisplayName and AccountType).
Now if some one wants to retrieve the email address, there may be so many requirement but i guess most of the person want to send mail to the user which are selected into people picker.
If you want to send mail to selected user then you can just use AccountId field into your workflow item. SharePoint designer automatically detect the email address from the AccountId and sends the mail.
I hope this might save someone's time.