How to create a View with replication conflicts - xpages

I wish to create a view showing a number of fields from notes documents with replication or save conflicts. So far I have managed to create a basic view with a column for the document ID (Contract ID) then the next column states "Replication or Save Conflicts" but I don't seem to able to either get rid of the replocation or save conflcits column or add new columns to show additional fields from the document. Is there a way I can do this? I want to be able to show the view in XPages. Here is the View selection formula I am using;
SELECT #IsAvailable($Conflict)

Conflicts are not displayed good in views. here are a few alternative tips to deal with conflicts that might give you an idea or two :-)
Create a categorized column with the value of the field $ConflictItems in the view you have, then you will see which item is causing the conflict and can take action to prevent it.
When you open a conflict you can use the action menu "View Parent" to compare the parent and the conflict
Ytra ScanEZ is a great tool for finding and resolving conflicts. it is also possible to create a script that will compare the documents and present a diff list.
You can create an XPage to display your conflicts (and parents). The web is more dynamic as it allow you to layout your data in the way you want and is not restricted to the way view in Notes works. This kind of xpage can be displayed in Notes client or Web browser

Use XPages power. Get all documents from the view with your selection formula. But don't try to show any column value and get fields directly from back-end document you get from view entry entry.getDocument().
Sure, it has some performance impact, but for (hopefully) small amount of replication conflict it's nothing serious.

Related

Kentico - WHERE condition for custom Page Types page

I have a custom page type for employees, and one of the fields is Location. I want to show/filter only employees in "San Jose" or "San Francisco" and used this WHERE condition below but it didn't work. Apparently, I missed something very basic. Could you help?
Location LIKE '%San%';
I did another test, where instead of page type, I used custom table with the exact field names and was able to filter using the same statement. On a related note, I'm new to Kentico and exploring which is more suitable for creating/maintaining a list of about 100 employees - Page Types or Custom Tables - with the ability to filter by department, location etc. Appreciated your input here as well. Best!
If you're adding the WHERE condition into a standard Kentico repeater or other data source, the syntax looks right except you do not need the semicolon ";".
You'll also want to double check the field name, and if you are limiting your query to certain columns (as is best practice especially for larger data sets) and be sure the field you are filtering on is being selected.
Regarding the management of your employee list, either method you've described will work. In that scenario it typically depends on who will be editing the content, and how frequently. It is more editor-friendly, in my opinion, to add those documents into the content tree. This also gives you quicker control over the order, and keeps it similar to how other content on the site is maintained. I also like to set up folders or other parent page types as categories if needed, so the documents can be dragged and dropped between them and it sets up a visual taxonomy that isn't possible if it's all stored in a table. Storing items in the tree also allows for workflow and versioning, as well as more granular control over permissions/access, if this is important to you.
It's awesome that you are thinking about how to best store your data in advance. There many factors to consider such as overall number of records, number of columns, the fact whether you need to use workflow, versioning, preview etc..
The best source of information regarding this would be this article which summarizes all options you have and gives clear explanations of which to use in which scenario.
And to your original question - What components are you using to display the data? Is the repeater? If so, can you make sure to set the Page types property to match the page type you are displaying? If the page types is not configured, Kentico will not load any custom fields because it doesn't know from which table it should load the data from.
Additionally make sure to either include the "Location" field in the Columns property or leave the columns blank (not recommended because then Kentico loads all columns which is like 200. when you count all from CMS_Document, CMS_Tree etc..)
Below is the framework that I use to debug whenever I wish to add a repeater and is facing some problem.
First get all the columns instead of accessing limited columns. Fetching all columns will make sure that I don't have any problem retrieving data.
If I am missing any particular column information name, then I would double check the column name.
I verify this by firing up SQL server management studio and access data from page type table or custom table.
If access to SQL server is not available(generally in Azure hosted solutions with restrictive access to DB), I would enable SQL debug from the settings and see what query repeater is generating to see if it is correct.

Design refresh in Lotus Domino does not include all design elements

I have one template from which I'm trying to refresh the design in my database.
However when I run "load design -f database.nsf" or select "Refresh design..." in the context menu in the Domino Designer it always skips the same design elements when updating.
There doesn't seem to be anything wrong with the settings on database level since some elements are updated properly. But I don't know of any other setting on element level than "Prohibit design refresh" that would result in this behavior. If I delete all forms in the database and refresh design again, only those elements that aren't skipped are added to the database.
I have tried creating new copies of database and template, compact, fixup, updall.
Ideas anyone?
UPDATE 1
Checked my elements (forms) access settings like Knut Herrman suggested, but this doesn't seem to be the issue either. The settings on the access tab is "All readers and above" and "All authors and above". (Would have posted picture, but sadly I don't have enough reputation)
UPDATE 2
Tried deleting all elements in the main database and refreshing after with the result that it skips the same elements as mentioned above.
UPDATE 3
I have uploaded a small example with a one template and one database, and only two forms for design elements, if someone wants to check it out. One of the forms is updated on Refresh, the other is not.
If I use Replace instead it works fine btw.
There is an issue with a Language setting that was applied to FormOne in your example database. I think the refresh is ignoring elements in the template that it does not think match your current language.
When I looked at the fields tab in the FormOne design properties, I saw an item called $BabelInfo. This item does not exist in FormTwo. My hunch was that this has something to do with Language settings, so I went looking for the Language settings in Domino Designer. I couldn't find them in the regular dialogs and editing panes! But when I looked at both forms in DXL¹ there was a Language property set to EN-gb for FormOne, and there was no Language setting for FormTwo.
Using the DXL editor, I removed the Language setting from FormOne. On first attempt, this had no effect, but then deleted FormOne from the database - which I presumed had inherited the Language setting, though I'm not sure I checked that. I did a refresh and it added FormOne to the database. Then I made another change to FormOne in the template and refreshed again, and FormOne in the database was correctly updated.
¹ I had to search around before I figured out how to get at the form data in DXL. A right click in the forms list in navigation pane brings up "Edit in DXL". That option is not available in the list of forms in the main pane.
Most likely, your missing design elements need a certain role.
Define those roles in your destination database's ACL and set the roles for you, your servers and relevant users.
It could also be the dates in the main and the template database, that somehow the element in the main db is newer.
Quick solution: delete the element in the main database and refresh it from the template.
This might seem rather obvious, but double-check that the "Prohibit design refresh or replace to modify" property is not selected in your design element properties, i.e. there should be no ticks in the column highlighted in the image below if you want all elements to refresh.
I suspect this may not be the solution, as you said Replace is working, but I thought I'd mention it.

Create domino view dynamically in XPages

I want to know if I can click a button in my XPage and dynamically create a Domino View and then show it in a panel control on the same page. The reason I want to do this is because I have a categorized view and I don't want to lose category data by using full text search. So I am thinking of creating a new view dynamically and pass my search parameters, like end date or start date, into the view selection formula.
Is it possible? Any other alternative solution is also welcome.
yes you can, but you don't want to. A Domino view takes space in the database and quite some time for its first use. So you end up with a lot of views taking space and the need to adjust database space after removal. Your response times will suck big time.
Categories as shown in Notes views are no web interaction pattern, so you might want to solve a problem that actually shouldn't exist.
The preferred method for Domino application is navigation / drill down over search. But you could do a FTSearch where you add your category to the search parameters and render your results in a repeat control instead of a view control. There you have more control over the look and feel.
Whether or not it's the best solution, the answer to the immediate question about creating a view on the fly is yes: the Database class has a couple "createView" methods to allow you to create a new view, either entirely from scratch or based on a named other view. From there, you can use the "setSelectionFormula" and "createColumn" methods in the created View to build what you want. You can't do EVERYTHING with those methods, but it may be enough.
One problem you'd likely run into is ACL access: you'll need Designer rights to the database, which a normal user most likely wouldn't have. If you use the sessionAsSigner object to fetch a signer version of the DB (say, "var signerDB = sessionAsSigner.getDatabase(database.getServer(), database.getFilePath())"), you can work from there. Off the top of my head, I don't remember if you will also have to up the "Maximum Internet access" setting on the last tab of the ACL to Designer as well, but you may.
I am assuming that you are referring to the problem that exists when you choose the documents based on the category. This is something that I find highly annoying and I wish that it was possible to turn this on and off. It makes sense for embedded views, but not for much else.
What I did to solve this was to include the category value in the next column. In this way that text could still be seen, even if it was a flat view.
Alternatively, you could also look into using a repeater control and create your own way of presenting the information. This would be used instead of a (Dynamic)ViewPanel control. You could then present the information any way you wanted as long as it is returned in the viewrow set.
Happy Programming!

update netsuite parent field via suitescript in view mode

I have scripts that react off of, for example, a client Recalc client event. For example, on my form I have a subtab that users may add or remove items from. Based on actions on this subtab (housing a child record of the parent) I would like a field on the parent to update (say to show a total from the children records).
As I was saying, these events seem to work fine if in edit mode but they do not work correctly in view mode. (even in view mode these child records have a "Delete" option at the end of each row in the subtab. This was provided by netsuite by default.
I wondered if anyone had any tips to best allow this parent field to update real time while in updating the subtab rows with the form in view mode.
Thanks.
You can make a custom field on the parent (header) whose value is determined by saved search. For instance, make a saved search that totals the line values by transaction. Be sure to make it filter by transaction in the Available Filters tab. Make the search public so everyone can use it.
Create the custom field that sources the total from the saved search. Make sure to uncheck the "Store Value" checkbox, as you don't want to store the data, you want to reference the search results. You do this on the Validation and Defaulting tab. You'll see a field for Saved Search there. Choose the search you created above.
As you remove/add/change lines on the transaction, the field updates accordingly. In essence, you don't need a single line of code to make this work - it's all in how you create the search and the custom field that references it.
I have a similar situation posted here.
The NetSuite team answered me by email, and it happens you can't really achieve this on the view mode: some API methods are not available. Their suggestion to my case (and I think it applies to yours too) was really to force a refresh on the whole page.
Of course, you can always achieve this accessing the DOM elements directly, but this isn't a best practice, as your code can stop working if these elements change on a version update.
I had the same problem, I'm not able to restrict on view or remove edit button. But, there was one alternative solution with workflows, you can deploy workflow on child record edit mode restrictions, then if the user clicks edit on view then the record will not be available to edit. This concern will apply to custom record as well.

SharePoint 2010 - Customizing the rendering and behavior of a List field

In my SharePoint List, I have an "Employee" column that is a User type field. I would like to add some custom Business Logic to the processing of this field.
Currently, when the user adds a row, I check to see if the user is an Employee or a Manager and then change the behavior on this column accordingly. I do this by statically rendering the field in my custom "ListForm Rendering Template", just before my custom ListFieldIterator. I simply use a standard SharePoint FormField (and FormLabel) control. In the markup of the FormField control, I specify the FieldName (Employee) and an event handler for the Load event. In this Load event, I will check to see if the current user is an Employee or Manager (using two different SharePoint groups). If the user is an Employee I set the value of the field to the current user (this part works perfectly). I also want to change the field so it can't be modified. I thought I might be able to just change the ControlMode on the field (in the code of the OnLoad Event Handler) to Display, but for some reason this has no effect. The field still renders with the full, people picker editor. Am I not changing the fields control mode soon enough? Or is this simply not the correct approach? The other logic I want to put in is if the user is a Manager, I would like to allow that user to select the person from a list (SharePoint group) of Employees. It may be easier to just use the people picker and limit the selectable users to that group. (I think I can do this with the SelectionGroup property.) Although, it would be better if I could just provide a dropdownlist of users, which I could possibly do with a hidden dropdownlist that I would show and event handlers that I could use (handle event selectedindexchanged) to pull the value selected and populate the (now hidden) Employee (user) field. Does this approach make sense? Assuming all that will work, the real difficulty I am having is with changing the ControlMode (rendering) on the field (when the user is an employee) to a label or some kind of read only control, which is how that field renders when viewing the row, which is why I think if I can just trick the control into thinking it is in Display mode then it should work perfectly!
I am still learning SharePoint, but I am very proficient in ASP .Net. This is why I would like to keep my customizations in this Custom Rendering Template, using code behind and leverage my existing skill set as much as properly.
Any thoughts, opinions or advice? Does anyone know why I can't get the column to switch the "Control Mode"?
I do not think that I fully understand your scenario. Some code samples could help.
But anyway it sounds like you want some heavy customizations of the user field. In that case you might want to have a look at creating a custom field with all its advantages and disadvantages. Have a look at MSDN: http://msdn.microsoft.com/en-us/library/gg132914.aspx
Another option might be - in case you do not want to re-use this column in many list definitions - that you can get away with your custom rendering template and create a custom create/edit form where you implement the specific edit behaviour for the field (plain ASP.NET with some SharePoint controls). Here is a nice walk-through on how to grab a custom edit form from SharePoint designer: http://community.bamboosolutions.com/blogs/sharepoint-2010/archive/2011/05/12/sharepoint-2010-cookbook-how-to-create-a-customized-list-edit-form-for-development-in-visual-studio-2010.aspx
I hope this helps. Kr., Bernd.

Resources