NotesViewColumn check if Total option is enabled - lotus-notes

how can I check if something is selected there? I need at least 'fact': selected or not (and would be nice to know how to read real settings).
I looked into NotesViewColumn and did not find anything there, maybe it's undocumented feature :(

You can use DXL. The DXL schema for view columns includes an attribute that represents the selected option for the totals.
I.e. set up a NotesNoteCollection object that includes the view design note. Use NotesSession.CreateDXLExporter to get a NotesDXLExporter and process the NotesNoteCollection, parsing the XML to locate the column and get the value for the totals attribute.

Related

How do I use Office.JS to add invisible information to a cell in Excel?

I need to add some information to an Excel cell or the same information to several selected Excel cells and that information should not be visible. How is this possible? I know I could add something to the properties of the whole worksheet, using the addresses (e.g. "Sheet1!A1") of the cells, but then when the table changes, the information is no more correct. I also thought I could use addFromSelectionAsync, but did not manage to use it, I think addFromSelectionAsync is not the right tool. I have seen that other AddIns are producing something like the follwoing (in different files in the saved Excel document): [UPDATE: this is not the way to go, see my second comment below]
<x15:webExtensions xmlns:xm="http://schemas.microsoft.com/office/excel/2006/main">
<x15:webExtension appRef="{12345678-...}">
<xm:f>Sheet1!$A$1</xm:f>
</x15:webExtension>
<x15:webExtension appRef="{ABCABCAB-...}">
<xm:f>Sheet1!$A$2</xm:f>
</x15:webExtension
</x15:webExtensions>
<we:bindings>
<we:binding id="BINDING-ID-1" type="text" appref="{12345678-...}"/>
<we:binding id="BINDING-ID-2" type="text" appref="{ABCABCAB-...}"/>
</we:bindings>
and then use <we:properties> (I think) to know which binding-IDs are used. Is this the way to go, will the values in <xm:f> automatically be updated, and how do I do this in code?
Thanks in advance.
The first part was already resolved see my old comments above:
addFromPromptAsync, using the information I want to save as the ID, adds the <x15:webExtension> and the according <we:binding>.
I am now using a UUID as the value in addFromPromptAsync, and setting the actual value via Office.context.document.settings.set with key = the UUID and value = the actual value.
It was then my question:
given a cell (i.e. the accordings range) I cannot get the IDs of the according bindings
For this second part of the problem, I added event handlers via binding.addHandlerAsync for the relevant Binding-IDs. Those event handler can read the binding ID from the event data.
So my problem is resolved, since I only need the Binding ID when the according cell is selected.
There is still the problem that I need to unset the binding ID that I save in a variable when another cell without that data is selected, I am using a timestamp for this, >200ms after the last binding selection event, selecting another cell deletes the info. Cf. my question Can I set an order for the Event Handlers in Office.JS? for that last point.

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.

Setting default value for OptionSet in CRM 2011 Dialog

I have a requirement to populate the default value for an OptionSet in a Prompt-Response based on a value pulled in from a query within the Dialog. However, the default value field is disabled for both types of OptionSet.
Can anyone confirm if this is the correct behaviour as I can't think of any reason why you wouldn't be able to assign a default to an OptionSet at runtime?
This will mean duplicating the entire Page as I can't even add a Condition statement to conditionally use different Prompt-Responses unless anyone can offer a better solution?
When you do query that means you are getting a set of values, even if it's a single one.
So, yo can pupulate an Option Set from Query but not set a default value.
Anyway, default value field is not for OptionSets it's for text, numeric and DateTime responses.
I am not quite understand your last question.
Could you give more detail.
Long time since the question got asked.
The simplest answer is that you can´t set a default value to the option set.
However another sollution instead of duplicating the page, and that may be useful in a case like this, is a workaround with two queries.
Declare a variable of the type you want to be dynamic in the Query for the Option set.
Set the variable to a value that would give you the default Option set value you´re looking for.
Query for the data that you want to use with the dynamic type you want to use.
Check number of records the query returns.
If number of records is more than 0 you set the value of the variable to the dynamic vaule used in the query
Query for the same data again(!), this time with the variable instead of the previously used dynamic value, and use this one for the Option Set.
The result is: If you get hits from your query, the hits will be shown in the option set. If you don't get hits the "default" value will be shown.
Also don't think there is any reason why you wouldn't be able to set a default value for the Option set. Especially since the page locks up if the query used for the option set returns no hits.
Cheers.
/Henrik
Further to this I have come across a situation today where I have used some fetchxml to query data in a dialog and are now wanting to store that value within a variable but appears I cant and can only use this to show fields within an option set.
I appreciate the xml is returning a record and not a field but there must be away I can return first or default and store the returned value in a variable.

Sharepoint custom list, dynamic field?

Hey guys, just wondering if their is a simple way to create an Item in a custom list but i need that item to be dynamic. The user can click add more to get another field that would hold the same type of data an unlimited amount of time.
If i could even just add an excel spreadsheet type of field that would work also. But excel wouldnt need to be a requirement on the users machine.
I thought i had read somewhere you could do this using info path but i cant seem to find anything relating to it on google.
The InfoPath feature is called a "repeating section". There is information on how to set that up in Office Online.
If you wanted to achieve this entirely in SharePoint, the problem is that there can only be a fixed number of fields in a list. So you could create as many that would ever be used and just display all of those. Or to make it much nicer for the user incorporate jQuery to hide all of the fields except the first one and provide a button for them to click that unhides the next one.
There is good information on how to access list form fields using jQuery in the question How can I set the default value in a SharePoint list field, based on the value in another field?

Auto number column in SharePoint list

In a SharePoint list I want an auto number column that as I add to the list gets incremented. How best can I go about this?
Sharepoint Lists automatically have an column with "ID" which auto increments. You simply need to select this column from the "modify view" screen to view it.
You can't add a new unique auto-generated ID to a SharePoint list, but there already is one there! If you edit the "All Items" view you will see a list of columns that do not have the display option checked.
There are quite a few of these columns that exist but that are never displayed, like "Created By" and "Created". These fields are used within SharePoint, but they are not displayed by default so as not to clutter up the display. You can't edit these fields, but you can display them to the user. if you check the "Display" box beside the ID field you will get a unique and auto-generated ID field displayed in your list.
Check out: Unique ID in SharePoint list
If you want to control the formatting of the unique identifier you can create your own <FieldType> in SharePoint. MSDN also has a visual How-To. This basically means that you're creating a custom column.
WSS defines the Counter field type (which is what the ID column above is using). I've never had the need to re-use this or extend it, but it should be possible.
A solution might exist without creating a custom <FieldType>. For example: if you wanted unique IDs like CUST1, CUST2, ... it might be possible to create a Calculated column and use the value of the ID column in you formula (="CUST" & [ID]). I haven't tried this, but this should work :)
I had this issue with a custom list and while it's not possible to use the auto-generated ID column to create a calculated column, it is possible to use a workflow to do the heavy lifting.
I created a new workflow variable of type Number and set it to be the value of the ID column in the current item. Then it's simply a matter of calculating the custom column value and setting it - in my case I just needed the numbering to begin at 100,000.
it's in there by default. It's the id field.
If you want something beyond the ID column that's there in all lists, you're probably going to have to resort to an Event Receiver on the list that "calculates" what the value of your unique identified should be or using a custom field type that has the required logic embedded in this. Unfortunately, both of these options will require writing and deploying custom code to the server and deploying assemblies to the GAC, which can be frowned upon in environments where you don't have complete control over the servers.
If you don't need the unique identifier to show up immediately, you could probably generate it via a workflow (either with SharePoint Designer or a custom WF workflow built in Visual Studio).
Unfortunately, calculated columns, which seem like an obvious solution, won't work for this purpose because the ID is not yet assigned when the calculation is attempted. If you go in after the fact and edit the item, the calculation may achieve what you want, but on initial creation of a new item it will not be calculated correctly.
As stated, all objects in sharepoint contain some sort of unique identifier (often an integer based counter for list items, and GUIDs for lists).
That said, there is also a feature available at http://www.codeplex.com/features called "Unique Column Policy", designed to add an other column with a unique value. A complete writeup is available at http://scothillier.spaces.live.com/blog/cns!8F5DEA8AEA9E6FBB!293.entry
So I am not sure I can really think of why you would actually need a "site collection unique" id, so maybe you can comment and let us know what is actually trying to be accomplished here...
Either way, all items have a UniqueID property that is a GUID if you really need it: http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.splistitem.uniqueid.aspx
Peetha has the best idea, I've done the same with a custom list in our SP site. Using a workflow to auto increment is the best way, and it is not that difficult. Check this website out: http://splittingshares.wordpress.com/2008/04/11/auto-increment-a-number-in-a-new-list-item/
I give much appreciation to the person who posted that solution, it is very cool!!

Resources