I have an Outlook COM addin and would like to be able to read the current search box text value that the user has enter. How do I do that?
The Outlook object model doesn't provide anything for retrieving the search criteria. The best what you could do is to get the filter string for the current view of the folder or explorer window. The Explorer.CurrentView property returns or sets a View object representing the current view. And the Folder.CurrentView property returns a View object representing the current view. For example:
Private Sub FilterViewToLastWeek()
Dim objView As View
' Obtain a View object reference to the current view.
Set objView = Application.ActiveExplorer.CurrentView
' Set a DASL filter string, using a DASL macro, to show
' only those items that were received last week.
objView.Filter = "%lastweek(""urn:schemas:httpmail:datereceived"")%"
' Save and apply the view.
objView.Save
objView.Apply
End Sub
The View object allows you to create customizable views that allow you to better sort, group and ultimately view data of all different types. There are a variety of different view types that provide the flexibility needed to create and maintain your important data.
The table view type (olTableView) allows you to view data in a simple field-based table.
The Calendar view type (olCalendarView) allows you to view data in a calendar format.
The card view type (olCardView) allows you to view data in a series of cards. Each card displays the information contained by the item and can be sorted.
The icon view type (olIconView) allows you to view data as icons, similar to a Windows folder or explorer.
The timeline view type (olTimelineView) allows you to view data as it is received in a customizable linear time line.
Views are defined and customized using the View object's XML property. The XML property allows you to create and set a customized XML schema that defines the various features of a view.
The View.Filter property returns or sets a string value that represents the filter for a view.
The value of this property is a string, in DAV Searching and Locating (DASL) syntax, that represents the current filter for the view. For more information about using DASL syntax to filter items in a view, see Filtering Items.
Also you may find a similar post helpful.
Related
I'm building an app for TravelInfo. Here are the fields: From, To, City, Country.
I am using common data source entity. And for the country lookup, I want to use a sharepoint list, that has all the country names.
I'm stuck at this stage. As you see in the snap, I want to connect the country dropdown to a sharepoint list.
[I've tried to achieve the same with picklist. But Its not good to manually create the huge list of countries in picklist. Sharepoint list should be ideal.]
Here is the question: In one form, how can I use different datasource for different fields??? Please help.
A form will save the data card value defined in Update into the field defined by DataField. You are trying to change data displayed on the dropdown which is not set in the Fields list you have above. Try the following (the first few steps may already be completed based on picture):
Check Country to insert data card into form
Select data card and under Advanced properties click Unlock to change properties
Delete text box from data card that was added by default
Select data card and insert desired control (drop down box)
Select drop down box (not data card) and under Advanced properties define Items and Value to populate values from the sharepoint list
Select data card and change Update to desired dropdown value that should be saved e.g. dropDown1.Selected.country_id
The drop down box can display the Country text on the form, but then save an associated value such as the country id.
I'm modifying the properties form of a SharePoint list that requires the user to select one or more items via a lookup to a document set. The document set library has a "Name" field which I cannot select as a field in my form's lookup properties.
The document set, of course, is a collection of documents grouped together with a common name, workflows, and metadata. The "name" I'm trying to display in my lookup list is set by the end user, but is inaccessible to me. Ideally, when someone is viewing an item in my SharePoint list (the one I'm trying to link from) and they see an associated document set item, they would be able to click on the name and it will take them to that element within the document set.
Any ideas?
Okay, I got around this issue by creating a new workflow that fires any time a record is modified. This workflow sets a new text field to the value in the Name field. To apply this to existing records, I created a new checkbox field named "Fire Workflow", then went to the Datasheet view and checked that checkbox for all of the records. This forced the workflow to fire on each record and update the new text field.
Now I just reference this new text field for the lookup in my other library. All is good!
Is there a way to force a documents computed fields to recalculate from within an Xpage, without saving the document?
I have a subform on a Notes database with many computed fields, these contain some complex calculations involving time range calculations. The database is used as both a web and client application. For the custom control containing the fields I don't want to have to recreate all the calculations, so have a computed text value bound to the computed form on the document.
On the subform as you tab through entering the information the computed fields are recalculated. On the custom control I have a refresh button which saves the datasource and does a partial refresh of the data entry section, but this can cause some errors or document save conflicts.
I will recreate the calculations if need be, but I just wondered if there is a slicker way of achieving this before I start that process?
DominoDocumentData object has computeDocument() and doComputeDocument() methods. I'm not sure what they do. If you look at the class for your XPage / Custom Control under Local\xsp you can see them. Using the variable name for your datasource, e.g. document1, you will be able to get a hold of the DominoDocumentData object and case it to that class.
There is no such thing as "computed fields on a document". A document is completely unaware how its items got their values.
Computed fields live on forms. You have 2 options (you can use one or both).
when defining a documentDatasource you can specify that the formulas are executed on load and/or save.
use the document.computeWithForm method of the NotesDocument
I am trying to simplify an existing Notes Form in an application that I am converting to XPages. The Notes Form has over 240 fields on it and a bunch of logic that I want to clean up. Plus the form has all kinds of display formatting that makes viewing it complex. So what I have been trying to write an agent that will get FormA and cycle through all the fields and copy them to FormB. I will then use FormB to bind my XPage to and trying to track down data issues will be much simpler. If the FormA didn't have so many fields I would just recreate it manually, but I'm sure with over 240 fields I would introduce some new typo errors.
You don't need to do anything with your form in order to create a XPage layout for it.
XPAges don't need a form at all, although it makes development easier, as after creating the data binding all fields from the form are available and can be dragged and dropped to the Xpage. Fields that are not on the form have to be created manually in the source code of the xpage (e.g. copy and paste an existing one and change the binding/name)
If you want to clean up your documents, an agent can do this without even touching the form.
For this task please consider the difference between a "Form" and a "Document".
A form is a design element that defines the look and feel of a document.
Forms contain fields that define what type of data you can put in your documents.
A document is a stupid "container" for items (not fields). It contains items for any field on the form that existed in the form when the document was created / last saved. PLUS items that are created any other way (e.g. Using formula or lotusscript agents) or that have been on the form in an earlier stage of development.
If you remove a field from a form, it will NOT be removed from the corresponding documents, not even by saving them. But If you add a field to a form, the document will have an item for that field after saving (forever, if you don't remove it manually using an agent).
With this knowledge you can simply create a new, "cleaner" form with the same name as the old one and rename the old one. From this time on, document will be displayed with the new Form and you can develop your XPage using it as your data source.
If you need to accumulate the data in the documents, this can be done with an agent without using a form: just manipulate the document DIRECTLY.
Here is an example in formula to put two fields together:
FIELD NewFieldName := OldField_1 : OldField_2;
FIELD OldField_1 := #DeleteField;
FIELD OldField_2 := #DeleteField;
I think, in most cases it's not a good idea to have a form with 240 fields. It looks for me like a form from old Notes 3 or 4 times when no embedded views were available and one to many relations were put into fields with index e.g. 1 to 20.
Maybe, a redesign is a better way to go.
Also, you don't need to create and maintain a form with all 240 fields for developing your XPage. Actually, you don't need the form at all. With a data source definition based on "Domino Document" you define a form name and which way you want to create a new document or find an existing document. That's it. Then you can create your fields in your XPage. Give them a name and a type. You can do this in Designer UI. Just write the new fieldname into "Bind to" for selected "Data source". Select in "Display type" a field type (String, Number, Date/Time). That is not only valid for display but will save the field as selected type to document too. In this example it will create a new field "YourNewField" and will save it as a integer number.
When you submit the page all fields will be created or set in document. You can check the fields and their types in Notes client using the document property box.
A good way though is to create the form with the most important fields. Then you can open the document in Notes client and check the fields set by XPage.
I've created a custom field type based on SPFieldLookup. When I use SharePoint's "Export to Spreadsheet" function, however, it's not rendered correctly.
For normal lookup fields, only the Lookup Value is rendered. For my custom field, the string representation of the lookup value is used (i.e., "1;#My Lookup Value").
Is there a way to change the custom lookup field so that it will render only the Lookup Value when exported to a spreadsheet?
I'm not sure if its possible to do what you want.
Here's a note from the SPFieldLookup documentation on MSDN:
Notes to Inheritors: In Windows SharePoint Services 3.0, columns based on custom field types do not appear in Datasheet view and are not included when you export a list to a Microsoft Excel spreadsheet.
Maybe you can look into the DisplayPattern element in your fldtypes_XXX.xml