List sort alphabetically in Kentico Macro - list

Is there a sort option in kentico where you can sort list according to alphabets ?
Like list.split(",").Sort ?

Yes, you can sort macro results. As an example, if you wanted to sort the list of users in your Kentico site by their username, you could use:
GlobalObjects.Users.OrderBy("UserName")
If you want to reverse the order, then you can use:
GlobalObjects.Users.OrderBy("UserName DESC")
If you want to be able to quickly test, you can use the macro console to test your macro output. The console can be found ins the System application under Macros > Console. The horrifyingly fast GIF below shows you where to lookL

Related

How to create multiple numbers of fields based on the value in one number field in Oracle Apex form?

I am working on a form in which I need to take numeric value from one field and based on that number(n) I need to create n fields for another column. How can I do so?
Probably you can use APEX_ITEM API if I understand your task right:
https://docs.oracle.com/en/database/oracle/application-express/19.2/aeapi/APEX_ITEM.html
Something like this:
SELECT APEX_ITEM.TEXT(rownum)
FROM DUAL
CONNECT BY rownum < :YOUR_ITEM;
You will not be able to create n page items in a declarative way. APEX simply wasn't made for this.
I can think of two workarounds:
Use a plsql dynamic content region to generate html with the apex_item package just like Ivan Dubashinskii suggested. You will need to submit the page in order to have the region re-generate your page items when the amount n is changed. There are some downsides to this approach, as for example it won't be that simple to use your page items in a page process.
Just limit your page items to some number, like 10. Then, create 10 page items in a declarative way and use dynamic actions to show/hide them when n changes. This way, it will also be much easier to use your items in a page procress.

Collections to list in tcl

Hi I would like to know how to convert a collection into list in tcl. The output I am getting is in form of collections but I want to change it to list.
Assuming you are using some synopsys tool:
set MyList [get_object_name $MyCollection]
The above should convert your collection to a list.
Generally we use collections when dumping/querying data from certain tools which use TCL (for example Design compiler from synopsys). These collections look as list but are not accessible for normal list commands. To access them you need to use "foreach_in_collection" command and need to use get_object_name (or equivalent command) and need to build list (lappend) of the output of get_object_name. From this list you can use all TCL list operations.
foreach_in_collection and get_object_name are tool specific commands and can not be found in TCL and they work only run through tool interface.
Hope this helps.
The user is likely talking about Synopsys Tcl "collections" -- an extension provided by EDA vendors like Synopsys to support a list of objects in their Tcl API.
I'm late to the party, but this simple proc is what you'll want most of the time. Note that since you'll be mapping your collection to a list of object "names" you are losing information with this mapping:
proc col2list { col } {
set list ""
foreach_in_collection c $col { lappend list [get_object_name $c] }
return $list
}

django custom manager result rearranging

I have the list of all countries. When I need to get the list of English speaking countries i do:
Country.objects.filter(lang='English')
Which works great. However, I want to let say have US and Canada to show up at the start of the list at all times, as my primary focus is in North America.
Now, should I do the query in a custom manager and remove the two countries from the list and insert them at the start or should I have a template tag that takes a list and returns a rearranged list.
It would have been nice to have used sort_by to do this, and I don't mind to overwrite some function to get the job done.
Sample code is appreciated.

TFS 2010 sorting ALLOWED VALUES desc

I'm using TFS 2010.
I have a string field with a list of allowed values. When I view the work item the list is sorted alphabetically (the original list is not sorted alphabetically).
Is there any way to display the vaule order as the same given in the work item template.
Is there any way to change the sort order to desc?
I know I can write a custom control for this but I was wondering if there was any easier way.
thanks,
There is no way to sort a list of values (allowed, suggested, or even taken from a global list) in any order, but ascending alphabetically.
You do have two option though:
Add an index before each item on the list. This index would be something like "1. Banana", "2. Apple", etc. It would be permanent and would appear in the display of the list, but it is the simplest solution, if it's good enough for you.
You may create a custom control, that would appear as a drop down list, and would sort by a custom parameter that you can add to the work item type definition.
Hope this helps.

How to link a SharePoint list with a Word form?

I want to store Word forms into a library and then use them to populate with data from a SharePoint list. Push data from the list to the forms, by selecting one of them.
Has anyone do it? is there a simple way?
This sounds like a mail merge kind of operation. Mail merge does not work with datasources with a HTTP path. The workaround to this is to map the document library as a network drive. When performing mail merge in Word, you would then select the drive as the source.
See Q 14 in this link for more info
[]: http://support.microsoft.com/kb/826838
Each list can only (I think) 1 form that is used as the template document.
Make secondary lists for each Word form.
If you have a primary input list, then a workflow that recreates a list copy in the secondary list as per the required form.
This should force the secondary lists to populate data onto the form as per each type, then save the form back to your primary list.
A bit out of the way, but should be able to be done.
You can use word (2007/2010) quick parts to pull metadata from SharePoint, but it works only if you use document library and not a list.