How to get Custom-Content-type Column Value of a Document Library-Folder

Hello
I have to add a custom-column(folder-imageURL) for Folders in a Document Library.
So I have created a Custom-CotentType "FolderCtype" with new column "folder-imageURL" and attached in the Document Library.
Whenever I create a new folder in that document library I will select my "FolderCtype" & and then add an image url in "folder-imageURL" column.
How do I access this image url in Code?
part of my code is as follows.
SPContentType cntType = List.ContentTypes["FolderCtype"];
SPField field = cntType.Fields.GetField("folder-imageURL");  //I have Field name here//
 foreach (SPFolder folder in RtFolder.SubFolders)
                    if (folder.Name.ToUpper() != "FORMS")
                       string FolderName = folder.Name;
                      string FolderImageUrl = ?              //How can I get this????//
Thanks in advance

Hi, Patrickm, Thank You
If your “folder-imageURL” column is a “Hyperlink or Picture” column, then you can get the hyperlink like this:
SPListItem item = folder.Item;
if (item[field.Title] != null)
string FolderImageUrl = item[field.Title].ToString().Split(',')[0];
Console.WriteLine(FolderImageUrl);
Best regards,
Patrick
Patrick Liang
TechNet Community Support
S H A J A N

Similar Messages

  • How to get customer number and name from the SD document

    Hi All,
    Can you please let me know how to get Customer Number and Name from the SD Document?
    Thanks a lot....
    Anil

    Hi,
    It will be displayed in the SD (BIlling document) itself,  you clikc on the VF03. The customer name and number will also appear in the SO document also Tcode VA03
    regards,
    radhika
    Edited by: kolipara radhika on Jul 10, 2009 5:32 AM

  • How to Create Custom Content Type with 100 site columns ?

    Hi EveryOne,
    i have one requirement to create custom conten types in sharepoint 2013 as follows.
    1. Create a content type with 100 site columns ( in this 100 site columns includes 10 mms feilds and 10 lookup fields).
    2.when we deploy the content type in other server if already the same content type existing in the server it should be upgrade the existing content type.
    Please advise how do develop the solution ( using power shell script or visual studio with event receiver or xml file)
    Regards,
    Srinivas

    Try below:
    http://www.mindfiresolutions.com/Add-Columns--Fields-Programmatically-to-a-SharePoint-List-282.php
    using(SPSite
    oSPsite = new SPSite("http://Web-URL"))
        oSPsite.AllowUnsafeUpdates =
    true;
    using (SPWeb oSPWeb = oSPsite.OpenWeb())
            oSPWeb.AllowUnsafeUpdates =
    true;
    /* get the SPList object by list name*/
    SPList lst = oSPWeb.Lists["EmpList"];
    /* create a Numeric field for EmpID */
    SPFieldNumber fldEmpID = (SPFieldNumber)lst.Fields.CreateNewField(
    SPFieldType.Number.ToString(),
    "EmpID");
            fldEmpID.Required =
    true;
            fldEmpID.DisplayFormat =
    SPNumberFormatTypes.NoDecimal;
    /* create a Text field for Name */
            SPFieldText fldName = (SPFieldText)lst.Fields.CreateNewField(
    SPFieldType.Text.ToString(),
    "Name");
            fldName.Required =
    true;
            fldName.MaxLength = 50;
    /* create a Date field for Dob*/
    SPFieldDateTime fldDob = (SPFieldDateTime)lst.Fields.CreateNewField(
    SPFieldType.DateTime.ToString(),
    "Dob");
            fldDob.DisplayFormat =
    SPDateTimeFieldFormatType.DateOnly;
    /* create a Currency field for Salary */
            SPFieldCurrency fldSal = (SPFieldCurrency)lst.Fields.CreateNewField(
    SPFieldType.Currency.ToString(),
    "Salary");
            fldSal.Currency =
    SPCurrencyFieldFormats.UnitedStates;
            fldSal.DisplayFormat =
    SPNumberFormatTypes.TwoDecimals;
    /* add the new fields to the list */
            lst.Fields.Add(fldEmpID);
            lst.Fields.Add(fldName);
            lst.Fields.Add(fldDob);
            lst.Fields.Add(fldSal);
    /* finally update list */
            lst.Update();
            oSPWeb.AllowUnsafeUpdates =
    false;
        oSPsite.AllowUnsafeUpdates =
    false;
    If this helped you resolve your issue, please mark it Answered

  • How to get the Row and Column values in ALV (without using Objects)

    Hi All,
    I need to get the Row / Column when double click is used in ALV, I can use the double click event for this. However, I do not want to use the Object Oriented ALV. I want to implement the same functionality using general (using functions) ALV.
    Is there any way to get the row / column values for a Generia (non-OOPs) ALV report.
    Please help.
    Thanks,
    Vishal.

    Hello,
    The only think you have to do is to get the index where the user clicked, and then read the internal table you sent to the alv
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          i_callback_program       = 'prg_name'
          i_callback_pf_status_set = 'SET_PF_STATUS'
          i_callback_user_command  = 'USER_COMMAND' " this is to the click event!!
          i_callback_top_of_page   = 'TOP_OF_PAGE'
          is_layout                = alv_layout
          it_fieldcat              = alv_fieldcat
          i_save                   = 'A'
          it_events                = alv_events[]
        TABLES
          t_outtab                 = i_totmez.  ---> TOUR IT.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
              WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    " then....
    FORM user_commandUSING r_ucomm     TYPE sy-ucomm
                                    ls_selfield TYPE slis_selfield.
    " r_ucomm -> HAS THE STATUS
    " ls_selfield-tabindex  -> HAS THE SELECTED INDEX
    " THEN READ THE INTERNAL TABLE
    " HERE YOU WILL HAVE THE SELECTED ROW
    READ TABLE i_totmez INDEX ls_selfield-tabindex.
    ENDFORM.
    cheers,
    Gabriel P.

  • How to get sum of highlighted column values.

    Is there currently any functionality that allows you to highlight a certain number of column values in the returned result set and to see the sum of the values highlighted.

    Hi,
    Not directly, sorry.
    You could always try highlighting the desired cells, copy/paste them into a column in a spreadsheet like MS Excel or Open Office Calc, then add a sum function into a nearby open cell. The spreadsheet can be added to SQL Developer's Tools|External Tools menu for convenience.
    Regards,
    Gary Graham
    SQL Developer Team

  • Restricting user access based on a site column value in a document library.

     
    We have a business requirement to show the contents of a document library based on a value (or values) in the site column (or multiple columns). For example, my document library has a custom site column called confidentiality. This
    will have values like restricted, internal and public. Now, based on the AD Group the user belongs to, I should be able to control the access to Restricted or Restricted and Internal files from the document library. We are using SharePoint Online 2010.
    Please suggest the best way to achieve this requirement?

    SharePoint's security model doesn't allow you to specify security based on metadata. You could however create a Sandboxed Solution containing a Feature that registers a custom event receiver on the Document Library. The logic inside this
    Event Receiver would fire after editing item properties (ItemUpdated) to apply item-level permissions based on the rules you need.
    Make sure to read the article below to determine if fine-grained permissions are suitable in your case:
    http://technet.microsoft.com/en-us/library/gg128955.aspx

  • How to get custom field name and value in data table using csom

    i am using using this code but iam not getting FieldValues property..
     internal void ReadProjectCustomFields(string strProjectName)
                string url = "https://techwhizepm.sharepoint.com/sites/rnd/";
                using (ProjectContext projContext = new ProjectContext(url))
                    SecureString passWord = new SecureString();
                    foreach (char c in "Pass@word123".ToCharArray()) passWord.AppendChar(c);
                    projContext.Credentials = new SharePointOnlineCredentials("[email protected]", passWord);
                    projContext.Load(projContext.Projects, o => o.Where(i => i.Name == strProjectName));
                    projContext.ExecuteQuery();
                    foreach (PublishedProject _t in projContext.Projects)
                        DraftProject dftproj = _t.Draft;
                        //CustomFieldCollection custs = dftproj.CustomFields;
                        CustomFieldCollection custfs = dftproj.CustomFields;
                        projContext.Load(dftproj);
                        projContext.Load(custfs);
                        projContext.ExecuteQuery();
                        ddlcfields.Items.Clear();
                        if (!custfs.Count().Equals(0))
                            ddlcfields.DataSource = custfs.AsEnumerable().Select(o=>o.Name);
                            ddlcfields.DataBind();
                        DataTable dt = new DataTable();
                        dt.Columns.Add("Name", typeof(string));
                        dt.Columns.Add("InternalName", typeof(string));
                        dt.Columns.Add("FieldType", typeof(string));
                        //dt.Columns.Add("FinishDate", typeof(string));
                        DataRow dr = null;
                        foreach (CustomField _cust in dftproj.CustomFields)
                            dr = dt.NewRow();
                            dr["Name"] = _cust.Name;
                            string intername = _cust.InternalName;
                            dr["FieldValue"] = dftproj[intername].ToString();
                            //dr["FinishDate"] = _task.Finish;
                            dt.Rows.Add(dr);
                        GridView1.DataSource = dt;
                        GridView1.DataBind();

    I am looking through the API calls in FDM Workbench, but cannot see the table (tPOVPartitions) you mentioned listed. Is this the correct name? And do I just use the function listed in the object browser to run the query?
    Furthermore (going back to my initial thoughts of using strFile), it appears that although the variable contains the .Dat filename and path, the actual file is non-existent when "BefExportToDat" is executed:
    Error:
    Error: Export failed.
    Detail: File not found.
    This would make sense, but it does make the variable "strFile" a little pointless since one cannot make use of the file in this particular event script. Do you please have any thoughts on this?

  • Update Property Promotion Column Value in InfoPath Document Library

    Hello All,
    I just tried to update a property promotion value using this code:
    using (SPSite site = new SPSite(webName))
                        using (SPWeb objweb = site.OpenWeb())
                            SPList spList = objweb.Lists["XYZ"];
                            SPQuery qry = new SPQuery();
                            qry.Query = @"<Where>" +
                          "<Eq>" +
                          "<FieldRef Name='ServiceR' /><Value Type='WorkflowStatus'>17</Value>" +
                          "</Eq>" +
                          "</Where>";
                            qry.ViewFields = @"<FieldRef Name='Title' /><FieldRef Name='Evaluation_x0020_Status' />";
                            SPListItemCollection listItems = spList.GetItems(qry);
                            objweb.AllowUnsafeUpdates = true;
                            if (listItems.Count > 0)
                                foreach (SPListItem item in listItems)
                                    if (item["Evaluation_x0020_Status"] == null)
                                        item["Evaluation_x0020_Status"] = "Evaluation Completed";
                                        item.Update();
                            objweb.AllowUnsafeUpdates = true;
    The code exexuted but the value does not updated !!
    Any Answer ?

    I resolve the issue using this link:
    http://nanettevb.blogspot.com/2011/03/cannot-update-promoted-fields-from.html
    Omar Attari

  • Creating Custom Content Types

    As the title suggests,  does anyone know how to create Custom Content Types in Adobe Livecycle Content Services ES?  I have looked far and wide across the www, and haven't had any luck with a straight forward, easy to follow, tutorial on the subject.  I have seen it for Actions and Aspects, but not Content.
    Thank you in advance,
    Alex

    Marc,
    Thanks for your response.  I've spent the past couple of days trying to get it to work, but I still cannot figure it out.
    According to all documentation I have found, I have modified the files I thought were the same as the Alfresco files:
    C:\...\jboss\server\all\deploy\contentservices.war\WEB-INF\classes\alfresco\extension
                   + .\liveCycleContentModel.xml
                        Added the <types> tag above the <aspects> tag, and created my type as specified online and also in a book
    Then I copied the web-client-config.xml to the extension folder and renamed as web-client-config-custom.xml and added the code to Content Wizards and Action Wizards to display it in the web ui.
    Am I missing anything?  When I re-package the .war file and redeploy/restart JBOSS, my localhost:8080/contentspace is completely broken.  no login in or anything but workspace is still in tact.
    Thanks for any further help,
    Alex

  • Required field in custom content type not required in custom list instance

    I have an issue with a custom SharePoint 2013 solution. Among other components, it consists of:
    a feature with several custom fields with different types, some of which are taxonomy fields,
    a feature with three custom content types using different sets of the custom fields with partially different configuration, e.g. whether they are required or not,
    a feature with a custom document library template and instance using two of the custom content types and a default picture library that is programmatically customized when the feature is activated, e.g. it is assigned the third custom content type.
    When deploying the solution and activating the feature, everything is set up correctly except a single taxonomy field for one of the doc lib's content types. It is defined to be required in both content types but indeed it does not show up as required for
    the default content type whereas everything works fine for the other. And it does not matter which of the two custom content types is defined first (= default) in the list template's schema.xml, the issue always occurs for the same taxonomy field in the doc
    lib's default content type. When I use the built-in Document content type as default, the field is required for both custom content types. However, using the Document content type is not an option.
    If you think this behavior is not strange enough: When the list content type's field is set required through the SharePoint UI, it becomes optional again when the list column is updated, e.g. its display name is changed.
    Any ideas?

    Hi,
    Thank you for your question.
    We are currently looking into this issue and will give you an update as soon as possible.
    Thank you for your understanding and support.
    Linda Li                
    Forum Support
    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 Subscriber Support, contact
    [email protected]
    Linda Li
    TechNet Community Support

  • Attach a custom content type and set as default for picture library using client object model

    Hi,
    How to associate custom content type to a picture libraray and set it as default using the client object model?
    Thanks

    Hello,
    Here you go:
    http://social.msdn.microsoft.com/Forums/sharepoint/en-US/b1de0697-0006-4f89-8909-1b94aa18ad89/how-to-reorder-content-types-in-list-with-client-context
    http://www.niteenbadgujar.com/2013/05/change-default-content-type.html
    Hope it could help
    Hemendra:Yesterday is just a memory,Tomorrow we may never see
    Please remember to mark the replies as answers if they help and unmark them if they provide no help

  • Can I add Custom Content Type created programmatically to Custom List Definition?

    I have created Custom content type programmatically in the Feature Receiver. Followed by this have another feature which creates List Template. I want to add the custom content type to the list template.
    Using VS 2012, I added the custom content type to the list definition. The Schema.xml for the list definition looks as below:
    <ContentTypes>
    <ContentTypeRef ID="0x010100D7D9F4B1F4A9684BB44389571024B2EC00C393BB21B8AD7B41B62A87DF0501504D" />
    </ContentTypes>
    ID was automatically added by the VS tool.
    List Template is created, the new content Type is also added, but the Name is displayed as "Document" instead of the custom content type name. So I see two CTs with the name "Document".
    How can I achieve this? Any help is appreciated.

    Hi,
    Please add EnableContentTypes="TRUE" in the <List > tag.
    The following materials would be helpful:
    How to add custom content type to a custom list
    http://innersharepoint.blogspot.de/2009/10/how-to-add-custom-content-type-to.html
    SharePoint Custom List Definition with Content Type
    https://achrafsp.wordpress.com/2013/03/31/sharepoint-list-definition-with-content-type/
    Create a Custom SharePoint List Definition
    http://www.mssharepointtips.com/tip.asp?id=1188
    Best Regards
    Dennis Guo
    TechNet Community Support

  • Fix for issue where update KB2760758 broke multiline text properties field in custom content type

    In September Microsoft Office update KB2760758 caused an issue with the multi-line field used in custom content type used in SharePoint 2010 document libraries.  KB2826026 apparently caused the same issue. 
    Users were not be able to save documents on the SP server (in a document library) as MS Word would prompt them with a "Required properties" error message stating: ".. correct the invalid or missing required properties".
    Several sources indicated that this was supposed to be fixed in the December Office updates, but I don't see an update that affects MSO.dll where the problem originates.  Does anyone know which update fixes the issue?

    I updated you on my blog post, but just to provide an update here for those searching, this issue is not fixed in the update to the MSO.DLL available in the Dec 2013 CU, and the product group currently has no ETA on a fix.
    Of course, PSS should update me as soon as they do hear of an ETA from the PG.
    Trevor Seward, MCC
    Follow or contact me at...
    &nbsp&nbsp
    This post is my own opinion and does not necessarily reflect the opinion or view of Microsoft, its employees, or other MVPs.

  • Microsoft Office update KB2760758 breaks multiline text properties field in custom content type

    Last week SharePoint users have reported issue with multi-line field used in custom content type used in SharePoint 2010 document libraries.
    Users were not be able to save documents on the server (in a document library) as 'word' would prompt them with a "Required properties" error message stating: ".. correct the invalid or missing required properties"
    After some research I found out that removing the following update KB2760758 would fix the problem.
    Obviously this is not an acceptable solution and I would like to know if this issue has been reported and a fix would be issued sooner than later.

    I got an answer already!  So it is a known issue and the update for this particular bug will be released in the Office 2010 December updates.
    It has to do with a bug in MSO.DLL (which we knew already) with versions of the DLL greater than 14.0.710x.xxxx.  You may want to inspect further updates prior to December to validate that they do not contain an updated version of this DLL.  This
    includes security and non-security updates that may be released between now and then.  Every KB has a listing of the DLLs it replaces, so be diligent about checking each update's KB for this particular DLL.
    Trevor Seward, MCC
    Follow or contact me at...
    &nbsp&nbsp
    This post is my own opinion and does not necessarily reflect the opinion or view of Microsoft, its employees, or other MVPs.

  • How to set the column order of a sealed column in a custom Content Type for the new item form NewDocSet.aspx?

    Dear SharePoint Developers,
    Please help.
    I need to know How to set the column order of a sealed column in a custom Content Type for the new item form NewDocSet.aspx?
    I think this is a "sealed column", whatever that is, which is  shown in SPD 2013 as a column of content type "document, folder, MyCustomContentType".
    I know when I set the column order in my custom Content Type settings page, it is correct.
    But, when I load the NewDocSet.aspx page, the column order that I set in the settings page is NOT used for this "sealed column" which is bad.
    Can you help?
    Please advise.
    Thanks.
    Mark Kamoski
    -- Mark Kamoski

    Hi,
    According to your post, my understanding is that you want to set the column order of a sealed column in a custom Content Type for the new item form NewDocSet.aspx.
    Per my knowledge, if you have Content Type management enabled for the list or library (if you see a list of content type with the option to add more), the display order of columns is set for each content type.
    Drill down into one of them and you'll see the option under the list of columns for that content type.
    To apply the column order in the NewDocSet.aspx page, you need to:
    Select Site Settings, under Site Collection Administration, click Content type publishing. In the Refresh All Published
    Content Types section, choose Refresh all published content types on next
    update.
    Run two timer jobs(Content Type Hub, Content Type Subscriber) in central admin(Central Administration--> Monitoring--> Review timer jobs).
    More information:
    http://sharepoint.stackexchange.com/questions/95028/content-types-not-refreshing-on-sp-online
    Best Regards,
    Linda Li
    Linda Li
    TechNet Community Support

Maybe you are looking for

  • Tax Reconciliation Report

    I've seen a few references to a "Tax Reconciliation Report" in posts on this forum.  Can someone please send me to the transaction to access this report? Thanks!

  • How do I create a new library in LR5 with photos from LR3 and older computer?

    I want to take photos I originally imported with LR3 on an older computer and creat a new library in LR5 on my new computer. I want to throw out all old metadata, folder names and keywords and start from scratch. How would I go about this. My photo l

  • Applet EJB Coomunication

    Hi, I am trying the applet ejb communication . I am very comfortable if I do the same with applet servlet communication but the problem is with the applet calling the ejb directly, i mean to say that can applet can directly lookup the EJB ? I had tri

  • Photoshop Place... Command

    When I try to use the Place command it doesn't place the jpg at the center of the document. This is a problem because I'm using Place in many actions that I've created and if the jpg doesn't start at center of the document, then the translation is of

  • SGA Tuning

    Oracle version: 10g and 11g How to monitor SGA size for tuning whether we need to increase the SGA size or not