Add 1 to an Integer for Folder Name

Hi, I'm trying to create a website which creates a folder on
a local drive with a new JobCode and Description eg: '4928 - My New
Project' when a submit button is pressed. The Job Code and
Description will be stored in a database.
I'm using:
<cfdirectory action="create"
directory="c:\cfusionmx7\wwwroot\#JobCode# - #Form.JobName#">
My problem is that my query is retreiving the latest JobCode
of an existing job what I need to do is add 1 to that to name the
folder correctly. How do I code this?
many thanks for your help

You need to do a <CFDIRECTORY ACTION="list" ... >,
sorting it by file name. Then find the largest Job Code, add 1 to
it and then do your ACTION="create".

Similar Messages

  • How to find list or folder name from SharePoint document URL

    I'm implementing the SharePoint client object model in my VSTO application in .NET framework 4.0(C#).
    Actually we open MS Word files from SharePoint site, we need to create a folder inside the opened documents list/folder and after it we want to upload/add some files to that created folder.
    My problem is that how to get list name/title and folder name of opened document by using the documents URL or Is there an another option to find the list or folder name of opened document.
    Any help will be appreciable.

    In document Library you can get the name of document library directly in URL. for folder name you can try below:
    using System;
    using Microsoft.SharePoint;
    namespace Test
    class ConsoleApp
    static void Main(string[] args)
    using (SPSite site = new SPSite("http://localhost"))
    using (SPWeb web = site.OpenWeb())
    if (web.DoesUserHavePermissions(SPBasePermissions.BrowseDirectories))
    // Get a folder by server-relative URL.
    string url = web.ServerRelativeUrl + "/shared documents/test folder";
    SPFolder folder = web.GetFolder(url);
    try
    // Get the folder's Guid.
    Guid id = folder.UniqueId;
    Console.WriteLine(id);
    // Get a folder by Guid.
    folder = web.GetFolder(id);
    url = folder.ServerRelativeUrl;
    Console.WriteLine(url);
    catch (System.IO.FileNotFoundException ex)
    Console.WriteLine(ex.Message);
    Console.ReadLine();
    http://msdn.microsoft.com/en-us/library/office/ms461676(v=office.15).aspx
    http://social.msdn.microsoft.com/Forums/sharepoint/en-US/801d1a06-0c9b-429b-a848-dd6e24de8bb9/sharepoint-webservice-to-get-the-guid-of-the-folder?forum=sharepointdevelopmentlegacy
    You can also try below:
    http://blogs.msdn.com/b/crm/archive/2008/03/28/contextual-sharepoint-document-libraries-and-folders-with-microsoft-dynamics-crm.aspx
    http://social.msdn.microsoft.com/Forums/sharepoint/en-US/d2d5d7cf-9bbd-4e0f-a772-ecdce4e6149f/how-to-fetch-document-guid-from-sharepoint-document-library-using-sharepoint-web-service?forum=sharepointdevelopmentlegacy
    http://stackoverflow.com/questions/2107716/how-to-get-guid-of-a-subfolder-in-a-document-library-programmatically

  • Unable to customize folder name on import

    I'm using import for several cameras and I would like to have possibility to change 'Date Format' of destination folder name in import dialog:
    Yes, there are several formats, but it would be very useful to have possibility to define my own. E.g. instead of 2012-10-06 I would like to have 2012_10_06. Now I have to rename all my folders after import, which is not very comfortable. I think the best way to make this perfect would be possibility to use 'Filename Template Editor' (used for renaming files) for folder names too.
    Thank you.

    The date format options available in Lr import module are quite limited and not user configurable. However, all is not lost. Basically, you should create the folders as per your prefererred naming convention using the OS tools then drag the files from the card to these folders. In Lr import module you use the Add option rather than Coy or Move. OK, it's not as convient, but it is a lot less liable to fall foul of Lr's import limitations.

  • Add to Folder Name script

    I am missing the script Add to Folder Names. I still have the alias, but the script is missing. Any sources for this script?

    Hi Lannis, here it is...
    Add Prefix-Suffix to Fldr Names
    Copyright © 2001 Apple Computer, Inc.
    You may incorporate this Apple sample code into your program(s) without
    restriction.  This Apple sample code has been provided "AS IS" and the
    responsibility for its operation is yours.  You are not permitted to
    redistribute this Apple sample code as "Apple sample code" after having
    made changes.  If you're going to redistribute the code, we require
    that you make it clear that the code was descended from Apple sample
    code, but that you've made changes.
    --set the source_folder to (choose folder with prompt "Pick the folder containing the folders to rename:")
    try
      tell application "Finder" to set the source_folder to (folder of the front window) as alias
    on error -- no open folder windows
      set the source_folder to path to desktop folder as alias
    end try
    set the prefix_or_suffix to ""
    repeat
              display dialog "Enter the prefix or suffix to use:" default answer the prefix_or_suffix buttons {"Cancel", "Prefix", "Suffix"}
      copy the result as list to {the prefix_or_suffix, the button_pressed}
      if the prefix_or_suffix is not "" then exit repeat
    end repeat
    set the item_list to list folder source_folder without invisibles
    set source_folder to source_folder as string
    repeat with i from 1 to number of items in the item_list
      set this_item to item i of the item_list
      set this_item to (source_folder & this_item) as alias
      set this_info to info for this_item
      set the current_name to the name of this_info
      if folder of this_info is true then
                        if the button_pressed is "Prefix" then
      set the new_file_name to the (the prefix_or_suffix & the current_name) as string
      else
      set the new_file_name to the (the current_name & the prefix_or_suffix) as string
      end if
      my set_item_name(this_item, the new_file_name)
      end if
    end repeat
    beep 2
    on set_item_name(this_item, new_item_name)
              tell application "Finder"
      --activate
      set the parent_container_path to (the container of this_item) as text
      if not (exists item (the parent_container_path & new_item_name)) then
                                  try
      set the name of this_item to new_item_name
      on error the error_message number the error_number
                                            if the error_number is -59 then
                                                      set the error_message to "This name contains improper characters, such as a colon (:)."
      else --the suggested name is too long
      set the error_message to error_message -- "The name is more than 31 characters long."
                                            end if
                                            --beep
      tell me to display dialog the error_message default answer new_item_name buttons {"Cancel", "Skip", "OK"} default button 3
      copy the result as list to {new_item_name, button_pressed}
                                            if the button_pressed is "Skip" then return 0
      my set_item_name(this_item, new_item_name)
      end try
      else --the name already exists
                                  --beep
                                  tell me to display dialog "This name is already taken, please rename." default answer new_item_name buttons {"Cancel", "Skip", "OK"} default button 3
      copy the result as list to {new_item_name, button_pressed}
                                  if the button_pressed is "Skip" then return 0
      my set_item_name(this_item, new_item_name)
      end if
      end tell
    end set_item_name

  • Applescript Help - Add folder name to contents

    Hi everyone
    I am an Applescript newbie, and I need help!
    I have a several folders with 2 jpegs inside them.
    All the jpegs are titled "image1.jpg" & "image2.jpg"
    I am looking for a quick way to add the folder name as a prefix to each jpeg.
    Example:
    Folder name - Wellington Boots
    Images inside - image1.jpg
    The outcome I am looking for is:
    Folder name - Wellington Boots
    Images inside - Wellington Boots-image1.jpg
    This might be really easy to do, but I am struggling to find info on how to do it. Can anyone help?

    Actually, to make it a bit more robust you can change the script to
    tell application "Finder"
      repeat with anItem in the input
        set prefix to (name of container of anItem) & "-"
        set theName to name of anItem
        if theName does not start with prefix then -- already prefixed
          set name of anItem to prefix & theName
        end if
      end repeat
    end tell
    That way it won't add a prefix if there already is one.

  • How to add folder name to document library view

    Using Project Server 2010.
    We have a set of standard folders on each of our project sites for Requirements, Development, Testing, etc.  Currently, we display this library like you would see in File Explorer - you see a list of folders at the top, double-click on a folder
    to drill down, etc.
    I want to display these same documents as a straight list of all documents - not grouped into folders - but with the folder name displayed next to it (sort of like an attribute).  I can create the list view easily by selecting the "Show all items
    without folders" option in the view settings; however, the containing folder name is not available as a column name.
    Is this possible?

    I do not think there is an out of the box way to do this.
    The immediate solution that comes to mind is using a workflow, that runs everytime  a document is uploaded/item created, which may be too much for your scenario.
    Cheers,
    Prasanna Adavi, Project MVP
    Blog:
      Podcast:
       Twitter:   
    LinkedIn:
      

  • How do I use search/find to search for a folder name

    I can successfully use Spotlight and Search in Finder and Mail to find files and emails based on their titles and contents, but how to I use the search functions to find a FOLDER by its name, that I have somehere in my nests of folders - so I can then look inside that folder for what I am looking for.
    The search results never seem to show up any folder names?

    I do have several levels of nested email folders and several hundred folders created over the years. So I was hoping to be able to search for a folder's name, and be taken to it to see it and all of its contents.
    The best I seem to be able to do is search for a word that I hope I remember is in one of the emails in that folder, and then find that email in the search results list - but that list still doesn't tell me where the folder in the nested heirarchy that is my mailbox

  • Search by folder name? Monitor folders for changes?

    Im a long time PC user that LOVED how Picasa automatically indexed any locations that I told it to keep track of. I just got Aperture - but so far I am utterly disappointed in the search function.
    When I used to import all of my photos the folder that each import would go under would be the events title.
    For instance if I shot a wedding I would name the folder "John Smith" because in picasa I could just search for "Smith" and it would have all of the files in that folder as results - regardless of their metadata.
    So here I am with a 2 week old Macbook that I love - but I cant find any of the photos that I want to find.
    My library has roughly 40K images - so without the ability to search by folder names it takes me forever to find the files I am looking for.
    *Surely I am an idiot and just dont know how to search by folder name - can someone enlighten me?*
    Also - is it possible for Aperture to monitor certain folders for changes - for instance if I save something to my library folder from photoshop - do I then have to import that one file I just saved? Picasa would just display it under the folder its in - is there any programs for Macs that behave like this?

    aperture can indeed search on the project title. a little harder to find in the filter dialog, but it is there.
    but again, you'll have to import your data differently than i think you did the first time.
    i'm sorry that you're not happy with Aperture doing what you want, but then again, you're upset because it doesn't work with you're old folder structure. Not every application can be expected to be designed for every possible methodology that someone used to manage their existing data. It was set up to be used more visually than your old method and if you can't take the time to organize your photos when you import them to Aperture, then you're right, it probably isn't for you.
    i would suggest you watch the tutorial on searching to see all of the additional metadata you can search by, maybe it would help in some way.... but if not, good luck with LR

  • Get folder name for item

    Hi All,
    I need to retrieve the folder name for where the item is stored to generate a report in following format in csv
    File Name Full Path Parent Folder Created By Last Modified By Number of Versions Total Size
    My code which gets all other info.
    function Get-DocInventory() {
    [void][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint")
    $site=Get-SPSite -Identity "siteURL"
    foreach ($web in $site.AllWebs) {
    foreach ($list in $web.Lists) {
    if ($list.BaseType -ne "DocumentLibrary") {continue}
    foreach ($item in $list.Items) {
    $data = @{
    # "Web Application" = $webApp.ToString();
    #"Web" = $web.Url
    "Site" = $site.Url
    "list" = $list.Title
    "Item ID" = $item.ID
    "Item URL" = $site.Url+"/"+$item.Url
    "Item Name"= $item.File.Name
    “Item Versions” = $item.Versions.Count
    "Item Created" = $item["Created"]
    "Extensions" = $item.name.split(".")[1]
    "Item Modified" = $item["Modified"]
    "Item Created By" = $item["Author"]
    "Last Updated by" = $item["Editor"]
    "File Size" = $item.File.Length/1KB
    New-Object PSObject -Property $data
    $web.Dispose();
    $site.Dispose()
    #Get-DocInventory | Out-GridView
    Get-DocInventory | Export-Csv -NoTypeInformation -Path D:\Scripts\Hemant\inventory.csv
    Coukld you please help me get folder name
    Thanks Basva

    To get the full Folder URL you could use:
    $item.File.ParentFolder.Url
    And just for the Folder Name use:
    $item.File.ParentFolder.Name

  • Please add options for file names on camera or PlayMemories import (ie: 00001 DateTaken DSC)

    Please add options for file names on camera or PlayMemories import (ie: 00001 DateTaken DSC=   00001 2014_10_21 DSC )

    if(!getNewContactsName())
                   createNew();
                   return;
              if(!getNewContactsSurname())
                   createNew();
                   return;
              String checkName = newName;
              String checkSurname = newSurname;
              if(!checkIfDuplicate(checkName,checkSurname))
                   createNew();
                   return;
              if(!getNewContactsHomeNum())
                   createNew();
                   return;
              if(!getNewContactsWorkNum())
                   createNew();
                   return;
              if(!getNewContactsCellNum())
                   createNew();
                   return;
              if(!checkAtLeastOneNumEntered(newHome, newWork, newCell))
                   createNew();
                   return;
              }This can all be done in 1 if statement just use the or operator (||) will save some room
    private void deleteFromList(String nameOfContact, String surnameOfContact)
         {//Start of deleteFromList()
              int confirm = JOptionPane.showConfirmDialog(null,"Are you sure you wish to delete the contact from the phonebook?","Please confirm",JOptionPane.YES_NO_OPTION);
              if(confirm == JOptionPane.NO_OPTION)
                   return;
              elseWhy do you have a return statement in a void method? there's no need for this you can cut out the no part and just keep the yes

  • HT2470 Why won't Itunes store my music library in my User/Music Folder, if I select my user name as a storage location in Itunes, Itunes creates folders for artist name right in my user folder, instead of in my user/music folder

    Why won't Itunes store my music library in my User/Music Folder? 
    If I select my user name as a storage location in Itunes, Itunes creates folders for artist name right in my user folder, instead of in my user/music folder.  This gets especially annoying because if I tell Itunes to store my "media" in my user/music folder, Itunes will then create a folder named "music" in my "music" folder and will also create additional folders in my user/music folder location to store other non-music media in as well. It is very annoying to see this lack of affinity for folders between two Apple created programs.

    Help iTunes locate your media folder:
    No content shows up in iTunes after updating
    http://support.apple.com/kb/TS1967

  • I traded for a mac; how can I change the home folder name?

         Well I traded a PC for my first iMac and well...... I love it.
    1.  I'm running into a little problem though; I can't seem to change the home folder name to my name.  Although I know it doesn't affect any of the operation of the system or my settings, it psychologically upsets me. 
    2.  Also, is there a way to assign my Apple ID to the computer or does that not matter either? 
    3.  I also see a little lag when trying to connect to the web, but once I do get on it seems pretty beefy, any suggestable reasons? 
    4.  And the final question, did I make the right decision? I traded a Sony Vaio S series tablet (laptop/PC) with an Intel core i5 @ 2.30ghz for an iMac with an Intel Duo Core processor @ 3.06ghz. I've heard the numbers don't really matter but some clarification would help.

    Trying to address some of your questions:
    You state you are running Mountain Lion? Was that the original OS on the Mac? That is very important because:
    a) if it was, the seller/trader needed to transfer the Mountain Lion license to you or it will stay with his Apple ID;
    b) if he purchased ML, he is required to uninstall it before selling the machine because the license is not transferable, which means - again - that it is tied to his Apple ID (along with the machine ID).
    Both/either can present some problems for you since ML is now tied to someone else's Apple ID. If you manage to "introduce" your Apple ID, it will no longer match the records MAS (Mac App Store) has, so updates or other purchases may present problems.
    I would suggest that you either call Apple or book an appointment at the nearest Genius Bar and ask them how to proceed - that way you may be able to set up your own Apple ID on the machine as well as get ML registered as yours (although, as explained above, they may require you to purchase it for yourself).
    Whether or not you made the right decision - well, I've never owned a Windows machine, so I can't answer your question since I have nothing to compare it with. Obviously, I use Macs...... you should be able to run your own test: just do what you normally do and see if it appears to take about the same time, is faster, or is slower.

  • The specified file or folder name is too long,the url path for all files and folders

    The specified file or folder name is too long,the url path for all files and folders must be 260 character or less
    can we increase this limit?
    MCTS,ITIL

    Hi,
    As I understand, you want to increase the length of URL path in SharePoint 2010.
    Per my knowledge, this limit cannot be increased. SharePoint limits URL length because all relative URL links are stored in the clear forms on the SharePoint content DB and often this links are used as primary keys to link one table with another. Fields
    which are used to store these links (for instance tp_DirName from the AllUserData table) allow storing only 256 characters.
    There are several ways that you can resolve or mitigate URL length problems in the SharePoint Server 2010 environment. The following list provides suggestions:
    1. Upgrade all the end-user browsers to Internet Explorer 8, which has a longer URL length limit.
    2. Use shorter names for sites, folders, and documents and control the depth of the site and folder structures to reduce the lengths of URLs.
    3. If possible or allowed, use ASCII names for sites, folders, and documents. This will avoid situations where the URL will be lengthened by being encoded.
    4. To reduce the risk that the SharePoint Server 2010 end-users will encounter problems because of URL length limitations, we recommend that you apply the following effective limits in the deployment:
    256 Unicode (UTF-16) Code units - the effective file path length limitation, including a domain/server name
    128 Unicode (UTF-16) Code units - the path component length limitation
    More reference:
    http://technet.microsoft.com/en-us/library/ff919564(v=office.14).aspx
    http://sharepointknowledgebase.blogspot.in/2013/04/url-path-length-restrictions-in.html#.VKJN53BJA
    Best regards,
    Sara Fan

  • How to add external library in class path folder for use in Java call-out?

    Hi,
    I am working with Java callout component in OSB 12c using Jdeveloper.
    Thing is Jar what i am using to perform conversion of json to xml that using external libraries.
    When i have give reference of my project jar to java callout it doen't found external libraries.
    Could you please tell me how to add external libraries in class path folder or How to use to add it through web-logic server ?
    Thanks,
    Pavan

    Hi,
    Thanks, I have solved issue.
    We can add on following path in windows pc:
    C:\Users\your_usename\AppData\Roaming\JDeveloper\system12.1.3.0.41.140521.1008\DefaultDomain\lib
    One you add your external lib here then do restart weblogic server instance.
    Now, you have that external lib or jar in use.
    Cool!

  • AppleScript: Set folder name of Folder Action?

    Problem:
    How to get the folder name that the running Folder Action script is attached too. Script is functional, stdin bash script with AppleScript via osascript. I just want the folder name, not the POSIX path to it. The System Events dictionary suggests this is possible. I don't want to hardcode the action's assigned folder in the bash script if I can get it dynamically from AppleScript. I know how to return it to bash. AppleScript newbie that has spent several hours googling and testing already.
    Tried:
    tell application "Finder"
         --AppleScript Editor can't get container -- no surprise. Folder action does work
         get POSIX path of (container of ((path to me) as text))
         set workingDir to quoted form of result
         display alert "Current Folder: " message workingDir as critical
    end tell
    tell application "System Events"
         activate
         --AppleScript Editor can't get name of folder action. Folder action does not work
         set currentDir to name of folder action
    end tell
    Appreciation for time and solution in advance.

    twtwtw wrote:
    In that case I suggest you make your life easier.  delete the osascript bit and just return a 0 or 1 from the shell script.  That integer will be passed on to the next action, so add an applescript action that checks to see if the input is 0 or 1 and displays a dialog if necessary:
    on run {input, parameters}
              if input as integer > 0 then
      -- error
      display alert "whatever"
              end if
    end run
    The only reason I posted in the first place was to assess if it was possible to dynamically discover the folder name of the folder action using AppleScript through an osascript request. If the bash script has to be scrapped and entirely rewritten as a Applescript action -- just to obtain the folder name, then that answers my question.
    The purpose of the osascript was to provide an OS X style, user friendly dialog that displays any martian files the bash script ignored. It was the least amount of coding for the result.
    I believe that your input example from above would take the exit status from the preceding shell script. How is my invalidFiles variable passed then? In the shell script, I can pipe the invalidFiles printf line to pbcopy to put that content on the clipboard. After the script is done, I can retrieve that information with a pbpaste command. I wonder if this information is available to your trailing AppleScript action for inclusion in the display alert statement?

Maybe you are looking for

  • IPad 2 3G 64 mic not working from factory, do you have any idea ?

    Hi I have iPad 2 3G 64 , it  works prefect but when I use cam for record video there is problem in mic . Mic not working so no sound in video . I try to use any app from apple store to test mic but still not work also I try to update the device to 4.

  • Photoshop Elements 10 option-click issue

    New install of Lion Server on a Mac Mini.  It appears that the option-click key stroke to select a area of a photo to clone is not working.  I get the error below on Elemens 9 and 10. Could not use the clone stamp tool because the area to clone has n

  • Java mail with Dynamic attachment?

    Hi :-) How to send the mails with dynamically created attachements.. The attachments may be a Excel file created dynamically according to the user inputs on the webpage. Is there any way to send those attachments to the receipients with out storing t

  • User Profile Service failed the logon

    I am sure many of you have heard of this problem before and are ready to tell me to activate the hidden Admin account and dive into the registry, but our problem is different then that. This error happens on Windows 7 Professional AFTER joining a dom

  • Photoshop HUD Color Picker

    I am using CS6 and I can't get the "Show Sampling Ring" to accept the check mark to make it active. I have an image up I am on the background layer and I have the Eye Dropper selected. I have tried the shortcut of alt + shift and right clicking and t