How to get only custom fields from a SharePoint 2010 list?

I am working with the Client Side Object Model. In a console application I am retrieving all fields from a custom list. The problem is the Clientcontext fetches me a bunch of internal fields I do not want to be included. Also this causes some of the fields
to appear more than once.
string siteURL = "http:XYZ";
ClientContext context = new ClientContext(siteURL);
Web oWebSite = context.Web;
context.Load(oWebSite);
context.ExecuteQuery();
//Get the list by title
List produktKatalogListe = spLists.GetByTitle("Produktkatalog");
CamlQuery camlQuery = new CamlQuery();
camlQuery.ViewXml = "<View/>";
ListItemCollection listItems = produktKatalogListe.GetItems(camlQuery);
context.Load(produktKatalogListe);
context.Load(listItems);
context.Load(produktKatalogListe.Fields);
context.ExecuteQuery();
foreach(Field field in produktKatalogListe.Fields)
Console.WriteLine("{0} - {1} - {2} - {3} - {4}",field.Title,field.InternalName,field.Hidden,field.CanBeDeleted,field.FieldTypeKind);
Is there a way to print only custom fields? This would mean omitting fields like
internalID, GUID...
I tried the following:
if(!field.Hidden)
Console.WriteLine("{0} - {1} - {2} - {3} - {4}",field.Title,field.InternalName,field.Hidden,field.CanBeDeleted,field.FieldTypeKind);
Unfortunately this not only does not solve the issue but is also not a very good solution for the case I do want to display custom but hidden fields.
Algorithmen und Datenstrukturen in C#:
TechNet Wiki

The following approach seems to solve the issue. Instead for checking if the field is not
Hidden I checked whether it is not FromBaseType.
if(!field.FromBaseType)
Console.WriteLine("{0} - {1} - {2} - {3} - {4}",field.Title,field.InternalName,field.Hidden,field.CanBeDeleted,field.FieldTypeKind);
Algorithmen und Datenstrukturen in C#:
TechNet Wiki

Similar Messages

  • How to pass PO customer fields from ECC to SUS ?

    Hi Gurus,
    We defined a customer PO field at ECC side and want to pass it to SUS and diaplay it in SUS PO, my question is, how to pass PO customer fields from ECC to SUS?
    Please advise.
    Thanks and best regards
    jack

    Hi jackytam  ,
    /people/yeusheng.teo/blog/2008/01/05/ordering-unit-vs-order-pricing-unit-in-srm-sus
    you make get some pointers
    regards,
    Neelima

  • Display Custom Fields in a SharePoint 2010 Content Query Web Part?

    Using SharePoint 2010, Having Custom List With 4 Columns, Now I am Using Content Query Web-part To Display List Data ,But Currently It Display Only First Column, SO How to Display Custom Fields in a SharePoint 2010 Content By Query Web Part
    AKshay Nangare

    Hi,
    By default CQWP shows only one column. However, if you want to show more than one column, then CQWP needs to be customized. The property which you are looking for is CommonViewFields. It is used to specify the additional fields that you want to display in
    the Web Part. See this for more information:
    https://msdn.microsoft.com/en-us/library/ms497457%28v=office.14%29.aspx?f=255&MSPPError=-2147217396
    Blog | SharePoint Learnings CodePlex Tools |
    Export Version History To Excel |
    Autocomplete Lookup Field

  • How to share one custom field from FITE_VC_GENERAL_DATA to FITE_VC_REVIEW

    Hi FORUM
      I haved created one custom field in the FITE_VC_GENERAL_DATA by one Enhancement, to get this custom field in FITE_VC_REVIEW screen, i filled a z_table_tmp, but i´m not happy with this solution and i thinked that is not the best way. How can i pass this custom value to the FITE_VC_REVIEW with a correct solution ?.. maybe by general_data context structure ?
    Thnks
    Josué Cruz

    Josue Cruz wrote:
    > Hi FORUM
    >
    >   I haved created one custom field in the FITE_VC_GENERAL_DATA by one Enhancement, to get this custom field in FITE_VC_REVIEW screen, i filled a z_table_tmp, but i´m not happy with this solution and i thinked that is not the best way. How can i pass this custom value to the FITE_VC_REVIEW with a correct solution ?.. maybe by general_data context structure ?
    >
    > Thnks
    > Josué Cruz
    Hello Josué,
    the correct approach would be to add a common Web Dynpro Component Usage Relation to both the FITE_VC_GENERAL_DATA and FITE_VC_REVIEW Component. To the common  Z Web Dynpro Component you add a Interface Context which will be exposed to the FITE Components. The new field should be mapped to the new Interface Node of the Z Web Dynpro Component. As bothe FITE share now a common context, the field will be available.
    regards,
    Markus

  • Send data from a sharepoint 2010 list to a csv file

    How do I import a SharePoint 2010 List's data to a csv file using c# code or Powershell Script? 

    I am able to achieve this through:
    $MyWeb = Get-SPWeb "http://dev-apps:8800/applications/PA"
    $MyList = $MyWeb.Lists["Alist"]
    $exportlist = @()
    $Mylist.Items | foreach {
    $obj = New-Object PSObject -Property @{
    “PName” = $_["Port Name"]
    "AName" = $_["Agent Name"]
    "Address 1" = $_["Address 1"]
    "Address 2" = $_["Address 1"]
    "Address 3" = $_["Address 3"]
    "Address 4" = $_["Address 4"]
    $exportlist += $obj
    $exportlist | Export-Csv -path 'C:\Filename.csv'

  • How to Get a BLOB Field from JDBC Coding

    Hi,
    I have written the JDBC Code to get the field values from the Table.
    There is a BLOB field in that table.
    How to get the BLOB ? What is the return type we should use.
    If it is Varchar then we can use rs.getString().
    If it is BLOB then what is the return type?
    Thanks in Advance

    Blob.
    You know, people like you really give me the urge to print out several hundred pages of Java API and smack them on their heads.

  • How to get only column names from different tables as single table columns

    Hi All,
       I have one requirement in which we want only column names from different tables.
    for example :
     I have three tables T1 ,T2, T3 having
      col1 clo2 clo3 -->  T1 , 
      col3 col5 ,clo6 --> T2 ,
      Clo6 col8 col9 --> T3
    columns i want to get only all  Column names from all table as single Resultset not any data from that how can i get that empty resultset 
    because this empty result i want to bind in datagridview(front end) as Empty resultset 
    Please tell me anyways to do this
    Niraj Sevalkar

    If I understand you want an empty result set, just with metadata. SET FMTONLY do the trick:
    SET FMTONLY ON
    SELECT Col1, Col2, Col3, ....., Coln
    FROM
    T1 CROSS JOIN T2 CROSS JOIN T3
    SET FMTONLY OFF
    Another alternative is to include an imposible contition
    SELECT Col1, Col2, Col3, ....., Coln
    FROM
    T1 CROSS JOIN T2 CROSS JOIN T3
    WHERE 1 = 0
    If you are using a SqlDataAdapter in your client application. You can use the FillSchema method. the select command may be any select statement that returns the columns you want. Under the covers FillSchema will call SET FMTONLY ON.
    If you are using SqlCommand.ExecuteReader you can pass SchemaOnly to CommandBehavior argument. SET FMTONLY ON is called under the covers. Again the select command may be any select statement that returns the columns you want.
    "No darás tropezón ni desatino que no te haga adelantar camino" Bernardo Balbuena

  • How to map a custom field from EBAN to EKPO?

    Dear Experts.
    We have added a custom field to the EBAN table using include CI_EBANDB. When creating a Purchase Requisition, the field is filled with a value. How can we make sure that this value is transferred to the EKPO custom field at the moment that we create a Purchase Order out of this Purchase Requisition?
    Maybe this is possible by using enhancement MM06E005? Please advise how to do this?
    Best Regards,
    Tom
    will award points for good answers.

    But how can I implement this enhancement to achieve this? And how can I fetch the value from the purchase requisition?
    Regards,
    Tom

  • How to get the customer fields view in CRM 2007?

    HI Experts,
    There is a tab in CRM 4.0 for customer fields(Generated using EEWB).
    My question is how can we get these fields into WEB UI?
    I didn't find the Component BTCUSTOMER_H in CRM 2007.
    What might be the reason behind it?
    Please share your views.
    Thanks,
    Adi.

    Adi,
    You actually got pointed to the wrong blog that I wrote.  However if you read the following blog, it will show you how to do what you want to do:
    /people/stephen.johannes/blog/2008/01/25/crm-40-to-52-customerh-fields
    If you want to cheat, then apply latest support stack for CRM 2007 and the fields will be there.  The section 1.13.5 in the SP02 release notes explains that the nodes are now available in CRM 2007 SP02.
    Look at this thread on how to view the release notes:
    SAP CRM 2007 SP02: DOCUMENTATION RELEASED
    If you have any further questiosn let me know.
    Take care,
    Stephen

  • How to get only active records from MDM.

    Hi all,
      How can i get only the active records from MDM table.Now i am getting all the records in MDM table in my Master Report Iview.Only some of the records r active.can i get just the active records.If yes,how can i do that.
    regards
    kukku

    closing

  • Abap - how to get only 1 PO# from an specific material

    What I meant was : how to group same PO#s and show in the report that it is only one.
    Suppose I have:
    material#1            PO#1
                          PO#2
                          PO#3
                          PO#3
                          PO#3
                          PO#3
    material#2            PO#4
                          PO#5
    Now, I want to get:
    material#1            PO#1
                          PO#2
                          PO#3 (total of all PO#3s)
    material#2            PO#4
                          PO#5
    Any ideas?
    Thanks folks,
    Ol Pom.
    Message was edited by: Ol Pom

    U can use COLLECT statement to get the required.
    <b>Loop at itab.
      move itab-matnr to isum-matnr.
      move itab-po to isum-po.
      collect isum.
    endloop.
    isum has your required data and you can print that
    loop at isum.
    write : / isum-matnr, isum-po.
    endloop.</b>
    isum definition
    begin of isum occurs 100,
    matnr like mara-matnr,
    po like ekpo-ebeln,
    end of isum.
    Message was edited by: Anurag Bankley
    Message was edited by: Anurag Bankley

  • How to get only positive value from 0DEB_CRE_LC

    Hi to all,
    I am doing ageing for AR.(0FI_AR_4)
    In DSO or CUBE i need to diaply only positive value for 0DEB_CRE_LC accodring to every customer customer.
    only NET DEBIT VALUE should display.
    example1:
                                  0CREDIT_LC     0DEBIT_LC      0DEB_CRE_LC
    CUSTOMER1      100                      0.00                   100 -
    CUSTOMER1      0.00                200                   200
    CUSTOMER1      0.00                200                   200
                                                                                 total of 0DEB_CRE_LC =  300                    "  only this value should be displayed at DSO or CUBE
    example2:
                                0CREDIT_LC     0DEBIT_LC      0DEB_CRE_LC
    CUSTOMER2        100                       0                      100-
    CUSTOMER2        0                          0                      0
    CUSTOMER2       0                            0                     0
                                                                               total of 0DEB_CRE_LC =  100-                       " this value should be filter out at DSO or CUBE
    example3:
                              0CREDIT_LC     0DEBIT_LC      0DEB_CRE_LC
    CUSTOMER3      200                                           200-         
    CUSTOMER3     0                           100               100
                                                                            toatl  0f 0DEB_CRE_LC = 100-                       " this value should be filter out at DSO or CUBE level
    So when i total at 0DEB_CRE_LC at DSO or CUBE level  only example1 value should displayed and example2 and example3 sould be filter out at DSO or CUBE level.
    please can any one tell me the logic, what should i do to achieve this result.
    I shall be thankful to you for this.
    Regards
    Pavneet Rana
    Edited by: pavneet rana on Feb 3, 2011 4:14 PM
    Edited by: pavneet rana on Feb 3, 2011 4:18 PM
    Edited by: pavneet rana on Feb 3, 2011 4:20 PM

    Thanks for reply,
    i have created start routine between 0fi_ar_4 to DSO.
    and used your code.
    but still data at DSO is coming incorrect.
           CREDIT                    DEBIT              0DEB_CRE_LC
    C1   694,724.4               0.00     694,724.46-
    C1       675,000.0              0.00     675,000.00-
    C1        0.00                    864,333.00     864,333.00
                                                                TOTAL =   505,391.46-  for 0DEB_CRE_LC
    but i create end routine at DSO .
               CREDIT      DEBIT          0DEB_CRE_LC
    C1       0                  100               100
    C1       0                      50             50
                                                 TOTAL = 150 for 0DEB_CRE_LC
    but all credit amount for all customer is 0 and not include in 0DEB_CRE_LC, so still result is incorrect.
    Please give me some solution , so i can achieve result.
    I think this can be done by Routine itself.
    i have writen routine like that.
    DATA: WA LIKE LINE OF RESULT_PACKAGE.
    DATA: l_v_customer type /BI0/OICUSTOMER.
    DATA: l_v_total TYPE /BI0/OIDEB_CRE_LC.
        Sort RESULT_PACKAGE by CUSTOMER .
        l_v_total = 0.
         loop at RESULT_PACKAGE INTO WA.
        if sy-tabix = 1.
         l_v_customer = WA-CUSTOMER.
    endif.
    if l_v_customer = WA-CUSTOMER.
    l_v_total = l_v_total + wa-DEB_CRE_LC.
    else.
    if l_v_total LT '0'.
            Delete RESULT_PACKAGE where CUSTOMER = wa-CUSTOMER.
          endif.
    l_v_customer = wA-CUSTOMER.
    l_v_total = wa-DEB_CRE_LC.
    endif.
          endloop.
    please rectified is in correct.
    I shall be thankful to you for this.
    Regards
    Pavneet Rana
    Edited by: pavneet rana on Feb 4, 2011 10:32 AM

  • How to get users picture field displayed via _api/Web/Lists - SharePoint Online

    I have created a field of type Person or Group with "show field  picture only".
    When I look at the result I get back from the _api/web URL what I see is this as the field name:
        <d:OData__x0061_wo9Id m:type="Edm.Int32">25</d:OData__x0061_wo9Id>  
    I need to get the right properties like username,accontname etc..out and I think need to build this url below: 
        /_layouts/15/userphoto.aspx?size=M&accountname=name%40domain.com.au&url=https%3A%2F%2Fdomain-my.sharepoint.com%3A443%2FUser%2520Photos%2FProfile%2520Pictures%2Fusername_domain_com_au_MThumb.jpg
    to be able to get each users picture.
    Thanks in advance

    Hi,
    To get the UserName or AccountName of a Person or Group column, you can take the URL below for a try:
    siteUrl + "/_api/web/lists/getbytitle('" + listName + "')/items(" + itemId + ")?$select=Title,OData__x0050_G1/Name,OData__x0050_G1/UserName,OData__x0050_G1/Title&$expand=OData__x0050_G1/Name,OData__x0050_G1/UserName,OData__x0050_G1/Title"
    If you want to get the Picture URL of an user, you can send another request to User Information list:
    siteUrl + "/_api/web/siteUserInfoList/Items"
    Best regards,
    Patrick
    Patrick Liang
    TechNet Community Support

  • How to get log of Visual Upgrade in SharePoint 2010

    I want to retrieve detailed information on visual upgrade performed for a SP 2007 subsite to upgrade look & feel.
    Is there a way to find out info about who and when visual upgradation activity was performed?

    HI Ripon,
    here you are the path
    ..\Program Files\Common Files\Microsoft Shared\web server extensions\12\logs\upgrade_<date>.log
    Also check those links about upgrade
    http://sharepointpromag.com/migration/migrating-sharepoint-2010-21-jun-2010
    http://blogs.technet.com/b/patrick_heyde/archive/2010/08/23/sharepoint-upgrade-part1-overview-2007-to-2010.aspx
    http://technet.microsoft.com/en-us/magazine/ff770990.aspx
    Kind Regards, John Naguib Technical Consultant/Architect MCITP, MCPD, MCTS, MCT, TOGAF 9 Foundation

  • How to get multiple selected fields in list

    Hello all,
    I am trying to get multiple selected value from a list but i dont know how to get multiple selected fields from a list though AS3.
    Actually i want to pass the selected fields to php, so for that i need to get the selections and send to php.
    Thankx..

    i want to put the selected fields of list in an array through AS3....
    actually......i figured it out how to do that...........
    Its simple......use
    list.selectedItems[index]
    and to get the number of items selected......
    list.selectedItems.length
    simple.....

Maybe you are looking for

  • What is the best way to create CRUD datagrids

    What is the best way to create CRUD datagrids that tell CF components to update sql tables. I find that I'm having to vreate all these columns with custom properites and its a bit of a chore: <mx:DataGridColumn id = "NatWest" dataField="NatWest" head

  • Problem with OTN J2ME Extension and Viewlets sample

    The sample on the following OTN site http://otn.oracle.com/products/jdev/htdocs/partners/addins/exchange/j2me/index.html is not allowing me to run the Configure the Extension viewlet or any viewlet on this page. Does any sample that Oracle provides w

  • Artists not appearing on my ipod

    Any idea why parts of my library can only be found on my ipod classic 80gb by song title and album, but not by artist? The song information correctly displays on my itunes library on my computer, but when it syncs to the ipod sometimes the artist won

  • Can  we have drag and drop functionality in xcelsius

    hi, i want to know wheather we can give adding and removing columns functionality to the user like we can give in the dash board created in wad.because most users want to analyse in their own way along with the standard one we show initially. can any

  • Oracle Virtual Box Manager

    Starting VM box manager for the first time requires to choose 'Installation Media' and the choice by default is D drive. What CD I am suppose to use in the D drive? Is the the guest operating system cd? If my host OS is same as guest OS, then shall I