CSOM code not working in Browser enabled Form - InfoPath Dev
in

InfoPath Dev

CSOM code not working in Browser enabled Form

Last post 05-19-2014 11:43 AM by kjtreier. 0 replies.
Page 1 of 1 (1 items)
Sort Posts: Previous Next
  • 05-19-2014 11:43 AM

    CSOM code not working in Browser enabled Form

    I have built an InfoPath 2013 Form which uses code behind and the SharePoint 2013 CSOM Managed API to query and manipulate a list. The Form works perfectly when run from the Desktop but when displayed as a web page using Form Services the CSOM code does not even appear to connect to the site. All Queries return null and all properties of the calendar object are uninitialized.

    ClientContext client = new ClientContext(siteURL);
    List calender = client.Web.Lists.GetByTitle("IT Calendar");
    
    CamlQuery query = CamlQuery.CreateAllItemsQuery();
    ListItemCollection entries = calender.GetItems(query);
    
    client.Load(entries, c => c.Where(i => i.ContentType.Id.StringValue == typeId));
    client.ExecuteQuery();
Page 1 of 1 (1 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.