Retrieve Wiki WebPart ID Property through CSOM

I currently have a wiki page with content as well as several script editor web parts spaced throughout. I am attempting to get all content from the wiki page in order throught the SharePoint CSOM. When grabbing the WikiField content I can see where each
of the script editor web parts are placed because they have a DIV element with a GUID
<div class="ms-rtestate-read ms-rte-wpbox" contenteditable="false">
<div class="ms-rtestate-notify ms-rtestate-read 62f32861-7a85-489b-b92f-1784d7e758c9" id="div_62f32861-7a85-489b-b92f-1784d7e758c9" unselectable="on">
</div>
<div id="vid_62f32861-7a85-489b-b92f-1784d7e758c9" unselectable="on" style="display: none;">
</div>
</div>
The problem is that the GUID in the WikiField content is the web part id property while it seems that I can only retrieve the WebPartDefinition ID through CSOM, which is different. I need to find a way to match up the GUID in the WikiField content with the
GUID in the WebPartDefinition WebPart so that I can grab the content from the manager and place it in the correct spot on the wiki page. There doesn't seem to be a WebPartDefinition.WebPart.ID property in the SharePoint CSOM.
So far my code is:
Public Function GetWiki(ByVal pSPSite As String, ByVal pLibraryName As String, ByVal pItemId As Int32) As Boolean
Dim context As New ClientContext(pSPSite)
Dim WikiLibrary As List = context.Web.Lists.GetByTitle(pLibraryName)
Dim listItem As ListItem = WikiLibrary.GetItemById(pItemId)
Dim wikiPage As File = listItem.File
Try
context.Load(wikiPage)
context.Load(listItem)
context.ExecuteQuery()
Dim WikiContent As String = listItem("WikiField")
Dim wpm As LimitedWebPartManager = wikiPage.GetLimitedWebPartManager(PersonalizationScope.Shared)
context.Load(wpm.WebParts, Function(wps) wps.Include(Function(wp) wp.WebPart.Properties, Function(wp) wp.Id))
context.ExecuteQuery()
'Retrieve Script Web Parts added to Wiki Page
For Each wpd As WebPartDefinition In wpm.WebParts
Dim wpContent As String = wpd.WebPart.Properties("Content")
Dim wpTitle As String = wpd.WebPart.Properties("Title")
Next
Return True
Catch ex As Exception
Return False
End Try
End Function

Hi,
The Microsoft.SharePoint.Client.WebParts.WebPart class does not contain the ID property.
http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.client.webparts.webpart_members(v=office.15).aspx
We can use WebPartPages.asmx and GetWebPartProperties2 to get the WebPart GUID.
http://msdn.microsoft.com/en-us/library/websvcwebpartpages.webpartpageswebservice(v=office.15).aspx
Best Regards
Dennis Guo
TechNet Community Support

Similar Messages

  • How to create dashboard through CSOM to show workflow from external lists

    We have following requirement.
    SharePoint 2013 standard edition environment is installed. SO no BI site template is possible.
    Development has to be through CSOM only.
    Vendor data is stored in external database in SQL server 2012.
    There are number of workflow running for external lists.
    Now the question is how can we create a dashboard through CSOM to show status of various workflows? How to develop through CSOM?
    Thanks in advance for help.

    Hello ,
    You can use below libraries for creating charts in sharepoint 2013 . 
    https://github.com/CardinalNow/ChartsInSharePoint2013
    or 
    http://modeln.github.io/sDashboard/
    ex. http://msdn.microsoft.com/en-us/library/office/dn481315(v=office.15).aspx
    I have used sDashboard This is really good . 
    Best
    Regards Kuldeep Verma
    Please remember to click "Mark As Answer" if a post solves your
    problem or "Vote As Helpful" if it was useful.  
    here requirement is totally different as CSOM and ext database, workflow and dash board together. actual answer is different.

  • Retrieve Data from the Webservice through Data connection in Adobe Form

    hi
                                            i done Student ejb application
    i.e, Create,Update,Retrieve,Delete operation. I create the WebServices to these operations. Present  i connect the webservice through data connection . create operation is done successfully, but i dont know how to retrieve the the student details through data connection. how i can bind the retrieve values to the table in adobe form .how to bind from webservices to adobe form without context node.

    I had the same problem in SAP B1 2007. Report worked fine except when it was open from B1. Generally there may be different problems. In my case the same problem was caused by using some procedure which was in a specific schema. Changing the schema into "dbo" solved the problem.
    Radoslaw Blaniarz

  • Need a way to retrieve list of all tables through a RFM

    I wish to retrieve list of all tables through a RFM.
    I know the table DD02L contains a list of all other tables. I can call the RFM RFC_READ_TABLE with table name DD02L or DD03L as an input parameter. I do not wish to do this way as the table name DD02L might get changed in a future release of SAP and break my external C program.
    The question is - is there any other RFM that would return the list of tables and their properties. Does SWO_QUERY_OBJTYPES or some other SWO_QUERY_* RFMs can be used?
    Any useful info is appreciated.
    Thanks

    Thanks Ramiro.
    If I relay on TFDIR table to get a list of function modules, what are the chances that SAP will rename or get rid of TFDIR in a future release of SAP? I wish to avoid using undocumented interfaces as do not want to change my program in the future.

  • Urgent please: lost all datas while sync my new iPhone. how can i retrieve my old datas? through icloud?

    urgent please: I have a new iphone 4S and while sync with itunes, it was not done using the data of my old iphone but with a new virgin iphone. how can I retrieve and sync with my old datas? through icloud? or have I lost everything? please help

    to be more precise
    I have saved all my datas of my old iphone on itunes and icloud. I got a new phone 4s that I connected to itunes in order to load it and sync with my old datas. but I don't konw how but when itunes sync my new iphone i did not take my old datas. at the end of the sync process, I got an iphone totally virgin, but none of my previous apps, neither contact neither calendar neither anything. what happened? did itunes erased all my previous datas?? i hope not but if it's the case, can I recuperate my old datas through icloud? please help because as a lot of us, all my life is in this iphone.. (contacts, photos of my 18months girl, etc etc)
    thank you very much

  • Access of undefined method/property through reference with a static type Class

    I get the following error: (it's not word for word but you get the idea)
    Error: Access of undefined method getStatus through reference with a static type Class.
    Here's what's happening in the code. I'm trying to create a User class that is instantiated at the start of my app. I want the User class to have properties like mainStatus, with helper methods like setStatus etc. Pretty simple.
    so on my HardDisk I have my flash_working folder with all my flash projects. I created my class file/package under the directory com.mypackage
    package com.mypackage
        import flash.display.*;
        public class User extends Sprite
            public var mainStatus:int;
            public function User()
                trace("User Created!");
                mainStatus = 0;
            public function setStatus(status:int):void
             mainStatus = status;
        public function getStatus():int
            return mainStatus;
    Ok, so far so good.
    now I created a new .fla file under the root of /flash_working/. The class file is in /com/mypackage/User.as
    in my .fla file I have:
    import com.mypackage.User;
    var myUser:User = new User();
    var i = User.getStatus();
    trace(i);
    That's all the code I have. Could someone please explain why it's giving me that error?
    If I try to access the public var mainStatus through user.mainStatus that gives a similar error saying:
    Error: Access of undefined property mainStatus through reference with a static type Class.
    Thanks for any help!
    jef3189

    the public getStatus() function that you created needs to be referred to through an instance of the class.
    So:
    import com.mypackage.User;
    var myUser:User = new User();
    var i = myUser.getStatus();
    trace(i);
    Also, an aside. You can create a getter/setter for status, to avoid having to do the function as such.
    package com.mypackage
        import flash.display.*;
        public class User extends Sprite
            public var mainStatus:int;
            public function get status():int
                return mainStatus;
            public function set status(value:int):void
                 mainStatus = value as int;
              public function User()
                trace("User Created!");
                mainStatus = 0;
    And then, you can call it as:
    import com.mypackage.User;
    var myUser:User = new User();
    trace(myUser.status);
    EDIT
    I just noticed that you made the variable public as well, which means you can access it without getter/setter or function.
    import com.mypackage.User;
    var myUser:User = new User();
    trace(myUser.mainStatus);

  • Managing a custom property through the console

    I'd like to create a boolean property that I mange through the console. It is
    basically a timing mechanism that I need to be able to turn on and off without
    recompiling or restarting the WLS server. I've done some looking at the documentation,
    but I can't see where I could create my own custom property...
    We are using 5.1 right now and plan to migrate to 6.0 within the next month.

    The user names are stored in table USR01. IN that table see if you can add a field to have region. Extract this table and store it in User info object in BW.
    You will need a ABAP person to do this, if you are new to SAP.
    Ravi Thothadri

  • Managing Query Suggestions through CSOM (C#) or PowerShell for Sharepoint Online.

    Hello everybody.
    I am currently working with Sharepoint Online search and am trying to find information about managing Query suggestions (CRUD operations).
    Would anybody have any information as to how I could do this in CSOM or PowerShell ? I truely am having a hard time on this.

    Hi,
    Please check below. This should help you. You can REST APIs
    Retrieving query suggestions using the Search REST service
    https://msdn.microsoft.com/en-us/library/office/dn194079.aspx
    Please remember to click 'Mark as Answer' on the answer if it helps you

  • Writing modified date of a document library item through CSOM.

    I´m working on an application which is replicating files from one document library to another. Since it is a replication, I want the modified date to be preserved when I copy the file from the source library to the target, so that the user will see the real
    modified date in the target library and not the date of the replication run.
    I access SharePoint through the client side object model and I have been able to set the modified date on a SharePoint 2010 on-premise using the following straght-forward code:
    var listItem = list.GetItemById(id);
    context.Load(listItem);
    context.ExecuteQuery();
    listItem["Modified"] = "03/11/1999";
    listItem.Update();
    context.ExecuteQuery();
    Unfortunately when I execute the same code on any other SharePoint (2013 On-Premise, 2013 Online or 2010 Online) the code will execute without any errors, but the modified date will not be changed at all.
    My actual question is: Is there any possibility to change the modified date throught CSOM on all of these SharePoint-versions?

    I got a work around for this problem..
    Before updating the Modified, Modified By values, First we need to Disable the version settings for document library. Once the fields updated then again we need to enable the version settings. 
    find the updated code below..
                                          //Disable Version settings for DOC LIB
    before update Metadata
                                            _List.EnableVersioning
    = false;
                                            _List.Update();
                                            _cContext.ExecuteQuery();
                                           ListItem item = newFile.ListItemAllFields;
                                           _cContext.Load(item);
                                            //Updating Metadata Created,
    CreatedBy, Modified, Modified By
                                             item["Created"]
    = "8/10/2013 7:04 PM";
                                             item["Author"] = CreatedUserValue;
                                             item["Modified"] = "8/10/2013 7:04 PM";
                                             item["Editor"] = ModifiedUserValue;
                                             item.Update();
                                            _cContext.ExecuteQuery();
                                            //Enable Version settings
    for DOC LIB after update Metadata
                                               _List.EnableVersioning
    = true;
                                              _List.Update();
                                            _cContext.ExecuteQuery();
    Rajendra

  • Is it possible to change Allowed Values (csv) in a property through an API?

    Hi everyone
    I would like to enable end users to change the Allowed Values (csv) in a property without giving them access to the system administration > system configuration part of the portal. Actually I would like to create a simple iview which could show the list from the Allowed Values (csv) entry of a specific property and let certain users maintain the values from that iview instead of through system administration.
    Do any of you know if its possible to develop this in some way? We have not been able to identify possible ways to change the Allowed Values (csv) entry through the KM API.
    Any help will be awarded.
    Best regards,
    Martin Søgaard

    Hi Martin,
    This is possible..
    try out below code..
    public void onActionUpdateProperty(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
        //@@begin onActionUpdateProperty(ServerEvent)
         String strPropName =  wdContext.currentContextElement().getPropertyName();
         String strCurrentProp =  wdContext.currentContextElement().getCurrentProp();
         String strSelectedProp =  wdContext.currentContextElement().getSelectedProp();
         String namespace = "";
         boolean isNotSaved = false;
         //isPropertySaved = true;
         com.sapportals.wcm.service.propertyconfig.IMetaModel metaModel = null;
              //     IPropertyConfigurationService configService=null;
                   IMutableConfigurable imConf = null;
                        try
                             IConfigurationAccess icAccess = Configuration.getInstance();
                             IWDClientUser wdcu = WDClientUser.getCurrentUser();
                             com.sap.security.api.IUser sapUser = wdcu.getSAPUser();
                             IUser user = WPUMFactory.getUserFactory().getEP5User(sapUser);
                             IConfigClientContext confContext = IConfigClientContext.createContext(user);
                             IConfigManager icManager = icAccess.getConfigManager(confContext);
                             IConfigPlugin icPlugin = icManager.getConfigPlugin(ConfigurationProxy.CFG_PLUGIN_CM_SERVICES_PROPERTIES_METADATA);
                             IMutableConfigurable[] mcs = icPlugin.getConfigurables();
                             String propertyUniqueID = "";
                             String propertyNameSpace = "";
                             for (int i = 0; i < mcs.length; i++) {
                               IMutableConfigurable mc = mcs<i>;
                               if (mc.getPropertyValue("property_id").equals(strSelectedProp)) {
                                  propertyUniqueID = mc.getPropertyValue("unique_id");
                                  break;
                             try {
                                  imConf = icPlugin.getAndLockConfigurable(propertyUniqueID, 0, 0);
                                  imConf.setPropertyValue("values",<b>strCurrentProp</b>);
                             } catch (RuntimeException e1) {
                                       e1.printStackTrace();
                             icPlugin.replaceConfigurable(imConf);
                        catch (Exception e)
                             wdComponentAPI.getMessageManager().reportException(e.getLocalizedMessage(), false);
                        finally
                             if (imConf != null)
                                  try
                                       imConf.unlock();
                                  catch (LockConfigException e)
                                       wdComponentAPI.getMessageManager().reportException(e.getLocalizedMessage(), false);
        //@@end
    strCurrentProp is the value that is being set.
    Regards,
    Vikas

  • Error when retrieve resource by the property contentlink

    We are facing problems to retreive an resource by the property "contentlink", for example:
    We have an resource in the wpccontent repository, and your property "contentlink" has this value /irj/servlet/prt/portal/prtroot/docs/guid/3062f0a0-a97e-2c10-19ac-bcc642332ee1. When try to retrieve the resource, we received an Rerource404Exception error.
    But when we replace the value in the address bar of web browser from /guid... by the value of  property "shortID", that contains the value /guid/a05daa5e-a18a-2c10-14bf-cd2506ea3c94, the resource is displayed normaly.
    The property "contentlink" can be with wrong values? Can anybody tell me why this happen?
    Note: This error happen with any kind of resource, but not with all resources. The error occurs with some resources only. And the folder does not have versioning enabled.
    Thanks & regards,
    Raphael

    Hi Shushmakad,
    If you set Preserve Sequence Property=true. BizTalk will always expect source node will be in sequence, but you have option to change sequence of destination schema by updating xslt.
    Can you test your map with sample input message with sequence.  
    Debug xslt (use this url for reference) 
    http://msdn.microsoft.com/en-us/library/ms255602(v=vs.110).aspx
    Regards
    Suman

  • Introducing Custom Metadata property through a package

    Hi,
    I want to introduce a new custom metadata property for my assets which could be displayed in the DAM metadata UI of an asset as below. I can see some steps mentioned to do this in http://dev.day.com/docs/en/cq/current/dam/how_to_edit_metadata.html. However I want to do this through a package that I am developing. Hence whenever my package is installed in CQ some custome metadata properties must be automatically regisitered for all assets.
    To summarize I have following queries:
    How to create/register custome metadata proerties for assets in a package using CQ APIs ?
    Once a custome metadata prperty is registered how to update its value using Asset API ?
    Appreciate any help here!

    Check http://www.wemblog.com/2013/01/how-to-associate-cug-with-dam-asset-in.html is that helps.
    Yogesh

  • Assigning property through rule files

    Hi All,
    a) Could anyone please explain me how can we assign properties of members through rule files while building the dimension. Suppose we want to assign the property store data or dynamic calc to any member then how we will do it through rule files.
    b) What is the maxl command to refresh the database?
    Thanks

    John,
    Thanx ur blog was very helpful. I am facing a problem while loading a dimension which has attributes e.g. Product is my dimension which has attributes like Caffeinated- boolean, ounces- numeric, pkg type- text and Intro date- date.
    I get errors like-
    1)Intro Date_04-01-1996: The attribute member name does not match the setting for the type of attribute. Date attribute members should be specified in xx-xx-yyyy format................... and.............
    2) Ounces_12: The attribute member name does not match the setting for the type of attribute. Date attribute members should be specified in xx-xx-yyyy format.
    Im new to Hyperion Essbase...any help wld be highly appreciated.

  • Setting editingMode (table's property) through a button pressing

    Hello ereryone.
    I'm using jDev 11.1.2.3
    I have an af:table and set editingMode=clickToEdit.
    It would be nice if there were a button before the table that actually controls that property. So, the user selects one row and then presses the button and the code in there sets the editingMode to clickToEdit and makes the record editable.
    The problem is that I don't have a clue how to do this! How the code should be like.
    Can anyone provide with a tip, a use case... etc ?
    Your input is highly appreciated.
    ~apostolos

    Anything? please...

  • Setting the Varinace Reporting Property Through Load Rule

    Hi,
    I have built a Dimension build rule to build the accounts dimension(Parent Child) and also the Properties like "Data Stroage" and "variance reporting Expense" and also UDA.The dimension is getting build perfectly and also the "data Storage" property and UDA but the "Varinace reporting property" is not set even though the load rule is perfect and also i see the success message while loading.
    I reviwed the Member Property Codes and it is given as
    E      Treat as an expense item (applies to accounts dimensions only)
    and i am using the same.
    the build rule is as follows:
    Parent0 Accounts,Child0 Accounts,Alias0 Accounts,Property0 Accounts,UDA0 Accounts,Property1 Accounts.
    i know i am missing some thing,kinldy advice.
    Thanks,
    Mugundh

    Hi,
    I just now reviewed and fixed the issue.First i changed the the file to Property0 accounts and secondly in the Global Properties i have to select the case as "Original".after doing the changes i saved the rule and loaded the file.The Variance reporting Property is perfect.
    Thanks for the help.
    Thanks,
    Mugundh

Maybe you are looking for

  • Hot Synch Log not logging

    The other day, my computer crashed during a Hot Sync operation.  The log recorded that the operation had been aborted.  Since then, I have Hot Synch'd several times, and it works fine; however, the log is no longer logging.  It still displays the las

  • Posting Error - While Posting Payroll

    Hi Gurus, While posting payroll document, system is asking for GL Account, but when we assign HR Clearing Account in "Assign Technical Accounts", then system gives error that business area is missing line item 001 because document splitting is activa

  • In Mail, how do I add an attachment as an icon?

    On right-click there used to be an option to display attachment as an icon. It's gone!

  • Problems with Elisa Media Center (images quality)

    Hi I decided to install Elisa Media Center on my laptop. Everything works just fine, but only images from photo gallery are very ugly (I mean ragged). Don't know why, but when I play slideshow all of my photos, all of them are really bad looking. Jus

  • Cost per mile report

    Hi I am new to the logistics module and have just started  learning the PM and CS modules. I was just trying to figure out a query raied by one of the clients regarding a report which will generate the "cost per mile". Actually the client wants to ca