Change List View Lookup Threshold by code in Sharepoint - list

My default "Pages"-List-View in Sharepoint has to much columns so it will not show up. The following error is displayed:
This view cannot be displayed because the number of lookup and workflow status columns it contains exceeds the threshold (8) enforced by the administrator.
I know how to fix this using the central administration (like described here: How to enable a view in SharePoint2010 where there can be more than 8 Lookup columns present?)
But I want to change that setting automaticly by feature activation with C#-Code. Can this be done by code?

The SPWebApplication.MaxQueryLookupFields property determines the maximum number of lookup fields that may be included in a list item query.

Related

Using a bucket as a datasource for a droplink/tree field

I'm trying to enable content editors to select an item that resides in a bucket in a droplink field but I'm unable to find a field type/datasource that enables this.
I need to allow the user to select a single item (so not a multilist), the items are in a bucket as the number of items may be huge and the search api would be most helpful to the editors.
Is there a field or datasource query that will enable a lookup field to select a single bucketed item?
The simplest solution is to use a Sitecore multilist with search field.
First you need to set the source of your field to display items within your bucket of a specific template(s).
Example: StartSearchLocation={11111111-1111-1111-1111-111111111111}&Filter=+_templatename:sample item
Here is an article describing how to set the source of your field: Sitecore 7 field types
If you need to limit the selection to one item then you need to also apply some regex. To achieve this you need to enable standards values in the view tab so you can alter the data section.
In the data section add the following regex: ^({[^}]+}\|?){0,1}$ and add some validation text.
Example:
This article provides additional infromation:Limit selected items on Sitecore multilist field
Just in case anyone else comes across this as I did, you can also use a query in the source field to filter the items in a droplink.
query:/sitecore/content/Home/YourBucket//*[##templateid='{your-template-guid}']
You can also use ##templatename='Your Template Name'
Keep in mind that unless your bucketed items aren't numerous (for some reason), the suggested answer is probably better since it provides search, and will not create a massive dropdown list of items.
I made some custom fields for this very purpose: https://github.com/Barsonax/SitecoreSearchFields
It gives you the same rich search interface you normally get when searching in buckets.

How to specify the item for a sales order?

My program finds orders in a database outside NetSuite and enters them in NetSuite through SuiteTalk.
I'm having trouble specifying the item for sales order lines.
My order line creation code looks like this:
When I try to specify the item using only the the RecordRef.name property I get an error saying "Please choose an item to add".
I am more successful when using RecordRef.internalId. I can look this up (not shown in the code above) using ItemSearchBasic and setting the ItemSearchBasic.externalId property as a list of RecordRefs each specifying an externalId value from the order lines in the source database. I seem to have to set the type property of each RecordRef. The problem is that I don't know the type. Some of the products are Inventory Item and some are Lot Numbered Assembly/Bill of Materials.
How can I specify the item for an order line without having to tell NetSuite what the type of the item is?
use itemId - From the Schema browser in Netsuite docs show itemId as the proper internal id to use for item

Filter external list fields from client

BACKGROUND:
We’re developing a custom application which access SharePoint through the Client Object Model and this application need to access ECT (external content type) lists defined in SharePoint using the OM (Object Model). This application is a product that should be usable with most SharePoint installations and configuration and cannot have prior knowledge of External Lists.
When there are no filters set up for the ECT, SharePoint returns all the available items in the list (given the number is below the threshold). The moment we define a filter for this ECT, SharePoint return only the items after this filter is applied (probably correct behaviour from SP).
PROBLEM:
We need to be able to search this ECT list (non-filtered) based on text entered by a user in a search box. At the moment there seem to be no way to change the filter SharePoint applied when returning the values to the calling object.
I.e. I have 10 items in my ECT list (1,2,3…10). Each Item has 3 columns (ID, Name, Description). After setting up a filter for the ECT list, SharePoint return items 2, 3 & 6 when I ask SharePoint for a list of items.
No the user does a search the matches the description of item 7. How can I search/filter the list to return the item that match my search query?
I’ve been running in circles trying to solve this, but nothing seem to work. I tried setting the CAML query as well as the LoadQuery as defined in both http://pholpar.wordpress.com/2011/02/09/how-to-query-external-lists-on-the-client-side-using-caml/ and http://msdn.microsoft.com/en-us/library/ff464384.aspx but nothing seem to work.
Even I had this problem. Let me tell you there is no way of doing this.
Even in Server object model, there was an option to change the filters of the default view but then the SPList will return 0 items once the filter is applied.
The funny part is once your code runs & you open the list in SP UI, you can see the actual modified list. But the same cannot be queries in the object model.
Looks strange. I guess if you modify the SPList (ECT based) in this instance, then you can only get results in the next instance (like in next page refresh.....)

Web Service query on Sharepoint 2007 List with 12,000 items fails to return all documents

We are querying a large SP 2007 document library with over 12,000 documents using the Lists web service, for document comparison purposes.
All queries are built using CAML, to limit the results returned by one of the fields on the list.
In general, the CAML query will return no more than 200 records.
Unfortunately, we are finding that one query will return 20 documents, and the exact same query will return 23 documents 15 minutes later.
As this crawl occurs after hours, it is not possible that documents have been added during that time.
Has anyone experienced similar issues ?
If you're using the Lists.GetListItems method, try setting the RowLimit parameter to something larger.
rowLimit A string that specifies the number of items, or rows, to
display on a page before paging begins. If supplied, the value of this
parameter overrides the row limit set in the view specified by the
viewName parameter or the row limit set in the default view for the
list.
If you don't specify, it will use the limit for the default view which is probably 200 judging by your question.
I don't understand the second part of your question. The search index uses a completely separate web service and you'll never use CAML to query the search index.
Turns out that the issue was related to hardware errors on one of our front end web servers.
This caused a validation failure for some of the List Items.

Making an Oracle Apex report table element read-only

Greetings:
Is there anyway to make an apex report table cell (or even the entire report itself) conditionally read-only in Apex 3.2? I don't see the "read-only" box anywhere in the options; tried searching everywhere.
Thanks in advance!
Since the whole tabform is to be made read-only for particular users, you can do this at rendering time rather than using Javascript. However, you would need 2 copies of each column:
Column to be displayed for an authorised user, not readonly
Identical column to be displayed for a non-authorised user, with Element Attributes set to readonly=readonly
Authorisation schemes can be used to control which columns are displayed to the user.
I was hoping to find a way to do this with a single column and a dynamic value for Element Attributes, but I couldn't get it to work.
OK, I had an error in concept. I wanted to make a tabular form read-only. That's why I couldn't see the "read-only" box. If you open the source for the generated page, each column has given an id with the following naming convention:
id="f02_0001"
This table cell is in column 2, row 1. So, you can use JavaScript to loop through a column and modify it's properties. In this example, I use jQuery:
var payments = $("[id^='f08_']"); // get all cells for column 8
// loop through items
$.each(payments, function(){
alert($('#'+this.id).val());
// make whatever changes you want to this.id, such as make read-only
});