"Relational operators are not supported in text fields" - lotus-notes

I am getting the error : "Relational operators are not supported in text fields" when I am doing db.FTSearch(FIELD examplefield >= 02/25/2013). Here field name is "examplefield" & field type is datetime
Can any one help for fixing this issue?

As described in the question that Simon linked to, the UNK table in a database will determine the data type that is used for a field when doing full text searches. The data type you have set for that field on any particular form does not matter - the field in the UNK table is defined by actual data on documents, and does not automatically re-calculate itself. So, you first want to ensure that "examplefield" in every document in which it exists has a datatype for date-time. But then, you would also need to re-build the UNK table. There are 2 ways - that I know of - to do this:
Drop the full-text index on the database, compact the database, and then re-create the index.
Create a new replica of the database and replace the existing database with the replica.
Also, you can check the datatype for a field in the UNK table using the freeware NotesPeek tool - which you can download from here:
http://www-01.ibm.com/support/docview.wss?uid=swg24005686

In general, I wouldn't use FTSearch. I would create a hidden view with the first column sorted by examplefield as text with format yyyy-mm-dd. Then, you can use this:
set o_doc = o_hidden_view.GetDocumentByKey("2013-03-25")
while not o_doc is nothing
'Do something
set o_doc = o_view.GetnextDocument(o_doc)
Wend
In my opinion, it has a better time response at expense of put the load in the server. As always, it depends what type data you want to handle.

Related

Table with variable number of rows in MS Office mail merge [duplicate]

I'm creating a compliance mailing for my organization, the mailing will include merge fields that identify the office location, physician, and SiteId. The mailing will also include a table of information that is dependent upon the particular SiteId.
I'd like to use the import table function of MS word and set up a query that references a merged field (SiteId) so that the inserted tables populate the appropriate data for the particular site. I'm unable to do this.
How can I set up this document so that I can import only records from my source (an ms access query) that match the SiteId merge field?
Word's mail merge does not support one-to-many relationships. There are ways to coerce it, but only one of them can yield a table as a result and over the years it has become less and less reliable as Microsoft has not regarded it as important enough to maintain...
What you need to do is set up a query that provides ONLY the information you want displayed in the table, plus the key (SiteId). It's best to sort it so that all the SiteId entries list together, and are in the order the data will come through in the mail merge data source.
On the Insert tab go to Text/Quick Parts/Insert Field and select the Database field from the list in the dialog box. Click "Insert Database" and follow the instructions in the dialog box to link in the data. Be sure to set the Query Options to filter on the first SiteId from the data source. When you "Insert Data" make sure to choose the option to "Insert as a field".
This inserts a DATABASE field in the document which you can see by toggling field codes (Alt+F9). The field code can be edited and what you need to do is substitute the literal SiteId value you entered for the query with its corresponding MergeField.
When you execute the merge to a new document that should generate a table for each data record corresponding to the SiteId for the record. But, as I said, Microsoft hasn't done a great job of maintaining this, so it may require quite a bit of tweaking and experimenting.
If the results are not satisfactory then you should give up the idea of mail merge and use automation code to generate and populate the documents.
You can find more (albeit somewhat out-dated) information on this topic at http://homepage.swissonline.ch/cindymeister/mergfaq1.htm

Microsoft Access 2013 Record Source Columns

I recently got tasked with customizing a report in an access database, I havent touched access in years so its a little rusty for me. I have successfully added the Fields to the table, added them to the form and added them to the report. If i run the report they query correctly. But all the other fields on the report are setup with an expression such as:
=IIF([Mold Temp High]=0,"----",[Mold Temp High])
Now the expression makes 100% to me but when it auto populates the field, such as Mold Temp High, for all the previous fields i can see they show up as Record Source Column fields, but for any new field i have added shows up as a Text Box.
If i create an expression with the new fields i get a Circular Reference and it shows #type on the report instead of the value.
Just curious to why the new fields show up as TextBoxs and not Record Sources.
I'm guessing that you are dragging the new fields from the field list. When you do this, it creates the text box with the exact same name as the data field. So when you use this name in an expression, it thinks you are referencing the text box object. To prevent this problem, make sure that every time you create a new textbox (or any control) from a data field that you name it something different by setting the Name property of the text box. Generally I just add "txt" to the front of the field name. This will ensure that you are always explicitly referring to either the textbox name or the data field name.
What if you change your logic around a bit..
We remember, IIF is constructed as:
=IIF((Some_Table_Field or value),True-condition,False-condtion)
You maybe looking at:
=IIF([Mold Temp High]=NULL,"----",[Mold Temp High])
Or, maybe (use ISNULL or ISBLANK it has been a while for Access with me as well):
=IIF(isnull([Mold Temp High]),"----",[Mold Temp High])
Or, rather:
=IIF([Mold Temp High]<1,"----",[Mold Temp High])
Hope this makes sense.

Sitecore check if an item has a delta with presentation details standard template

We have a lot of products that are stored as a Sitecore item.
Many of them use the presentation details defined on the Standard Values of the product template.
Now I would like the check for each product, if the presentation details is the same as the standard values.
And if they are not the same as in the standard values, I need to see the delta.
Someone an idea how to achieve this?
You can query all items and look at the "__renderings" field and come the value of it to the same field on the standard values. This field is the XML that stores the presentation settings. Any pages that have a value that doesn't match the standard values has been changed.

Lotus Notes: What will be the view selection formula to select a form which is in different database?

My view is one application and a required form along with few fields are in different application.
Point one: A View's selection formula does not "select a form". It selects documents. These documents are (usually) created with a Form, and they (usually) contain an item called "Form" which contains the name of the Form that they were created with. So a selection formula SELECT Form = "Foo" means that the view will show all documents with an item named Form that contains the value "Foo".
Point two: A View can only select documents that are in the same database that contains the View. It cannot select documents that exist in another database.
Ergo, there is no possible forumla that selects documents in another database that were created with a given Form.
I'm assuming you probably have some keyword documents in a different database, and you'd like to use a key in the main document to pull some matching information from the keyword database. In other words, you'd like to do a "join" in your Notes view.
You can't do this, never mind whether the documents are in the same database. This is not a relational database.
There are options, however.
You could create a "user definable" column and automatically update the column formula in a profile document so that the formula can calculate the keyword correspondences. You would have a periodic agent look at the keyword database and construct an updated formula such as, #Select("a"; "b"; "c";...; ChoiceNo) to convert the number field ChoiceNo to the value "a" (for 1), "b" (for 2), etc. If you can write a formula to display the correct values for the current keywords, this is workable provided the list never gets too long.
Domino servers are capable of accessing a DB2 relational database to construct a view index, using a feature called DB2NSF. So you can actually do a join -- but your NSF data has to be stored in DB2 as its back-end, rather than beinf stored in the NSF, for this to work. This is probably going to be more work than it's worth to you for this application.
If it is an XPages application, you can create your own data set however you like for feeding to a repeat control.

How does CRM 2011 auto-wire the StringMapBase table in for Option List picks in Advanced Finds?

The StringMapBase SQL table is the table that holds Option List values that have been added to an entity. When using an Advanced Find in CRM 2011, if you select a pick list column (Option List) value from an entity to be added to the resultset, the Advanced Find mechanism somehow auto-wires in the string value of the pick list from the StringMapBase table instead of showing the StringMapBase's Primary Key value that's actually stored on the record.
I'm in the process of creating SSRS reports that hinge on some Option List values:
// SQL psuedocode
Select...
...
Where Value = 'Some String Value of Interest'
However, I very much dislike the fact that, so far, it looks like I basically have to write in some ad-hoc SQL in order to get the applicable StringMapBase value. In order to do so, I have to hard-code some magic values, which I despise.
Does anyone know by what mechanism the CRM Advanced Find engine auto-wires these values in? Or does it simply do its own join to the StringMap system view or use a SPROC somewhere?
When you use the Filtered views (the only supported way to read data in your report) there will be an additional "logical" column for Bit, Picklist, and Lookup columns. For an attribute named "new_option" you should be able to add "name" to the end of the column name and query "new_optionname".
select new_option, -- Integer
new_optionname -- StringMap joins generated by Filtered Views
from Filterednew_test

Resources