Get the field used in a NotesViewColumn using Java/SSJS - xpages

I have a handle to a NotesViewColumn and needs to know what field is used for that column (only fields are used, no formulas).
The column has "Display: Field" set and (naturally) just contains the field name.
Any ideas?

Please try getItemName() method of NotesViewColumn class.
Hope this helps
Sven

Related

Filtering Sharepoint Person/group column with contains does not work

I am trying to filter a Sharepoint list and show only those rows to logged in user if the Person/Group column (with Allow Multiple set to True) has the logged in user's name.
I tried to filter using the contains option but receiving below error. Can someone suggest how this can be resolved?
Try the filter setting for "is equal to" and [Me]. I found that this works fine in people fields that have multiple people selected.
'Contains' filter can only for searching a string anywhere within a column that holds Text or Note field type values. I think it cannot be used for user/group column.
https://learn.microsoft.com/en-us/sharepoint/dev/schema/contains-element-query
You may consider using below filter:
Includes
Eq
BR

Kentico - Using value of added field (page type)

I need some help adding a field to a page type. I added it via "New Field". I set the field name to "ModalDataTarget".
I inserted it in the page type transformation as {% ModalDataTarget %}.
I put the value in the text field.
It isn't populating with the value I add.
Thanks in advance for any help!
Which Web Part are you using? I would verify the column is returned in the query that is being run for it.
Which transformation type are you using? ASCX? If so, you need to use <%#%> Format.
You are calling macro method in transformation . You need to use transformation methods instead:
try <%#Eval<string>("modaldatatarget")%>

NotesViewColumn check if Total option is enabled

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.

form not picking up data from another database

I have a form. When I open the form the two fields called office and group should be picked up from another database named something like staff.nsf. The data is picked up based on the applicant name as key. I have included my name in staff database. But the form is not picking up the two fields from the staff database.
The field formula goes like this,
server := #Name([CN]; #Subset(#DbName; 1));
temp:= #If(Applicant != ""; #DbLookup( "" : "NoCache"; server:"Mast\\Staff.nsf";
"ByApplicant";Applicant; 2); "");
#If(#IsError(temp);"";temp)
Is it a system bug? Can anybody help please.
Regards,
Priya
Lotus Notes is more than 20 years old, and extremely well-tested. It is very unlikely that you have found a "system bug". There are any number of possible problems here, and you need to carefully rule them out until you find the actual problem.
The first thing you should do is take the #IsError out of the formula (temporarily). By having it there, you are suppressing a potentially useful error message. Ok... admittedly the error messages are usually not that helpful, but sometimes they are. If you don't want to take it out of your formula, just add another computed-for-display field with just the #DbLoookup -- and follow Ken's advice about hard-coding everything.
Then review all of the following:
Is "mast\staff.nsf" the correct path for the database?
Do you have access to the database?
Is "ByApplicant" the correct name for the view? (Spelling errors happen!)
Do you have access to the view?
Do you have access to the documents in the view?
As Ken mentioned, is the first column in the ByApplicant view sorted?
Is the name value you are passing for Applicant in the exact same format that appears in the view column? (I.e, if it appears in abbreviated form in the view column, make sure that you are passing it to #DbLookup in abbreviated format.)
Does the second column of the view contain the value that you are trying to read? (Check out the rules for counting columns in the documentation for #DbLookup.)
A few thoughts:
The ByApplicant view needs to have its first column sorted alphabetically and that column should be the list of applicant names you are matching on
Try hard coding the value for applicant in the #DBLookup to see if it works, and to rule it out as the problem.
This does not work on the web, only on the client (I believe)

SharePoint list.items.GetDataTable column names not match field names

I am binding an SPGridView to a SPList. As code samples suggest, I am using the following code to create a dataview based on the list.
dim data as DataView = myList.Items.GetDataTable.DefaultView
grid.DataSource = data
etc...
What I am finding is that the column names in the resulting dataview do not always match the source fields defined in the SPList. For example I have columns named
Description
ReportItem
ReportStatus
these show up in the resulting dataview with column names like
ReportType0
ReportStatus1
This leads me to think that I have duplicate field names defined, but that does not seem to be the case.
Seems like I am missing something fundamental here?
Thanks.
The GetDataTable method is returning the internalName (or staticName -- I can't remember for sure which but they are frequently the same) representation of the columns, rather than the Title representation, which is what you see in the Web interface. I believe GetDataTable does a CAML query under the covers, and you have to use that internalName for field references in CAML.
This blog talks about it in a little more detail.
So I posted about this on my blog, but I wrote a little utility method that you can use, right after you get the data table it basically remaps the column names in the DataTable to their friendly names.
DataTable table = list.GetItems(list.DefaultView).GetDataTable();
foreach(DataColumn column in table.Columns)
{
column.ColumnName = list.Fields.GetFieldByInternalName(column.ColumnName).Title;
}
Hope that helps!
What you also could do (if you´re using .NET 3.5) is to use an anonymous type and bind against that. If you´re doing this you might wanna go with a Linq DataSource as well.
I have made a post that explains this here.

Resources