Query with servicestack property display name - servicestack

I have some issue regarding display name of property in result of get request on servicestack.
I will get following result when i make get request to my servicestack, in that in list i have not bind count although it is displaying here (I think because of type (int)).
So my questions are
1) Is there any way to avoid property to displaying on Result? (want to disable count here)
2) Is there any way to rename property display name ? (want to display countvalue instead of count here)?
Thanks in Advance.

The value of 0 for count is displayed because that's what value is embedded in the JSON. If you don't want it displayed then you want to suppress the value from being serialized. If you make count property nullable (i.e. change from int to int?) then it wont be displayed when it doesn't have a value.
At the moment there is no way to customize the header label of each column other than changing the name of your DTO property to CountValue.

Related

Acumatica - PXGridColumn property for Text box on Processing page

How to add an input field on processing page grid column.
There is option to add Type in PXGridColumn property but it does not have any value for text box and then the column result as readonly on UI,
Where as the added column should take the input,
Example - Need to process all the Production Order and set its status
Put the field you want to set on the header instead of the detail lines, and then set all the status' based on the header value. Like Hugues said, the entire grid is probably disabled for a reason.

Set Default Field Value Based on Site Property

I am looking for a way to set a list field default value to a property that I have programmatically set on the site where the list resides.
Essentially every item in the list will have the same value which will be hidden from the normal user view. Down stream, I am using a content query web part to pull that field so I can group on it.
I am using SP2013.
Thanks for the help
With Site Properties you mean the SPSite.RootWeb.AllProperties property bag which you have filled with some custom property?
Assuming that is what you are talking about, there are unfortunately no standard ways to work with property bags - besides programming that is.
You said you want to set a default value on a list field for each list item. This sounds like an event receiver! You can choose to have it fire on item updating and/or item created for all your items and always set the hidden field on the item with the value from the site properties.

Getting data from a datasource with Filter by Column Value?

I have a list box where I am trying to get the datafrom the people view in names.nsf.
The first column of the people view is computed and shows Last Name , First Name.
The code below works fine for my list box values but it does not take into consideration the value in the Filter By Column Value. Basiclly the code below acts like the Filter By Column value property does not exist. I know the Filter by Column value property is working because I replaced a repeat control on the page with a computed field and the repeat control is displaying the value excepected but the list box is displaying values from the first document in the view.
Thoughts I had to fix this are:
Use getAllDocumentsByKey to just search the people view but when I do that I lose the column values and I would need to recompute the value, something that I would like to avoid if possible incase the column formula changes.
Use FTSearch but what I really need to do is search that first column only and I am not aware of search operator that searchs a column only. Is there such a thing?
Another thought would be to somehow use the values of a repeat control, as the values for my list box, but I am guessing that this is not possible. I sort of thinking something with a scope varibale but I have not worked that out yet.
A repeat control works. How can I get my code to loop through the doeuments the same way a repeat control does?
And as a side question, is there anyway to tie a pager to a datasource as oppsed to a repeat control.
BTW What I currently do is to build a list box using a few computed fields and a repeat control but what I really want to do is to use a regular xpages list box control.
Here is the code:
var doc:NotesDocument = view1.getFirstDocument();
while (doc != null && count<10)
{
var tmpDoc:NotesDocument = view1.getNextDocument(doc)
ret.push(doc.getColumnValues()[1]);
doc.recycle();
count++;
doc = tmpDoc;
}
Try to use getAllEntriesByKey. This will give You access to column values (through ColumnValue property of view entry).

viewPanel: how to set a colspan value for response type view entries

Using a viewPanel, how can we display a reponse entry the way it is displayed in the Notes client? Or in other words: is there a way to build some kind of colspan for specific columns based on the current entry's document type?
I made some code a while back to make the categorized views behave more like Notes:
http://dontpanic82.blogspot.no/2010/10/xpages-make-categorized-views-behave.html
Here's another solution from Stephan Wissel:
http://www.wissel.net/blog/d6plinks/SHWL-86V67E

How to put exclude rule if property value contains specific value in search results

In share point we have top right corner search box. From that results, I need to add rule for exclude peoples those have profile property value = "1". Per example
urn:schemas-microsoft-com:sharepoint:portal:profile:WebEnabled
WebEnabled is the SSP profile property. Now results are pulling all users those have property value "0" or "1". Now I need exclude profile those have WebEnabled =1 value.
I added rule in scope. I don't know. How to set value for that.
contentclass = urn:schemas-microsoft-com:sharepoint:portal:profile:WebEnabled
Please let me know, How to do this?. Thanks in advance
On the Add a Scope Rule page you'll find this text
Enter the property restriction as a comparison of property to a value. All items matching the property query will be added to the scope. To make additional properties available for use in scopes, navigate to the managed properties list and select "Allow this property to be used in scopes" for the desired managed propertes.
So you'll need to find what Managed Property that belongs to and flip that bit so that you can use it in your scope rule.

Resources