good day,
I'm trying to filter date by year using #setviewinfo. can anyone tell me how?
Here is an example, put this formula on PostOpen event on view. It will filter all document by column with user name.
#SetViewInfo([SetViewFilter]; #UserName; "columnName"; 1; 1)
columnName - is a real name of column (you may set it in Column Property)
Remember to clean filter on QueryClose even on view, otherwise all view will use this filter.
example how u should remove filter
#SetTargetFrame("frameName");
#UpdateFormulaContext;
#Command([OpenView]; #Subset(#ViewTitle; -1));
#SetViewInfo([SetViewFilter]; ""; "columnName"; 1)
frameName is a frame that contains view, columnName is your categorized column. If you do not use frame - simply skip 1-st row
Related
I have a SharePoint list as a datasource in Power Query.
It has a "AttachmentFiles" column, that is a table, in that table i want the values from the column "ServerRelativeURL".
I want to split that column so each value in "ServerRelativeURL"gets its own column.
I can get the values if i use the expand table function, but it will split it into multiple rows, I want to keep it in one row.
I only want one row per unique ID.
Example:
I can live with a fixed number of columns as there are usually no more than 3 attachments per ID.
I'm thinking that I can add a custom column that refers to "AttachmentFiles ServerRelativeURL Value(1)" but I don't know how.
Can anybody help?
Try this code:
let
fn = (x)=> {x, #table({"ServerRelativeUrl"},List.FirstN(List.Zip({{"a".."z"}}), x*2))},
Source = #table({"id", "AttachmentFiles"},{fn(2),fn(3),fn(1)}),
replace = Table.ReplaceValue(Source,0,0,(a,b,c)=>a[ServerRelativeUrl],{"AttachmentFiles"}),
cols = List.Transform({1..List.Max(List.Transform(replace[AttachmentFiles], List.Count))}, each "url"&Text.From(_)),
split = Table.SplitColumn(replace, "AttachmentFiles", (x)=>List.Transform({0..List.Count(x)-1}, each x{_}), cols)
in
split
I manged to solve it myself.
I added 3 custom columns like this
CustomColumn1: [AttachmentFiles]{0}
CustomColumn2: [AttachmentFiles]{1}
CustomColumn3: [AttachmentFiles]{2}
And expanded them with only the "ServerRelativeURL" selected.
It would be nice to have a dynamic solution. But this will work fine for now.
I am trying to identify controls at runtime by adding some search properties in my code as and when required. Using Coded UI in Visual Studio 2012.
Please refer to the screenshot below. My test scenario is:
1) Click on a particular tab (the 2nd tab selected in the screenshot)
The Tab list is fixed so I can create one control in My UIMap for each tab.
2) Inside every Tab, there is a tabular structure with some data. The Table headings are fixed but the number of rows and the data inside the rows is dynamic.
3) Check the checkBox for the required tag
4) Select Type for required tag
I have created my UIMap as:
Added following code:
UIEquipmentTagText.SearchProperties.Add(new PropertyExpression(WpfText.PropertyNames.Name, "1302"));// say I want second row
To fetch the respective checkbox control, I am using:
UITestControl UIEquipmentTagCell = UIEquipmentTagText.GetParent();//get the cell of Tag name
UITestControl UIEquipmentTagRow = UIEquipmentTagCell.GetParent();//get the row
UITestControl UIEquipmentCheckBoxCell = UIEquipmentTagRow.GetChildren()[0];//get the first cell i.e the checkbox cell
UITestControl UIEquipmentCheckBox = UIEquipmentCheckBoxCell.GetChildren()[0]; // get the checkbox control
But this is not working for me. I guess the UIRow control is referring to first row only (though I haven’t specified to look for 1st row)
I do not want to include row number in my search criteria for Row.
Is there any workaround to get all the controls I want based on the Tag Text only?
figured out a solution finally..get all rows and iterate to find the matching row
UITestControlCollection allRows = row.FindMatchingControls();
foreach (UITestControl x in allRows)
{
UITestControl Tag = x.GetChildren()[1].GetChildren()[0];//row->tag cell->tag text
if (Tag.GetProperty("Name").Equals("1302"))//say I want to select row having 1302 tag
{
UITestControl checkBox = Tag.GetParent().GetParent().GetChildren()[0].GetChildren()[0];//TagText->TagCell->Row->CheckBoxCell->Checkbox
Mouse.Click(checkBox);
}
}
By default my ExtJS 4.2 Grid is grouping correctly.I want to know the event that is called when we click Group By This Field in ExtJS 4.2.I want to get the column value on this grouping has to be done and save the column field in the database.
I'm not sure if I understand you correctly, but let's give it a shot.
The following event is fired when changing the grouping of a grid.
http://docs.sencha.com/extjs/4.2.3/#!/api/Ext.data.Store-event-groupchange
store.on('groupchange', function (store, groupers) {
// group values available here
var values = store.groups.keys;
// name of the column currently grouped by
var columnField = groupers.keys[0];
// then do whatever you want with these values
});
I'm modifying an existing Lotus view to include a field from another form.
I first appended a new column and set it to the desired field. However, after I refreshed, the new column was blank even though I know it has data.
I then updated the View Selection formula from:
SELECT Form = "A" & StatusIndex < "06"
to:
SELECT (Form = "A"| Form = "B") & StatusIndex < "06"
Still no luck. The view is refreshing successfully, but the new field is still blank. What else is there to add this new column to this view?
This is my first time experimenting with Lotus, so if I seem to be missing some major concept, I probably am.
Edit
If I was pulling this data using SQL, the statement would probably be something like:
Select A.* , B.*
from A inner join B on A.id=B.id
where A.StatusIndex < "06";
Which brings up another question: Where is the relationship between these tables/forms defined?
Unfortunately, there is no (intrinsic) "join" functionality available from a Notes view. If you absolutely need the different columns appearing in the same row (document) in a view, then one option is to de-normalize the data, such that upon saving of "Document B" you update the related "Document A" with the necessary field values. (This is also the only real way to get full-text searches to work across "joined" data).
If the view is for display on browsers only, then you may have other options, such as making AJAX calls to load the related data fields, etc.
Here's a trick for adding multiple forms. This way you can easily add to the list of forms allowed without lots of OR statements.
#IsMember(Form; "A":"B") & StatusIndex < "06"
What I would try next, though, is to get rid of all conditions in your view and just show Form = "B", assuming the B form has the field you added in step 1. If that works, then you know it is just an issue with the view selection formula.
Also you can use the Document Properties to inspect document items. File > Document > Properties gets you there. I would triple-check that the documents that appear in that view do in fact have some data for the field in step 1.
Lastly, make sure the programmable name for the column in the view is unique. Double click the column header in the view designer, and then click on the last tab (beanie hat). The name that is there usually will be the same as the field you want to show in the column, or it will be a $number if the column value is a formula. You can change that name to something you know is unique just to be safe. The theory here is that if that programmatic name matches another column's programmatic name, then the view will not evaluate the column values and instead will used cached values, which in your case might be blanks. It's rare, but it does happen.
There is a simpler version of the 'multiple form' trick noted by Ken:
Select Form = "A":"B" & StatusIndex < "06"
or if you prefer:
Select (Form = "A":"B") & StatusIndex < "06"
This formula says: if (form = A or B) AND StatusIndex < "06"
Note: Be sure StatusIndex is Text (as you've quoted it) and the field StatusIndex with a value is included on both forms. If not, you need to fix your logic.
Plus: Documents display in a sorted or chronological order, ONE to a line, so you cannot have A & B data on a single line. It may look like:
A
A
A
B
B
B
OR
A
B
A
B
A
B
A
But never
A & B
A & B
A & B
I'm trying to get the contents of a cell in a row in a YUI datatable.
I can use myDataTable.getSelectRows()[0] to get the first selected row. However, how do I get the contents of the first cell in that row?
It looks like getSelectRows() returns an array of record IDs. You can retrieve the corresponding record using getRecord(). Once you have a record, use getData() to retrieve the value of the field you are interested in.
var recordID = myDataTable.getSelectRows()[0],
record = myDataTable.getRecord(recordID);
console.log(record.getData("myField"));
http://developer.yahoo.com/yui/docs/YAHOO.widget.DataTable.html#method_getRecord
http://developer.yahoo.com/yui/docs/YAHOO.widget.Record.html#method_getData
I think I may have the answer for you assuming you have not already found it yourself.
I have the same kind of page with a datatable and a textarea field, when you select a row in the datatable calls the same page displays further detail from the selected row in the textarea field and retains selection of the selected row.
1: To do this I apply the following example MySQL query called AllMyBroadcasts...
SELECT #rownum :=#rownum + 1 RowNumber, p.*
FROM tblBroadcasts p, (SELECT #rownum := 0)r
ORDER BY Date DESC
the tblBroadcasts table has fields : Date, Narrative, ID
2: I then provide the following to the table row of my YUI Datatable within HTML hyperlink tags.
href="MyPage.php?SelectedBroadcastID=' .$row_Broadcasts['ID'].'&RowNumber=' .($row_Broadcasts['RowNumber'] -1 )
3: When the href is clicked MyPage reload with additional parameters SelectedBroadcastID and RowNumber the SelectedBroadcastID I use in a second query against tblBroadcasts called MySlectedBroadcast which a simple query on outputting all fields where the ID = SelectedbordcastID. I then to my field to display the narrative of my selected row in my textarea field.
The second paramater I do the following with.
$SelectedRowID = 0;
if( isset($_GET['RowNumber'])) {
$SelectedRowID = $_GET['RowNumber'];
}
Above I placed just after code covering my two queries.
4: Then finally to get the datatable to select the row of the selected row I include the following to the var yuidatdatable section of the datatable script...
yuidatatable1.select(yuidatatable1.getRow());
The -1 value referred to step 2 serves as a work around to fact that yuidatatable works on a 0 base and the MySQL referred to in step 1 on a 1 base.
There you go !
Perhaps there is a better why using get from within YUIDatatable scripting, be nice to know if so. That said this work fine for me and perhaps if you have not found an answer I hope this helps.