Sort list items according to predifined order

hi all,
I wonder is there any way to sort the items of a list
according to a predefined order (e.g., 2,3,1)?
Many thanks

As far as I know the only predefined sort order is
alphabetic. You could write a function using
list.addAt(position,value) to add new items in the proper location
and maintain the sort order yourself. This might involve a lot of
looping through the target list, depends on how complex your sort
rules are.
I had a project where I needed to keep a list of file names
sorted by rules other than alphabetic. I actually used a big lookup
table (case statement) to append letters to the beginning of each
name just before adding them to the list, the letters were stripped
off when data was retrieved from the list. This trick allowed me to
use list.sort() to maintain the sort order. It’s an ugly
solution and I’m not proud of it, but it got the job done.

Similar Messages

  • Workbook list-Rearrange according to Alphabetical order

    Hello,
    When i open workbook from Bex, By default it displays the List of workbooks under the menurole based on the created date and time.
    For Ex : i have A and B are two workbooks under menu role 1. A is created on 18th August and B is created on 19th August.
    When i open the workbook , the window lists B and then A under the menu role 1.
    But by default it needs to display as A and then B in the second line.
    Provide me the steps to complete this please
    Thanks in advance
    Kind regards
    M.A

    Hi
    Thanks for the information.
    But when ever user creates new Workbook then that also needs to be realigned in PFCG manually.
    I hope this is not required, I need the solution which solves with out any maual effort.
    When ever user creates and opens workbook it needs to be displayed in Ascending or descending order.
    Thanks
    Regards
    M.A

  • Attach Item To List Item Using Powershell

    Hi Everyone
    Hoping someone can help me with a SharePoint Powershell Script i need to do..
    What I have is a Document Library with word documents and a list of items that these documents needs to be attached to.
    The document library and the list have a column in common, Customer Order No.
    I want to basically take all the items from the document library and attach them to the list items where the Customer Order No matches, is this possible with Powershell?
    Thanks in advance :) 

    [System.Reflection.Assembly]::LoadWithPartialName(”Microsoft.SharePoint”)
    $filePath = "location"
    $siteUrl = "site"
    $spSite = new-object Microsoft.SharePoint.SPSite($siteUrl)
    $spWeb = $spSite.OpenWeb()
    $spList = $spWeb.lists["YourListName"]
    $spitem = $spList.Items.Add()
    $item = $splist.GetItemById($1)
    AddAttachment $item $filePath
    function AddAttachment($item, $filePath)
    $bytes = [System.IO.File]::ReadAllBytes($filePath)
    $item.Attachments.Add([System.IO.Path]::GetFileName($filePath), $bytes)
    $item.Update()
    $spitem.Update()
    w: http://www.the-north.com/sharepoint | t: @JMcAllisterCH | YouTube: http://www.youtube.com/user/JamieMcAllisterMVP

  • Update a list item based sort order of created by column value

    HI
    using powershell script how to sort a list column before update a list  item.
    here i created a document library and uploaded some documents and update ProcessNo column based sort order of created column
    value.
    Add-PSSnapin Microsoft.SharePoint.PowerShell -EA SilentlyContinue
    $webURL = "http://tspmcwfe:91" $listName = "Courts"
    Get the SPWeb object and save it to a variable
    $web = Get-SPWeb $webURL
    $list = $web.Lists[$listName] 
    $items = $list.items
    Go through all items
    foreach($item in $items)
    $item["ProcessNo"] = 1
    $item.Update()
    $web.Dispose()

    Hi,
    According to your description, my understanding is that you want to sort the list items order before updating items using PowerShell.
    I suggest you can use the Sort-Object command to sort the list items.
    Here are some detailed articles for your reference:
    Better SharePoint Lists and List Items in PowerShell
    Sort-Object
    Thanks
    Best Regards
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • Is it possible to sort Mac Mail Rules into alphabetical order?  I have in excess of 50 rules and everytime I want to add to a rule, such as "delete incoming" I have to go through the entire list to find it.

    Is it possible to sort Mac Mail Rules into alphabetical order?  I have in excess of 50 rules and everytime I want to add or amend a rule, such as "delete incoming" I have to go through the entire list to find it.  I have tried clicking on the heading "Description" but it does not sort.  Any assistance would be greatly appreciated

    Hi,
    According to your description, my understanding is that use CMAK to configure split tunneling on VPN clients, traffic to specified devices can be routed via their own default gateway.
    If the manually added route entries all have default metric and interface, clients will select one by the default routing rule, can’t select one of them according to clients’ own conditions. So, I am afraid that CMAK can’t implement the function which you need.
    A blog described about How to configure split tunneling on VPN clients using CMAK, for your reference:
    http://blogs.technet.com/b/rrasblog/archive/2007/06/11/split-tunnelling-using-cmak.aspx
    Best Regards,
    Eve Wang 
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Support, contact [email protected]

  • Sort list of items.

    I have a "problem"
    When using a local variable LabVIEW has a list of items from which one may
    choose.
    When this is list is growing it is sometimes difficult to find the right
    item.
    Is it possible to sort these items?

    Items in a cluster can be reordered by clicking "Reorder controls in
    cluster..." in its context menu.
    Items in a vi's pannel can be reordered by going into "Edit" \ "Set
    tabbing order..." in its menu.
    ! - oz

  • Open a SharePoint List item in Modal Pop up in SP 2013 fails after you filter or sort the list

    Sorry for the long post. This has been killing me. I had this script working perfectly fine in SharePoint 2010 (online) and basically i have a source custom list (list A) with a hyperlink column and a Destination List with say title and my name.
    Source List (list A) looks like this with these 2 columns
    Title    Test Link
    A         Link 1
    B         Link 2 
    C         Link 3
    Each of these links link to the actual list item in the destination list, so for example, link 1 is/sites/2013DevSite/Lists/Destination%20List/EditForm.aspx?ID=1
    So basically i want anytime the Link are clicked that point to another list's item to open in a modal dialog and the script below worked perfectly fine in SharePoint 2010 (online)
    <script language="javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js" type="text/javascript"></script>
    <script language ="javascript" type="text/javascript">   
    jQuery(document).ready(function() {
    jQuery('a[href*="EditForm.aspx"]').each(function (i, e) {
    // Store the A tag's current href in a variable
    var currentHref = jQuery(e).attr('href');
    jQuery(e).attr({
    'href': 'javascript:void(0);', 
    // Use the stored href as argument for the ShowInModal functions parameter.
    'onclick': 'ShowInModal("' + currentHref + '");'
    function ShowInModal(href) {
    SP.UI.ModalDialog.showModalDialog({title: "Edit Item", url: href});    
    </script>
    All it does is find the href tags for that particular value Editform.aspx and the pop modal works in SP 2010 online. So the site page is designed in such a way there is a content editor web part with the reference to this javascript file and the sharepoint
    list is right beneath it and this worked perfectly opening in modal windows in SP 2010.
    Since migration to 2013, this is what exactly happens
    1.) when you come to the site page, the modal works,
    2.) If you filter or sort on say the Title or Test Link column in Source list (lets say you select the Value A), the script does not fire at all, if i hover over the hyperlink, the who hyperlink is shown and does not open the hyperlink in the modal pop up.
    - This is important because i want to be able to sort on a particular item...
    Could someone please let me know what am i doing wrong and why is this not working when i sort the list. Thanks for all the help.
    Once again i am trying to open a sharepoint list item in Sharepoint 2013 from another list using Jquery

    A ListItem has its own unique row id so in all likelihood, an insert with the same data will result in a new list entry. The Lists Web Service however, has an UpdateListItem method which will take an update request. [refer
    http://msdn.microsoft.com/en-us/library/office/websvclists.lists.updatelistitems(v=office.15).aspx ]
    There is another note in the conference (marked answered) to your List Item Update problem. Probably worth a try too. [refer
    http://social.msdn.microsoft.com/Forums/en-US/bee8f6c6-3259-4764-bafa-6689f5fd6ec9/how-to-update-an-existing-item-in-a-sharepoint-list-using-the-wss-adapter-for-biztalk?forum=biztalkgeneral ]
    Regards.

  • Material staging indicator not populating in prod order WM pick list item

    Hello,
    I have an issue with material staging in an prod order
    1) PP-WM interface is activated
    2) Control cycle for material is created
    3) Production storage location is created for material
    4) storage type is 100 for production
    5) There is one discontinued material and also the follow up material
    6) stock of discontinued material is zero and requirement are passed to follow up material
    When we confirm the order the stagging indicator for both follow up material as well as discontinued material automatically populates zero (Non relevence to pick list items) where as it should be one (1 - for pick list items).
    One more issue user has manually inserted discontinued material as well as follow up material in production order change mode.
    In the BOM of a main material both discontinued as well as follow up material is there with some quantity as a component.
    For the same work center, control cycle , production storage location the indicator is populating.
    These two material (discontinued as well as follow up) are appearing twice in the WM pick list screen where first two line items are OK and populating indicator "1". But in line item last and second last indicator is not there.
    My question is why the stagging indicator is not automatically populating in the production order WM pick list screen in front of components.

    Unfortunately, WM material staging via production orders is not possible
    from the pull list.  Please see the long text of message RMPU 311
    (WM material staging for production order reservation not possible):
    "You cannot carry out a WM material provision for pick parts from
    production order reservations in the pull list". The reasons for this
    are cleary explained in the SAP on-line documentation via the
    following path :
      Logistics -> Logistics Execution -> Warehouse Management Guide ->
      Goods Issue -> Goods Issue for Production Supply ->
      Material Staging for Repetitive Manufacturing
    See the following under the Selection heading :
    The choice of the selection type influences which types of WM material
    staging are supported in the pull list. However, the pick parts can be
    staged via RS headers/planned orders but not with the current BOM
    explosion. The release order parts, on the other hand, can also be
    staged if the current BOM is used for calculating the dependent
    requirements.
    WM material staging via production orders is not possible from the pull
    list.
    I think you may try in CO02 or COR2 for production order or process order.

  • A List of Customer Line Items according to the *CONTACT PERSON*

    Hi All,
    I'm looking for a report which shows the  List of Customer Line Items according to the CONTACT PERSON data, that I can find in the customer master data.
    Thanks for your help

    Not sure if you can add this field to the selection criteria. Please look at OSS notes 188663, 310886. I remember there were some restrictions as only fields from certain tables are allowed to use in FBL1N, FBL3N and FBL5N transactions.
    Shail

  • How do you geT ICal to print out the To Do Items in the same order as you have sorted them on the screen

    How do you geT ICal to print out the To Do Items in the same order as you have sorted them on the screen

    Without actually seeing some of what is in the .ics attachment there's really no way to see what's going on.

  • Change order of list items in sealed MP

    Hi,
    I have a MP that is sealed. It includes a list, but also list items exist in that sealed MP. I need to reorder the list. I have the unsealed MP and the seal used. Can i just edit the unsealed version, changing order in the XML code and increase ver. nr.
    and if yes then how?

    Hi,
    I did a test in my lab and just edited the xml version of the MP. I changed the numbers in ordinal to rearrange, incremented the version # plus resealed and imported.
    <EnumerationTypes>
    <EnumerationValue ID="IncidentPriorityList" Accessibility="Public" />
    <EnumerationValue ID="Enum.cd7c7616b19745ffb646e0320ba85bb4" Accessibility="Public" Parent="IncidentPriorityList" Ordinal="0" />
    <EnumerationValue ID="Enum.8ae91ca8f3a7439eb2941c4a1547908c" Accessibility="Public" Parent="IncidentPriorityList" Ordinal="2" />
    <EnumerationValue ID="Enum.0d5e33cc41504a4eaf66b64b2dff3a2d" Accessibility="Public" Parent="IncidentPriorityList" Ordinal="1" />
    </EnumerationTypes>

  • Order list from purchasing list item

    Hi All Retail expert,
    I have created purchasing list item. Now when i am releasing purchasing list thru wrfapc12, no order list created . only message comes ..please purchase list .
    Kindly suggest. I am really stuck where i am missing.
    With Thanks & Regards,
    Santosh

    Hi Kewin,
    Thanks for your replay.
    Yes. i am releasing pourchasing list in wrfapco2.
    afterthat when i am using wrfapc12 to create order list,below message is coming--
    There is no purchase list in selection.
    Kindly suggest.
    With Regards,
    Santosh

  • Order Records by List Item description

    Can someone please give me some tips on how to solve the following issue?
    I have a List Item that is populated using the following record group query:
    SELECT DOC_TYPE_DESC, TO_CHAR(DOC_TYPE_INFO_ID) FROM DOC_TYPE_INFO WHERE ACTIVE = 'Y' ORDER BY DOC_TYPE_DESC
    The DOC_TYPE_INFO_ID is stored with the actual record (foreign key relationship) but the user will see the description values in order to make a selection.
    I'd like to give the user the option of ordering the records by this description value.

    the function has to be on the database to be used in sql.
    the sql sent by forms to the database when it queries the block has to be something like this
    select ...
    from documents
    where...
    order by my_database_function(doc_type_info_id)
    the function returns the doc_type_desc from the doc_type_info table for the specified doc_type_info_id.
    put "my_database_function(doc_type_info_id)" in the block's order by property.
    there might be a more efficient method. try this out:
    select * from documents
    order by (select doc_type_desc from doc_type_info where doc_type_info_id = documents.doc_type_info_id)
    if that works, put the bold bit in the order by property instead of using the function.

  • In-list: does oracle follow the order of the items in the in-list?

    We have a partition table, each partition has one day's data. And we are using 4 partitions, every day the oldest partition will be truncated so that it could be reused next day. Some data will be sit in more than 1 partitions, and we need to get the newest data. The current partition has a partition_key=MOD(TRUNC(SYSDATE) - TO_DATE('01-JAN-2005', 'DD-MON-YYYY') + 1, 4).
    If oracle obeys the order of the items in the in-list, then the following sql should work and has the least cost. But I am not sure whether oracle run time engine will obey the order. I recalled Lewis had said run time engine might not follow the plan in the execution plan (explain plan).
    select *
      from tab
    where id=:id and partition_key in
           (MOD(TRUNC(SYSDATE) - TO_DATE('01-JAN-2005', 'DD-MON-YYYY') + 1, 4),
            MOD(TRUNC(SYSDATE) - TO_DATE('01-JAN-2005', 'DD-MON-YYYY') , 4),
            MOD(TRUNC(SYSDATE) - TO_DATE('01-JAN-2005', 'DD-MON-YYYY') -1, 4),
            MOD(TRUNC(SYSDATE) - TO_DATE('01-JAN-2005', 'DD-MON-YYYY')-2, 4)) and rownum=1;If oracle doesn't follow the order in the in-list, does oracle follow the order of subquery in "union all", such as
    select * from
           select * from tab where where id=:id and partition_key =MOD(TRUNC(SYSDATE) - TO_DATE('01-JAN-2005', 'DD-MON-YYYY') + 1, 4)
              union all
           select * from tab where where id=:id and partition_key =MOD(TRUNC(SYSDATE) - TO_DATE('01-JAN-2005', 'DD-MON-YYYY') , 4)
              union all
           select * from tab where where id=:id and partition_key =MOD(TRUNC(SYSDATE) - TO_DATE('01-JAN-2005', 'DD-MON-YYYY') - 1, 4)
              union all
           select * from tab where where id=:id and partition_key =MOD(TRUNC(SYSDATE) - TO_DATE('01-JAN-2005', 'DD-MON-YYYY') - 2, 4)
    where rownum=1

    Is there an Oracle version number on your database?
    Is "Lewis" Jonathan Lewis? If so please post a link to his comment so we can read it and understand what you are referring to.
    If your table is indeed partitioned then please post the DDL that created it ... not every column but at least the partition key
    and the partioning template.
    Please also post your explain plan report generated from your DML statements by dbms_xplan.display.
    We can not help with what we can not see.

  • Inserting ordered/unordered list items breakes the document design

    Hi,
    I use JEditorPane to edit HTML document. When I insert ordered/unordered list items, it breakes the design of the document. For example, I have next peace of the document:
    <center>
    This text is centered.
    One more line...
    </center>
    after inserting list item between text lines, document looks like :
    <center>
    This text is centered.
    </center>
    <ol>
    <li>
    </li>
    </ol>
    <center>
    One more line...
    </center>
    Note, that center tag is closed before list item and opened after it.
    Is it possible that inserted list items will save the original design of text around ?
    Thanks.
    .Vlad.

    Change the Leading in the Character Pallet to a smaller number, and increase the Space After in the Paragraph Pallet.
    The space between lines in the same paragraph is the leading, the space between paragraphs is not leading, and trying to achieve it with the leading field always creates more problems than it solves.

Maybe you are looking for

  • [locked] Is there any way to complain to Adobe re. installing McAfee stuff?

    Is there any way to officially complain to Adobe about installing McAfee software? In last several updates of Flash I did not see any option to opt out and since I don't need this "tool", every update to Flash is followed with uninstall. I install Fl

  • JMS Content Conversion - Need to control RecordSet per Message

    Hi All, I have done a simple JMS to JMS scenario with content conversion. I need to control  RecordSet per Message ( similarlly we do for the FILE . that is , Recordset Structure = Records, 500 and Recordset per message = 1) How to achive this in JMS

  • Text printing in smartforms

    Hi All, My smartform has 3 pages namely FIRST, NEXT and TERMS. I have 2 texts ( T1 and T2) to be printed on the smartforms. These texts are defined only in the first and the next pages. The condition is that these 2 texts(T1 and T2) should be printed

  • Help, songs skipping

    I've had my ipod for a couple months now and I had to exchange it once and now this one isn't working well either. I've downloaded songs into itunes from my c.d.'s and now some of the songs are skipping. I tried to download a c.d. but the whole c.d.

  • MySQL DSNs

    Hi Is anyone out there able to do a quick test of MySQL DSNs? I am running CF10 beta on Win Vista Home Premium 64-bit, and trying to create DSNs to a  "MySQL 5.5.2-m2-community" DB, also installed locally.  When I do so, I get this: Connection verifi