How to access SharePoint External Data column using Silverlight Client Object Model

Hi Friends,
I have one sharepoint list which has column of type External Data type. My need is to access each item and get the values from the External Data Type column field.
Can anyone help me how to acheive this. I am begineer in Silverlight.
Thanks, Cool Developer

Hi Friends,
I have one sharepoint list which has column of type External Data type. My need is to access each item and get the values from the External Data Type column field.
Can anyone help me how to acheive this. I am begineer in Silverlight.
Thanks,
RajanThanks, Cool Developer

Similar Messages

  • Get current loggedin user using silverlight client object model SharePoint 2010?

    Hello,
    How can i get the current loged in user of sharepoint 2010 in silverlight4.XX  version by programtically in C#?
    Thanks
    Lovkesh Patel

    Hi,
    ClientContext clientContext = ClientContext.Current;
    clientContext.Load(clientContext.Web, s => s.CurrentUser);
    clientContext.ExecuteQueryAsync((sender, args) => {
    var currentUser = clientContext.Web.CurrentUser; }, null);
    For more information:
    http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.client.web.currentuser.aspx and
    http://stackoverflow.com/questions/3441794/retrieve-current-user-login-in-sharepoint-from-a-silverlight-application
    Hope this helps you
    Senior Sharepoint Developer,STS [email protected]

  • SharePoint 2013 implement simple logout button which do not redirect to default sign out page using JavaScript client object model

    I am using windows authentication in my web application.
    My requirement is to implement a sign out button which will sign out the user without having him to close the browser and application should not ask him to login again.
    I tried following two options:
     1. Redirecting the user to default signout.aspx page " /_layouts/15/SignOut.aspx "
     2. Using "Sign In as a different user" URL " /_layouts/15/closeConnection.aspx?loginasanotheruser=true "
    In first case, user is redirected to default sign out page but he can press "Go Back to Site" link to revisit the site. Another major issue is that the user has to close the browser to sign out from the application completely, which is not desirable
    in my project requirement.
    In second case, the the current user is signed out of the application but if the user has saved the password in browser, he gets signed in automatically to the application.
    I also came across the solution where we replace the default sign out page with a custom sign out page, but I am not sure whether it can be implemented using JavaScript Client Object Model of SharePoint.

    Hi 
    I'm basically looking for the exact answer for the query.
    Meanwhile you need to go through the link mentioned below in order to understand how to do it.
    Debugging and Logging Capabilities in SharePoint 2010
    Indul Hassan
    Microsoft Community Contributor
    http://www.indulhassan.com
    You Snooze.. You Lose !!

  • Cannot download master page using managed client object model SharePoint 2010

    string siteUrl = "http://server:port/sites/demo";
    string fileServerRelativeUrl = @"/sites/demo/_catalogs/masterpage/v4.master";
    using (ClientContext context = new ClientContext(siteUrl)){ FileInformation fileInfo = Microsoft.SharePoint.Client.File.OpenBinaryDirect(context, fileServerRelativeUrl);}
    File.OpenBinaryDirect() throws "The remote server returned an error: (404) Not Found" error. while Microsoft.SharePoint.Client.File f1 = web.GetFileByServerRelativeUrl(fileUrl);
                    context.Load(f1);
                    context.ExecuteQuery();this gives the file object.File.OpenBinaryDirect() works if I pass "/sites/demo/_catalogs/masterpage/TabViewPageLayout.aspx" as fileServerRelativeUrl.Both the files are present in Master Page Gallery.File.OpenBinaryDirect() doesn't work if I pass any of ".master" file in the master page galleryPlease let me know whether downloading the master pages is supported using managed Client object model. 

    Hi,
    If don't change the default config, We are unble to download master page.
    It's better to create your own (perhaps based on the default.master) and use that master page.
    also,make sure there's no a permission issue on the website.
    Thanks
    Guangchao chen
    TechNet Community Support

  • Error in Application.Run(DisplayLoginForm) and Remote Authentication in SharePoint Online Using the Client Object Model

    Hi guys
    I Think that is a simple error, but I don’t have enough knowledge in .NET apps.
    I make an console app that use Remote Authentication in SharePoint Online Using the Client Object Model, that a I downloaded from MSDN.
    This App run ok.
    But when I like to make a Windows From App. This component send me an error in Application.Run(DisplayLoginForm)
    This err msg :
     An unhandled exception of type 'System.InvalidOperationException' occurred in System.Windows.Forms.dll
    Additional information: Starting a second message loop on a single thread is not a valid operation. Use Form.ShowDialog instead.
    Is there any way to use a form inside a windows form?
    Thank in advance
    Ramiro
    Ramiro B

    Hi,
    Based on the error message, please do as following:
    1. Check your code logic below:
    void btn_Click(object sender, System.EventArgs e)
    Thread t = new Thread(StartMyForm);
    t.TrySetApartmentState(ApartmentState.STA);
    t.Start();
    public static void StartMyForm()
    Application.Run(new MyForm(..));
    2.Try to add the following code line in your code.
    Application.Restart();
    If the issue still exists, please provide your requirement and code for a further research.
    Best Regards
    Dennis Guo
    TechNet Community Support

  • Add multiple people using Javascript Client Object Model

    I am trying to add multiple people to a SP column of type Person/Group i.e. people picker. I am able
    to add one successfully using their userId, but HAVE no clue how to do that for multiple people. Here is the code for one user:
    function UserDrop(e, toElement, listGuid, columnName) {
    //EcmaScript Client Object Model
    var ctx = new SP.ClientContext.get_current();
    var list = ctx.get_web().get_lists().getById(listGuid);
    var item = list.getItemById(elementId);
    //columnName is of type person/group and I am adding user //whose userId is 7
    item.set_item(columnName, 7);
    item.update();
    // asynchronous call
    ctx.executeQueryAsync(
    function () { toElement.innerHTML = userLinkHtml; },
    function () {alert ("Error")}
    return false;
    This works great and I can add user whose userId is 7, however I want to add multiple people like let's say users of user Ids 7 and 8. 
    Any ideas or help will be greatly appreciated. 
    There is a thread on this one but that's from .net COM which could accessed here: http://social.msdn.microsoft.com/Forums/en-US/sharepoint2010general/thread/5183e87c-ee1d-4594-9492-0dfdf6616cce
    7929

    Hi ,
    Can somebody let me know how the same(assigning the array values to lookup value field) can be achieved with multi-select lookup value. SP.FieldLookUpValue do not have any such methods like fromUser. Please help. Please find my code block below
    clientContext = new SP.ClientContext.get_current();
    if (this.clientContext != undefined && clientContext != null) {
    var webSite = clientContext.get_web();
    oList = webSite.get_lists().getByTitle("Add New User");
    $.urlParam = function(name){
    var results = new RegExp('[\\?&]' + name + '=([^&#]*)').exec(window.location.href);
    return results[1] || 0;
    var itemid = parseInt($.urlParam('ID'));
    var item = oList.getItemById(itemid);
    var users = new Array();
    users.push(SP.FieldLookupValue.set_lookupId(1));
    users.push(SP.FieldLookupValue.set_lookupId(2));
    item.set_item('Responsibility', users);
    item.update();
    clientContext.executeQueryAsync(Function.createDelegate(this, this.success), Function.createDelegate(this, this.failed));
    also i cant use managed client object model.. so pls let me know how to achieve the same using javascript client object model
    Ranjani.R

  • CAML Query to get specific item in folder based on dropdown value using Javascript client object model

    Hi,
    I am using the Javascript Client object model.
    I have a custom list and a custom document library.
    Custom list contains 2 columns - dlName , dlValue
    The document library contains 2 folders - "folder1" ,  "folder2" and contains some images.
    The image name starts with the "dlValue" available in the custom list
    I am using a visual webpart and using javascript client object model.
    I am trying to achieve the below functionality:
    1) Load a dropdown with the custom list.
    2) set the image based on the value in dropdown.
    I have achieved the first option, I have set the dropdown, but not sure how to query the folder and set the image.
    Below is the code i have used so far:
    //In Visual webpart
    <select id="ddlTest" >
    </select>
    <br/>
    <div id="PreviewLayer">
    <img id="imgPlaceHolder" runat="server" alt="Image" title="imgPlaceHolder" src=" " />
    </div>
    // In Javascript file
    function RenderHtmlOnSuccess() {
    var ddlTest = this.document.getElementById("ddlTest");
    ddlTest.options.length = 0;
    var enumerator = this.customListItems.getEnumerator();
    while (enumerator.moveNext()) {
    var currentItem = enumerator.get_current();
    var dropdownValue = currentItem.get_item("dlValue");
    ddlTest.options[ddlTest.options.length] = new Option(currentItem.get_item("dlName"), dropdownValue);
    setImage(dropdownValue); // Not sure how to query the folder and set the image based on value.
    // Also if dropdown value is changed, corresponding image should be shown
    How to query the folder and based on dropdown value, show the image? Also, how to handle the dropdown value change?
    Thanks

    Hi,
    Here are two links for your reference:
    Example of how to Get Files from a Folder using Ecmascript \ Javascript client object model in SharePoint 2010
    http://sharepointmantra.wordpress.com/2013/10/19/example-of-how-to-get-files-from-a-folder-using-ecmascript-javascript-client-object-model-in-sharepoint-2010/
    SP2010 JSOM Client Object Model: How to get all documents in libraries including all folders recursively
    http://sharepoint.stackexchange.com/questions/70185/sp2010-jsom-client-object-model-how-to-get-all-documents-in-libraries-including
    In SharePoint 2013, we can also use REST API to achieve it.
    http://msdn.microsoft.com/en-us/magazine/dn198245.aspx
    Thanks,
    Dennis Guo
    TechNet Community 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]
    Dennis Guo
    TechNet Community Support

  • Add attachments to List Item using JavaScript Client object model in SP2010

    Hi All ,
    I have created custom form for submitng data in list using javascript client object model/jquery .
    Now I want to add option to uplaod multiple attachments to that list item also .
    Is there option with client object model for uplaoding attachment.
    Thanks
    M
    Manesh G

    Can you try this and let me know
    using (SPSite _site = new SPSite(SPContext.Current.Site.Url))
        using (SPWeb _web = _site.OpenWeb())
         //Let's suppose your Item Id is 1
         int ItemId = 1;
         SPList  oList = _web.Lists["EmployeeList"];
         SPListItem  _item = oList.GetItemById(ItemId);
         if (FileUpload1.HasFile)
               _web.AllowUnsafeUpdates = true;
              Stream fs = FileUpload1.PostedFile.InputStream;
              byte[] _bytes = new byte[fs.Length];
              fs.Position= 0;
              fs.Read(_bytes, 0, (int)fs.Length);
              fs.Close();
              fs.Dispose();
              _item.Attachments.Add(FileUpload1.PostedFile.FileName, _bytes);
              _item.Update();
              _web.AllowUnsafeUpdates = false;

  • Read versions of comments field using javascript client object model

    Hi,
     Does someone knows how to Read versions  of comments field in 'tasks' list using javascript client object model?
    Thanks
    Manvir

    Hi,
    According to your description, I know you want to read versions of comments field.
    We can use the
    SPServices to achieve it. The below code for your reference:
    $().SPServices({
    operation: "GetVersionCollection",
    async: false,
    strlistID: "tester",
    strlistItemID: 1,
    strFieldName: "comments",
    completefunc: function (xData, Status) {
    $(xData.responseText).find("Version").each(function(i) {
    console.log("Name: " + $(this).attr("Information") + " Modified: " + $(this).attr("Modified"));
    More information:
    http://spservices.codeplex.com/releases/view/81401
    Best Regards,
    Dennis Guo

  • Get current item id using JavaScript Client Object Model

    I have a client query that query SharePoint list Items. Lets say it is a document library. I need to get the list item id of each. 
    I can query the Title of the document using this syntax.
    ctx.CurrentItem['Title']
    But when I try 
    ctx.CurrentItem['ID']
    for list item ID, it does not give a value. How can I solve this?

    Hi Malin,
    If you're using the JavaScript Client Object Model, try using the SPListItem.get_item('key') method as in the example below:
    <script>
    ExecuteOrDelayUntilScriptLoaded(function(){
    var arrIds = [];
    var clientContext = new SP.ClientContext();
    var camlQuery = new SP.CamlQuery();
    camlQuery.set_viewXml('<View><Query></Query></View>');
    var items = clientContext.get_web().get_lists().getByTitle("Your List Title Here").getItems(camlQuery);
    clientContext.load(items);
    clientContext.executeQueryAsync(Function.createDelegate(this,function(){
    var itemEnumerator = items.getEnumerator();
    while(itemEnumerator.moveNext()){
    var itemId = itemEnumerator.get_current().get_item('ID');
    arrIds.push(itemId);
    alert(arrIds);
    }), Function.createDelegate(this, function(){
    alert("something went wrong");
    },"SP.js");
    </script>

  • How to update actual assignments in project server 2013 client object model

    hi sir ,
    I try to update actual assignment using client object model 2013.. but i am not able to do it and hoe to use statusing assignment in csom model of 2013.
    vijay

    Hi,
    Basically ProjectOnline CSOM authentication is the same as SharePoint (or Office365) so you will want to review the TechNet info on that:
    Three authorization systems for apps for SharePoint 2013
    Depending on your App type and specific requirements.
    If however you want to do something like Delegation of a specific Project Online user (as you could in the past), then you're out of luck as that is not supported in the client object model.
    HTH,
    Martin Laukkanen
    Nearbaseline blog - nearbaseline.com/blog
    Bulk Edit and other Apps - nearbaseline.com/apps

  • How to access sharepoint List Data in Power Pivot model

    Hi,
    I have a sharepoint list and i want to access the list in power pivot workbook.
    I tryed exporting the list as datafeed but iam that is missing under export.
    Iam stuck pls help any other approach.?
    Regards,
    Krishnaa

    Hello,
    I have answered this question in this thread below:
    http://social.technet.microsoft.com/Forums/office/en-US/92a04e1b-a5f7-4dbe-88e7-0a1064622641/sharepoint-list-access-in-power-pivot?forum=sqlkjpowerpointforsharepoint
    Please go through the following aticles:
    Using SharePoint List Data in PowerPivot:
    http://msdn.microsoft.com/en-us/library/hh230322.aspx
    Using a SharePoint List as a data source:
    http://blogs.technet.com/b/excel_services__powerpivot_for_sharepoint_support_blog/archive/2013/07/11/excel-services-using-a-sharepoint-list-as-a-data-source.aspx
    Regards,
    Elvis Long
    TechNet Community Support

  • How to access variable number of columns using ref cursor !

    Hi,
    I am trying to get variable number of columns using ref cursor.
    Declare
    mySzSql varchar2(2000);
    Type dynSqlRC is Ref cursor;
    current_cur dynSqlRC;
    tbl_rec alt_42_consolidated%Rowtype;
    Begin:
    /* This works */
    mySzSql := 'select *
    from
    Table1
    Where
    rowid = ''AAEWNEABXAAAAkxAAA''';
    /* i want something like this to work, this is not working, giving missing variable name error */
    mySzSql := 'select col1, col2, col3
    from
    Table1
    Where
    rowid = ''AAEWNEABXAAAAkxAAA''';
    open current_cur for mySzSql;
    fetch current_cur into tbl_rec;
    close current_cur;
    End;
    I do have the list of desired columns which I am looking to fetch, so after taking that in the record type, how should i get their values. Is it possible to traverse tbl_rec declared above and if column name matches then I will store the value in the array and finally return this array.
    Can somebody please tell me how to do this.
    Thanks

    It appears that this is a followup to How to loop through columns selected by select clause which is itself a followup to [url="
    How to execute dynamic sql"]this earlier thread.
    Assuming these are intended to be followup questions, can we please stick to a single thread? That makes it a lot easier to understand the situation and follow the conversation. Starting multiple threads makes it harder to follow the conversation.
    Thanks,
    Justin
    Distributed Database Consulting, Inc.
    http://www.ddbcinc.com/askDDBC

  • How I can send emails using the client object model?

    I have tried this, but I always get an exception with error message "A recipient must be specified.":
    string webUrl = "http://sharepoint.example.com/";
    EmailProperties properties = new EmailProperties();
    properties.To = new string[] { "[email protected]" };
    properties.Subject = "Test subject";
    properties.Body = "Test body";
    ClientContext context = new ClientContext(webUrl);
    Utility.SendEmail(context, properties);
    context.ExecuteQuery(); // ServerException thrown here
    context.Dispose();
    Server stack trace:
    at System.Net.Mail.SmtpClient.Send(MailMessage message)
    at Microsoft.SharePoint.Utilities.SPUtility.SendEmail_Client(EmailProperties properties)
    at Microsoft.SharePoint.ServerStub.Utilities.SPUtilityServerStub.InvokeStaticMethod(String methodName, XmlNodeList xmlargs, ProxyContext proxyContext, Boolean& isVoid)
    at Microsoft.SharePoint.Client.ServerStub.InvokeStaticMethodWithMonitoredScope(String methodName, XmlNodeList args, ProxyContext proxyContext, Boolean& isVoid)
    at Microsoft.SharePoint.Client.ClientMethodsProcessor.InvokeStaticMethod(String typeId, String methodName, XmlNodeList xmlargs, Boolean& isVoid)
    at Microsoft.SharePoint.Client.ClientMethodsProcessor.ProcessStaticMethod(XmlElement xe)
    at Microsoft.SharePoint.Client.ClientMethodsProcessor.ProcessOne(XmlElement xe)
    at Microsoft.SharePoint.Client.ClientMethodsProcessor.ProcessStatements(XmlNode xe)
    at Microsoft.SharePoint.Client.ClientMethodsProcessor.Process()
    msdn link: http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.client.utilities.utility.sendemail.aspx

    hi
    if you will check the code of SendEmail_Client(EmailProperties properties), you will find that it may only send emails to internal users. May be it was made intentionally in order to prevent spamming from client code. So let's see:
    internal static void SendEmail_Client(EmailProperties properties)
    if (properties.To.Count == 0)
    throw new SPException(SPResource.GetString(web.LanguageCulture, "SendEmailInvalidRecipients", new object[0]));
    AddressReader func = null;
    using (MailMessage mm = new MailMessage())
    func = delegate (MailAddress a) {
    mm.To.Add(a);
    ResolveAddressesForEmail(web, properties.To, func);
    new SmtpClient(SPAdministrationWebApplication.Local.OutboundMailServiceInstance.Server.Address).Send(mm);
    I.e. it adds recipient in ResolveAddressesForEmail() method. Now let's check this method:
    private static void ResolveAddressesForEmail(SPWeb web, IEnumerable<string> addresses, AddressReader func)
    if (addresses != null)
    foreach (string str in addresses)
    if (string.IsNullOrEmpty(str))
    continue;
    SPPrincipalInfo info = ResolvePrincipal(web, str, SPPrincipalType.All, SPPrincipalSource.All, null, false);
    if ((info != null) && (info.PrincipalId > 0))
    if (!string.IsNullOrEmpty(info.Email))
    try
    func(new MailAddress(info.Email, (info.DisplayName != null) ? info.DisplayName : "", Encoding.UTF8));
    catch (FormatException)
    continue;
    if ((string.IsNullOrEmpty(info.Email) && info.IsSharePointGroup) && web.DoesUserHavePermissions(SPBasePermissions.BrowseUserInfo))
    SPGroup byNameNoThrow = web.SiteGroups.GetByNameNoThrow(info.LoginName);
    if (byNameNoThrow == null)
    continue;
    foreach (SPUser user in byNameNoThrow.Users)
    if (!string.IsNullOrEmpty(user.Email))
    try
    func(new MailAddress(user.Email, (user.Name != null) ? user.Name : "", Encoding.UTF8));
    continue;
    catch (FormatException)
    continue;
    continue;
    I.e. at first it tries to resolve user using ResolvePrincipal() method. If it is not resolved (info == null) email is not sent. But if it is - it first checks that email is not empty. If it is not - it adds email to the MailMessage.To recipients list. If
    it is empty it checks whether the principal info represents Sharepoint group. If yes - it will send email to each member of the group.
    So it may be so that you try to send email to external user (which is not supported according to the code above), or resolved principal doesn't have email specified.
    Blog - http://sadomovalex.blogspot.com
    CAML via C# - http://camlex.codeplex.com

  • Assigning External content type field column value using Client Object Model

    I have a problem assinging External column value to ListItem object with client object model-based application I'm developing. To be precise, I am able to retrieve data related to external content type by reading external list created from this content type
    but I don't know how to properly use it to assign value to this field. By doing some research on my own I concluded that BDC ID column from external list is the way to go since it uniquely defines selected row from external list but that doesn't
    tell me much since I don't know what to do with it. Currently I ended up with partial solution - to assign plain string value of picker column but that makes this value visible only in "View Properties" option on Sharepoint and not in "Edit Properties"
    which pritty much makes sence since it isn't properly related to rest of the data in specific row. Does someone have a better solution for this?
    Igor S.

    I think I understand your problem.
    In my example I have an external data column "Beneficiary Name", using a Beneficiary external content type (accessing a table of beneficiaries in a SQL table).
    I want to set the "Beneficiary Name" property using the client object model. I know the name of the beneficiary but not the ID value.
    It is a fairly simple solution. You just need to identify the name of the property SharePoint assigns to the ID field, in my case it is called "Beneficiary_ID". Then set the two properties as follows:
    thisItem["Beneficiary_Name"] = "Charitable Trust";
    thisItem["Beneficiary_ID"] = -1;
    thisItem.Update();
    Setting the ID property to -1 causes the server to do an automatic lookup for the ID from the value assigned to the item.

Maybe you are looking for

  • What is the real time use of implicit and explicit cursors in pl/sql

    what is the real time use of implicit and explicit cursors in pl/sql.............please tell me

  • Sort files in Finder column view for the current folder only?

    Hi, I don't really understand how finder sort settings work, even after using OS X since it first came out. Maybe someone can give me a hand. I'm trying to sort files inside one specific folder according to their name decending. In general I have arr

  • 7k vPC best practice with multiple line cards?

    I have a pair of 7k's that have a single line card with a 2 port vPC linked to a pair of 5k's, another 2 port vPC linked to the layer 3 VDC and a 4 port vPC used for peer link.  I recently added an additional line card to the 7k's and want to add red

  • PDF417 and Unicode

    Hello all, I am trying to stuff some data into a PDF417 barcode field, for one of the forms I will need to put Unicode characters; however I found that the capacity of the barcode field is reduced drastically when storing unicode characters, I did so

  • Why cache files is deleted ?

    Hi All, I have the following config for the OBI server cache: DATA_STORAGE_PATHS     =     "[OBIHOME]/OracleBIData/cache" 9000 MB; MAX_ROWS_PER_CACHE_ENTRY = 0; // 0 is unlimited size MAX_CACHE_ENTRY_SIZE = 9000 MB; MAX_CACHE_ENTRIES = 10000; POPULAT