How we can set Pagination as per custom parameter in Vtiger - vtiger

We are displaying today followup on Dashboard. Like
While user click on view link filter data is displayed on SalesOrder module on Vtiger list view page
.
But while we click on pagination count it displays different.
I have update query in list view while my custom parameter pass from dashboard and I will get result accordingly on list page but I don't know how we can set pagination according to my custom parameter or Custom query.

In Vtiger, Any Module List page pagination count will come from "getListViewCount()" function.
We have put this function in our salesOrder/models/Listview.php
After that i have taken one hidden variable in ListViewContents.tpl file for our custom parameter also we have update getDefaultParams Event from layouts\vlayout\modules\Vtiger\resources\List.js and pass our custom parameter with custom variable.
with the help of that we can perfect count for custom parameter query.
here you can see the result,
now, click on view link

Related

List column(Text) not saving/showing data after setting attribute multiple=true on Attachments control so to enable uploading multiple Files at a time

By default we can only upload one file at a time so I followed solution given here(https://www.c-sharpcorner.com/article/attach-multiple-files-to-sharepoint-list-item-with-default-attachment-of-new-for/). Now I am unable to store RFI No column(text). It maybe stores value on form submit but the value does not show. Following is my column setting:
List view and inspect element:
I simply added the code in NewForm.aspx which works and enables user to upload multiple files but now New Item form does not save RFI No value which is not in anyway dependent on Attachments field
If I log the value of RFI No column to workflow history list through Workflow it is showing the saved value there..
If so, the value is saved in the RFI No column. Looks like there are some code in the list view page which hided the column value, that's why the value does not show.
You could click Edit page in the site settings to check if there are script editor or content editor web partin the view page.

Generating dynamic list columns fields in SharePoint list form

We have created a custom list form with SharePoint designer and now the requirement is like below:
User will request server creation using this form and now server can be of any type which user can choose from a drop-down such as Production,stage,Test or multiple production servers are required. And for each server type, there will be corresponding 20-25 fields which user need to fill for that server details. so i want to know the best way to achieve this as we cant create 200-250 list columns in this list and scrolling also will be a difficult task while user will submit the request. So what is the best way to achieve this requirement?
You can create a list containing all server types that will be used to create a server type lookup. Then you can create a list with a 'Server Type' column and 'Server Requirements' (multiple lines of text) column. You can store all requirements for a particular server as a JSON object e.g.:
{"RAM":"8GB", "CPU":"4"}
OR you can create a nested JSON object for each server type e.g.
{"ServerType": "Staging", "Requirements": {"RAM":"8GB", "CPU":"4"}}
wherever you want to show/send/populate data, you just need to retrieve this json and parse.
Hope this helps.
first I think the recommended way would be to try OOTB SharePoint solutions and in Your case I think You could try to use ContentTypes and OOTB list forms.
Lets say You create a content type per server type. To each type You add only the 20-25 fields that are corresponding to this server type. Then in list settings in advanced settings You turn on content type management and You add does content types to the list (also hide the default Element content type). After that when the user will want to add a new item to the list he will be albo to chose between the content types (server types in Your case), and after that the form will have only the fields that are added to this content type. Also in edit form the user will be able to pick between content types and will see only the corresponding fields. Please see the attached screens to also understand what I mean on a very simple case:
list
ContentType1 (ColumnA)
ContentType2 (ColumnB, ColumnC)
if this OOTB features are not enough and You already created a custom form using SharePoint Designer
Then You should be able to attach custom javascript file to it and jQuery library. The javascript You may store under _layouts path on server. Every field in the form has its own tr (row) You could to each row attach some custom css class like- class="forServerProd allFields" and then in js You could listen onChange event of Your list and show or hide fields with $(".allFields").css('dispaly','none'); // first hide all
$(".forServerProd ").css('dispaly','table-row'); // then show only relevant

Retrieve value from database for the particular id which is in url using class based views in django

I need to display value into textbox fields in template page which is get from the database for the particular id. After that i need to edit those details which is needed and to update those values into database.These things are done by function based views easily. But now i want to do that it in class based views.Which view is used to do that. Can anyone help me to do that.
You should use the UpdateView for this task.
UPDATE: If you want to display instance details on one page and the edit form on another then use the DetailView for the first step.

URLs of pages on which item appears in Sitecore

In Sitecore, how can I get a list of all pages on which an item appears? Thanks
Internally Sitecore maintains a database of references between Items called the Link Database. You can query this by using the "Links" dropdown on the "Navigate" tab on the Content Editor ribbon. That may give you the information you need.
(You can also query the Links Database via code - See example code on http://laubplusco.net/sitecore-item-extensions-get-referrers-as-items/ for one example of doing this - or the docs in SDN)
If the relations to your target Item are via selection field types (multilist, treeview etc) or via the DataSource property of Renderings/Sublayouts/etc then you should be able to select the item you're interested in and click the "Links" dropdown to see a list of the relationships Sitecore has recorded. This will list system relationships (which template does this item use) as well as the sort of relationships you're interested in where one item points at another item.
Note that this approach cannot tell you about some types of relationship: the most common sort being ones which are calculated at runtime. (EG API queries, or searches) because those relationships don't exist in the Links Database.
-- edited to add --
You ask about getting the URLs for these Items. In code you can get the URL for an item by calling LinkManager.GetItemUrl() and passing in the item you're interested in. That gives you the public website URL, rather than the Sitecore Item Path that you'd get directly from the Link Database.

Django 1.4 wizard and tables2 navigation don't mix

We're using Django 1.4's new wizard to create, well, a wizard. We have a wizard where, a few steps into it, the user has to select a row from a listview/datagrid/table. We use Django-tables2 to show this data.
The problem is that django's wizard has a single fixed URL, and uses a hidden form field that tells the wizard at what step it is. So all forms submit via POST back to the very same URL, and Django's wizard figures out from which page the user comes, stores the submitted data and based on the hidden form field, figures out where to go next.
Django-tables2 is an HTML grid that supports paging and sorting through a set of data. However, it does so using http GET, passing some querystring variables to indicate what column to sort and/or what "page" of data to show.
As soon as we use sorting or paging in a tables2 grid inside a Django wizard, the GET will call the same URL, because it is a GET, the Django wizard will not receive the hidden form values it expects that regulates navigation, and it will happily show the first page of the wizard by default.
I'm wondering if anyone has experience with this and knows of a solution to keep both the Django Wizard as well as the Tables2 functional.
Thanks in advance,
Erik