Get_current and get_iterator

Dear Experts
What is the purpose of the methods
get_current( ) and get_iterator( )  ?
I have used them few times but I was not able to exactly understand the main purpose of these methods.
Any replies would be really appreciated.
Thanks
Raj

Hi Raj,
The data you enter on the Web UI gets saved in the database tables via BOL Entities or Objects. These BOL Entities are kind of class instances with underlying structures(mapped to the database tables).
These BOL entities are held by Collection Wrappers. They are kind of containers or wrapper classes in the context nodes.
For example, in a form view the data gets stored in 1 BOL entity and in turn held by a Collecton Wrapper whereas in a table view the data is 1:N, there can be N BOL entities (all with same structure) corresponding to each row of the table view and held by a Collection Wrapper.
The BOL entities will be of type CL_CRM_BOL_ENTITY.
So when you want to access data from a view, you write this way...
If you are in a method of IMPL Class.... ( if you are at the context node methods 
Context Node name -> Collection Wrapper -> get_current( ).
View Controller -> Context -> Context Node name -> Collection Wrapper -> get_current( ).
get_current gives  the BOL entity underlying the view. You can alternatively use get_first( ) as in a Form view there is 1 BOL entity only.
If you are in table view then,get_current gives the current entity. If you want the next row then get_next ( ) or you can loop at the collectio_wrapper and get the corresponding row using index.
If you want to delete certain rows in the table view then you can delete by looping at the collection but there is a danger of missing the index(as happens when ypu delete entries while looping on an internal table).
So you use the table view iterator to do this as it searches on the index or BOL entity totally.
Explore the methods of classes CL_CRM_BOL_ENTITY and IF_BOL_BO_COL. Do a where used and observe what they are doing.
The best thing about CRM Web Client UI is that the code written across components is almost uniform.
You open any of the methods the code will be similar. So if you master one component, everything is almost same.
Regards,
Masood Imrani S.

Similar Messages

  • How to get distinct values from a list and display in a ListView webpart.

    Hi,
    I have a requirement in which I need to pull unique/distinct values from a custom list and then display it via a listview webpart. Can any one suggest how this can be done.
    If possible please share the CAMEL query to fetch distinct values from a custom list.
    Thanks,
    Ankit

    Hi Ankit,
    Is there any particular reason that the values need to be shown in a list view web part?  Are you going to use that web part for filtering via web part connections?
    I ask because the enterprise site collection features include the SharePoint List Filter web part, which may accomplish what you're looking for.
    If you just need to display the values in a grid view, you might have more luck with the JavaScript Client Object Model.  Try putting the following in a text file:
    <style>
    .CustomTableClass{display:table;table-layout:fixed}
    .CustomRowClass{display:table-row;}
    </style>
    <div id="distinct_values_div" class="CustomTableClass">
    <img src="/_layouts/loading.gif" />
    </div>
    <script language="JavaScript" type="text/JavaScript">
    var siteUrl = '/sitecollection/web'; //use the actual subsite URL here
    var listName = 'mylist'; // use the actual list name here
    var field = "Title" // use the actual field you want to display here
    var divToUpdate = document.getElementById("distinct_values_div");
    var rowClass = "CustomRowClass";
    ExecuteOrDelayUntilScriptLoaded(function(){
    var clientContext = new SP.ClientContext(siteUrl);
    var web = clientContext.get_web();
    var lists = web.get_lists();
    var list = lists.getByTitle(listName);
    var camlQuery = new SP.CamlQuery();
    camlQuery.set_viewXml('<View><Query></Query><RowLimit>500</RowLimit></View>');
    this.collListItem = list.getItems(camlQuery);
    clientContext.load(collListItem,"Include ("+field+")");
    clientContext.executeQueryAsync(
    Function.createDelegate(this, this.onQuerySucceeded),
    Function.createDelegate(this, this.onQueryFailed));
    },"sp.js");
    function onQueryFailed(sender, args){
    divToUpdate.innerHTML = 'Unable to retrieve values: '+args.get_message());
    function onQuerySucceeded(sender, args){
    var allValues = [];
    var listItemEnumerator = collListItem.getEnumerator();
    divToUpdate.innerHTML = "";
    while(listItemEnumerator.moveNext()){
    var listItem = listItemEnumerator.get_current();
    if(!containsString(allValues,listItem.get_item(field)){
    var value = listItem.get_item(field);
    allValues.push(value);
    var newDiv = document.createElement("div");
    newDiv.className = rowClass;
    newDiv.innerHTML = value;
    divToUpdate.appendChild(newDiv);
    function containsString(strArray, text){
    var contains = false;
    for (var i=0; i<strArray.length; i++){
    if(strArray[i]==text){contains = true; break;}
    return contains;
    </script>
    Upload the text file to a library on the site, then add a content editor web part to a page where you want the distinct values to appear. In the content editor web part's properties, edit the Content Link so that it links directly to the text file.  This
    will cause the JavaScript to run on the page.

  • How to add anchor tag dynamically on infopath (OOTB task form of workflow .xsn) by jquery -dynamically as i did by below script on newform.aspx where I will read Help title and URL value from list

    on newform.aspx just above the top of cancel button I want to put 1 hyperlink "Help"
    but I want to do this by script/jquery by reading my configuration list where 1 column is TITLE and other is- URL
    Configuration List has 2 columns Title and URLValue
    Title                                    UrlValue
    HelpNewPage                    
    http://url1
    HelpEditPage                      http://url2
    so script should read Title and display "Help"--->1st part on NewForm.aspx/EditForm
    Script should read UrlValue column and on click of help-(display link) the respective url should be open in new window.-->second part
    Please let me know reference code for adding anchor tag dynamically by reading from list
    Help/Reference 
    http://www.sharepointhillbilly.com/Lists/Posts/Post.aspx?ID=5
    I can see hyperlink near cancel button-
    //This block is just placing help link near cancel button- 
    $(document).ready(function() {
        GetHelpLinkFromConfigList();
    var HelpLinkhtml ='<a href="#" text="Help">Help</a>';
    var position =$("input[value='Cancel']").parent("td").addClass('ms-separator').append(HelpLinkhtml);
    var HelpLinkhtml ='<a href="#" text="Help" onclick="GetHelpLinkFromConfigList();">Help</a>'; 
    var position =$("input[value='Cancel']").parent("td").addClass('ms-separator').append(HelpLinkhtml);
    var HelpLinkimageButton ='<IMG SRC="../../Style Library/Help.bmp" style="width:35px;"/>'; 
    var position1 =$("input[value='Cancel']").parent("td").addClass('ms-separator').append(HelpLinkimageButton );
    //Rest script
    function GetHelpLinkFromConfigList()
     //The Web Service method we are calling, to read list items we use 'GetListItems'
     var method = "GetListItems";
     //The display name of the list we are reading data from
     var list = "configurationList";
     //We need to identify the fields we want to return. In this instance, we want the Title,Value fields
     //from the Configuration List. You can see here that we are using the internal field names.
     var fieldsToRead = "<ViewFields>"+"<FieldRef Name='Title' />"+"<FieldRef Name='Value' />"+"</ViewFields>";
     //comment
     var query = "<Query>" +
                            "<Where>" +
                                "<Neq>" +
                                    "<FieldRef Name='Title'/><Value Type='Text'>Help</Value>"
    +
                                "</Neq>" +
                            "</Where>" +
                            "<OrderBy>" +
                                "<FieldRef Name='Title'/>" +
                            "</OrderBy>" +
                        "</Query>";
     $().SPServices(
     operation: method,
        async: false,
        listName: list,
        CAMLViewFields: fieldsToRead,
        CAMLQuery: query,
        completefunc: function (xData, Status) {
        $(xData.responseXML).SPFilterNode("z:row").each(function() {
        var displayname = ($(this).attr("ows_Title"));
        var UrlValue = ($(this).attr("ows_Value")).split(",")[0];
        AddRowToSharepointTable(displayname,UrlValue)
    function AddRowToSharepointTable(displayname,UrlValue)
        $("#NDRTable").append("<tr align='Middle'>" +
                                    "<td><a href='" +UrlValue+ "'>+displayname+</a></td>"
    +
                                   "</tr>");
    <table id="NDRTable"></table>
    sudhanshu sharma Do good and cast it into river :)

    Hi,
    From your description, you want to add a help link(read data from other list) into new form page.
    The following code for your reference:
    <script src="http://code.jquery.com/jquery-1.10.2.min.js" type="text/javascript"></script>
    <script type="text/javascript">
    ExecuteOrDelayUntilScriptLoaded(AddHelpLink, "sp.js");
    function AddHelpLink() {
    var context = new SP.ClientContext.get_current();
    var list= context.get_web().get_lists().getByTitle("configurationList");
    var camlQuery= new SP.CamlQuery();
    camlQuery.set_viewXml("<View><Query><Where><Eq><FieldRef Name='Title'/><Value Type='Text'>Help</Value></Eq></Where></Query></View>");
    this.listItems = list.getItems(camlQuery);
    context.load(this.listItems,'Include(Title,URL)');
    context.executeQueryAsync(function(){
    var ListEnumerator = listItems.getEnumerator();
    while(ListEnumerator.moveNext())
    var currentItem = ListEnumerator.get_current();
    var title=currentItem.get_item("Title");
    var url=currentItem.get_item("URL").get_url();
    var HelpLinkhtml ='<a href="'+url+'">'+title+'</a>';
    $("input[value='Cancel']").parent("td").addClass('ms-separator').append(HelpLinkhtml);
    },function(sender,args){
    alert(args.get_message());
    </script>
    Result:
    Best Regards
    Dennis Guo
    TechNet Community Support

  • How do I query a SharePoint List using a url and filtering on date?

    I am reading a SharePoint list using jquery.  Everything is working fine
    except for the filter.  Each list item has an expiration date.  I want to retrieve JUST the items that have not expired (Expires > Today) but I can't figure out the url syntax and I've been searching all day for an example and
    can't find one.  Could someone please help?!?  See bold code below.
    Thanks,
    Glen
    $(document).ready(function ()
    <strong>var qryWCFUrl = "/sites/MMTP1/_vti_bin/listdata.svc/MMAlerts?$filter=(Expires gt '08/10/2011')&$orderby=Title";
    </strong> $.getJSON(qryWCFUrl, function (results)
    $.each(results.d.results, function (i, mmAlert)
    itemID = mmAlert.Id;
    mmTitle = mmAlert.Title;
    mmClass = mmAlert.ClassValue;
    //alert("Item="+itemID+" Title="+mmTitle+" Class="+mmClass);
    AddMMStatus(mmAlert.Id,mmAlert.Title,mmAlert.ClassValue);

    Fadi,
    Thanks for your response.  I actually have another version of the code that uses the SP client objects that works.  The problem is site boundries.  Let me give a more complete project explanation.
    I am creating a master page for a new intranet.  As part of this master page, I want to read from an SP list of alerts and post each alert (if not expired) in the SP status bar.  I've gotten this to work with SP client objects and jquery (except
    for the date filter part).  Both of these solutions work fine on the top site level.  BUT when trying it out at the sub-site level, the SP client objects version of my code fails. The jQuery version works except the date filtering.
    I looked at the example from your link and it looks like a bit of a hybrid to my approaches:  JQuery with CAML.  My question is; does this example permit me to access a list in the top-level site from the subsites?  Please excuse my ignorance,
    but I am an EXTREME newbie in this having spent the past 8 years as a VB.Net developer and a little bit of ASP.Net.
    Below are the two different versions of my code in different versions of my master page definition:
    SP Client Object Version
    <script type="text/javascript">
    // <![CDATA[
    ExecuteOrDelayUntilScriptLoaded(LoadAlerts, "sp.js");
    var ctx;
    var currAlerts;
    function LoadAlerts() {
    ctx = new SP.ClientContext.get_current();
    list = ctx.get_web().get_lists('/sites/MMTP1/Lists/').getByTitle('MMAlerts');
    var cmlQry = new SP.CamlQuery();
    var camlExp = '<query><Query><Where><Gt><FieldRef Name="Expires" /><Value IncludeTimeValue="FALSE" Type="DateTime"><Today /></Value></Gt></Where></Query></query>';
    cmlQry.set_viewXml(camlExp);
    currAlerts = list.getItems(cmlQry);
    ctx.load(currAlerts,'Include(ID,Title,Class)');
    ctx.executeQueryAsync(GetAlertsSuccess,GetAlertsFailed);
    function GetAlertsSuccess() {
    var lstEnum = currAlerts.getEnumerator();
    while(lstEnum.moveNext()) {
    var mmAlert = lstEnum.get_current();
    AddMMStatus(mmAlert.get_item('ID'),mmAlert.get_item('Title'),mmAlert.get_item('Class'));
    function GetAlertsFailed(sender,args) {
    alert('Alerts load failed: ' + args.tostring);
    function AddMMStatus(msgID, strTitle, strClass) {
    var statID;
    var statClass;
    var statTitle;
    statClass = "<a href=\"#\" onclick=\"javascript:DisplayAlert("+msgID+");\">" + strClass + ": </a>";
    statTitle = "<a href=\"#\" onclick=\"javascript:DisplayAlert("+msgID+");\">" + strTitle + "</a>";
    statID = SP.UI.Status.addStatus(statClass, statTitle, true);
    SP.UI.Status.setStatusPriColor(statID,"red");
    function DisplayAlert(msgID) {
    var options = {
    title: "Miller & Martin Alert!",
    url: "/sites/MMTP1/SitePages/ShowAlert02.aspx?ID="+msgID,
    allowMaximize: false,
    showClose: true
    SP.UI.ModalDialog.showModalDialog(options);
    // ]]>
    </script>
    JQuery Version (works except for filtering by date)
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
    <script type="text/javascript" >
    // <![CDATA[
    var itemID;
    var mmTitle;
    var mmClass;
    $(document).ready(function ()
    var qryWCFUrl = "/sites/MMTP1/_vti_bin/listdata.svc/MMAlerts?$filter=(Expires gt '08/10/2011')&$orderby=Title";
    $.getJSON(qryWCFUrl, function (results)
    $.each(results.d.results, function (i, mmAlert)
    itemID = mmAlert.Id;
    mmTitle = mmAlert.Title;
    mmClass = mmAlert.ClassValue;
    AddMMStatus(mmAlert.Id,mmAlert.Title,mmAlert.ClassValue);
    function AddMMStatus(msgID, strTitle, strClass, strSeverity) {
    var statID;
    var statClass;
    var statTitle;
    statClass = "<div id=\"mmAlertTitle\" style=\"display:inline-block;\"><a href=\"#\" onclick=\"javascript:DisplayAlert("+msgID+");\">" + strClass + ": </a></div>";
    statTitle = "<div id=\"mmAlertDetail\" style=\"display:inline-block;\"><a href=\"#\" onclick=\"javascript:DisplayAlert("+msgID+");\">" + strTitle + "</a></div>";
    statID = SP.UI.Status.addStatus(statClass, statTitle, true);
    SP.UI.Status.setStatusPriColor(statID,"green");
    function DisplayAlert(msgID) {
    var options = {
    title: "Miller & Martin Alert!",
    url: "/sites/MMTP1/SitePages/ShowAlert02.aspx?ID="+msgID,
    allowMaximize: false,
    showClose: true
    SP.UI.ModalDialog.showModalDialog(options);
    // ]]>
    </script>

  • How to show surveys name and responses under curret subsite by Java object model in the CEWP

    Hi All,
    I need to show the name of surveys, their description and all responses against the survey  under my current sub-site.
    As I think there is no such out of box web-part available in SharePoint 2010.
    1. Can I get it by using java script client object model and place that in CEWP?
    2. Could I get code for this need?
    Naimish

    Sorry For late reply, I have managed to get needed out put.
    Thank you Hemendra.
    =====================
    <script ='/_layouts/SP.js' type='text/javascript'>
    ExecuteOrDelayUntilScriptLoaded(retrieveAllListProperties, "sp.js"); 
    function retrieveAllListProperties() {
        var clientContext = new SP.ClientContext.get_current();;
        var oWebsite = clientContext.get_web();
        this.collList = oWebsite.get_lists();
        clientContext.load(collList);
        clientContext.executeQueryAsync(Function.createDelegate(this, this.onQuerySucceeded), Function.createDelegate(this, this.onQueryFailed));
    function onQuerySucceeded() {
        var listInfo = '';
        var str="";
        var columns = 3;
        var listEnumerator = collList.getEnumerator();
        str += '<table  style="width:1000px" border="1" cellspacing="1" cellpadding="5">'
        str += '<td style="font-size:14.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;color:red">' +  'Survey Title' + '</td>'
        str += '<td style="font-size:14.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;color:red">' + 'Survey Description' + '</td>'
        str += '<td style="font-size:14.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;color:red">' +  'Total Responses'+ '</td>'   
        while (listEnumerator.moveNext()) 
            var oList = listEnumerator.get_current();
            if(oList.get_baseType() == 4)
            {   str += '<tr>'
                //listInfo += 'Survey Title: '+oList.get_title() +'------'+' Description: '+oList.get_description() +'------'+ ' Total Responses: ' + oList.get_itemCount();
                str += '<td>' +  oList.get_title() + '</td>'
                str += '<td>' +  oList.get_description() + '</td>'
                str += '<td>' +  oList.get_itemCount() + '</td>'
                str += '<tr>'
                str += '</tr>'
        str += '</table>'   
        document.getElementById("demo").innerHTML = str;
    function onQueryFailed(sender, args) {
        alert('Request failed. ' + args.get_message() + '\n' + args.get_stackTrace());
    </script>
     <span id="demo" style="float:left;">Survey</span>

  • Advantages and Disadvantages of Client Object Model in sharepoint 2013

    I need Advantages and Disadvantages of Client Object Model in sharepoint 2013
    like below in javascript. Users will have read/edit and approve access to the list.
      var clientContext = new SP.ClientContext.get_current();
           var oList = clientContext.get_web().get_lists().getByTitle('Workflow Tasks');
    MCTS Sharepoint 2010, MCAD dotnet, MCPDEA, SharePoint Lead

    Thanks 
    AlexanderShelopukho for
    right answer!
    Alex-
    I do not need comparison- 
    I need Advantages and Disadvantages of Client Object Model in sharepoint 2013
    MCTS Sharepoint 2010, MCAD dotnet, MCPDEA, SharePoint Lead

  • Title and description

    Hi All,
    I need very urgent help in this.
    I am using the slider webpart.
    I want to show the title name and description under the image.
    When the images r sliding.
    This is the code.
    <div id="news">
      <div id="innerWrapper">
      <div id="alerts">        
    <span id="greenTitle">ANNOUNCEMENTS:</span>
    <span id="content">You are now able to call 1-0-1, the  Service Helpline, directly from your cell phone.</span> 
    </div>
      <div>
       <div id="topNews">
          <div id="news_Image">
             <img id="nextItemImage" class="next" src="/Pages/fancybox-media" alt="" style=" display: none;"/>
             <a id="featurednewslink" data-fancybox-type="iframe" href="/Pages/community/storm_debris_pickup1213.htm">
    <img id="currentItemImage" src="/COD_pictures/carousel/stormdebris.jpg" alt="" style="cursor: pointer; float: right; width: 42.5%;"/></a>      
    <div id="manualswitch"></div>
          </div>
       </div>
       <div id="listNews">
          <div id="news_Titles">
             <a href="#"><h3>NEWS</h3></a>
    <a href="#"><h3 class="events">EVENTS</h3></a>
             <hr style="clear: both; border-bottom: 6px solid #669900; margin- margin-right: 3.3em;"/>
             <ul id="slideshownav"></ul>
    <ul id="newsslideshow_content" style="display: none;">
    </ul>   
             <span><a href="http:// /" target="_blank">All News &gt;</a></span> 
           </div>
       </div>  
    </div>
    <script type="text/javascript" src="//ajax.aspnetcdn.com/ajax/jQuery/jquery-1.7.2.min.js"></script>
    <script type="text/javascript" src="/_layouts/15/SP.RequestExecutor.js"></script>
    <script type="text/javascript" language="javascript">
    SP.SOD.executeFunc('sp.js', 'SP.ClientContext', retrieveAnnouncementItems);
     function retrieveAnnouncementItems() {
        var clientContext = new SP.ClientContext.get_current();
        var oList = clientContext.get_web().get_lists().getByTitle('DCH_Announcement');
        var camlQuery = new SP.CamlQuery();
        camlQuery.set_viewXml(
            '<View><Query>' + 
    '<OrderBy><FieldRef Name=\'ID\' Ascending=\'False\' /></OrderBy>' +
            '</Query>' + 
            '<RowLimit>1</RowLimit></View>'
        this.collListItem = oList.getItems(camlQuery);        
        clientContext.load(collListItem);
        clientContext.executeQueryAsync( Function.createDelegate(this, this.onQuerySucceeded8), Function.createDelegate(this, this.onQueryFailed8) ); 
    function onQuerySucceeded8(sender, args) {
        var listItemInfox = ''; var listItemEnumerator = collListItem.getEnumerator();       
        while (listItemEnumerator.moveNext()) {
            var oListItem = listItemEnumerator.get_current();
            listItemInfox = "\n<a href='" + oListItem.get_item('URL') + "'>" + oListItem.get_item('Title') +": "+ oListItem.get_item('Description') + "</a>";  
    //debugger;
    document.getElementById("content").innerHTML = listItemInfox.toString();    
    function onQueryFailed8(sender, args) { alert('Request failed. ' + args.get_message() + '\n' + args.get_stackTrace());}  
    SP.SOD.executeFunc('sp.js', 'SP.ClientContext', retrieveNewsItems);
    function retrieveNewsItems() {
        var apiurl = _spPageContextInfo.webAbsoluteUrl + "/_api/web/getFolderbyserverrelativeurl('/COD_pictures/carousel/')/Files?Top=5$select=Description";
            var executor = new SP.RequestExecutor(_spPageContextInfo.webAbsoluteUrl);
    executor.executeAsync(
    url: apiurl,
    method: "GET",
    headers: { "Accept": "application/json; odata=verbose" },
    success: onQuerySucceeded3,
    error: onQueryFailed3
        //clientContext3.executeQueryAsync( Function.createDelegate(this, this.onQuerySucceeded3), Function.createDelegate(this, this.onQueryFailed3) ); 
    function onQuerySucceeded3(data) {  
    var listItemInfo3=''; var i = 0; var listna ='';
    var jsonObject = JSON.parse(data.body);
    var results = jsonObject.d.results;
    if (results.length == 0) { alert('no result'); }
    else {
    var ResultsHtml = '';
    $.each(results, function (index, result) { 
    //alert(result.Name);
    listItemInfo3 += "<li>"+
    "<span class='newsslide_title'>" + result.Title +"</span>"+
    "<span class='newsslide_url'>/COD_pictures/carousel/" + result.Name +"?renditionID=5</span>"+
    "<span class='newsslide_image'>/COD_pictures/carousel/" + result.Name +"</span>" + 
    "<span class='newsslide_target' title='blank|self'></span><span class='newsslide_fancybox' title='fancybox|fancybox-media'></span>"+
    "<span class='newsslide_description'>" + result.Title  +"</span><span class='newsslide_description'><b style='font-weight:19px'>ABCDEF</b></span></li>"; 
    listna += "<li><a id='slideritem"+i+"' href='"+result.Title +"' style='color: rgb(231,231,231); background-image: none; background- background-repeat: no-repeat no-repeat;'>"+result.Title
    +"</a></li>";
    i++;
    return index<4;
         document.getElementById("newsslideshow_content").innerHTML = listItemInfo3;
         document.getElementById("slideshownav").innerHTML = listna;
         slideshowcontent = document.getElementById("newsslideshow_content");   
         nextimage(0,slideshowcontent);
    function onQueryFailed3(data, errorCode, errorMessage) { alert(errorMessage); }
    function nextimage(x, slideshowcontent) {
    var changenews;
    var slideshowcontentitems = slideshowcontent.getElementsByTagName("li");
            imageCount = slideshowcontentitems.length -1;
    for (i = 0; i <= imageCount; i++) {
                document.getElementById("slideritem" + i).style.color = "#e7e7e7";
                document.getElementById("slideritem" + i).style.backgroundImage = "none";
            document.getElementById("slideritem" + x).style.color = "#0166ce";
            document.getElementById("slideritem" + x).style.backgroundImage = "url(/SiteCollectionImages/COD_images/greenArrow_slider.png)";
    document.getElementById("slideritem" + x).style.backgroundRepeat="no-repeat";
    document.getElementById("slideritem" + x).style.backgroundPosition="center left";
            if (x == imageCount) { y = 0; }
            else { y = (x + 1); };
            //currentItemImage(x);
            curtitle = slideshowcontentitems[x].getElementsByTagName("span")[0].innerHTML; 
            cururl = slideshowcontentitems[x].getElementsByTagName("span")[1].innerHTML;
            curimg = slideshowcontentitems[x].getElementsByTagName("span")[2].innerHTML;
            curtrg = slideshowcontentitems[x].getElementsByTagName("span")[3].innerHTML;
            if (curtrg == "blank") { curtrg = "_" + curtrg };
            curfbx = slideshowcontentitems[x].getElementsByTagName("span")[4].innerHTML;
            //if(curfbx!=""){document.getElementById("featurednewslink").data-fancybox-type="iframe"}
            curimg = curimg.replace(/<font>/g, "");
            curimg = curimg.replace(/<\/font>/g, "");
            curimg = curimg.replace(/ /g, "");
            document.getElementById("currentItemImage").target = curtrg;
            document.getElementById("currentItemImage").src = curimg;
            document.getElementById("currentItemImage").style.cursor = "pointer";
    document.getElementById("currentItemImage").style.width = "300px";
            document.getElementById("featurednewslink").href = cururl;
            document.getElementById("featurednewslink").target = curtrg;
            document.getElementById("featurednewslink").className = curfbx;
            //document.getElementById("currentItemImage").onclick = function(){parent.location = cururl;};
            //nextItemImage(y)
            nexttitle = slideshowcontentitems[y].getElementsByTagName("span")[0].innerHTML;
            nexturl = slideshowcontentitems[y].getElementsByTagName("span")[1].innerHTML;
            nextimg = slideshowcontentitems[y].getElementsByTagName("span")[2].innerHTML;
            nexturl = slideshowcontentitems[y].getElementsByTagName("span")[3].innerHTML;
            nextimg = slideshowcontentitems[y].getElementsByTagName("span")[4].innerHTML;
            document.getElementById("nextItemImage").src = nextimg;
            clearTimeout(changenews);
            changenews = setTimeout(function () { nextimage(y,slideshowcontent) }, 7000);
    </script>
    Any help please.
    Thank you,
    Sowjanya.

    Hi,
    If you just want to show Title and Description below the image, you take consideration of using the OOTB Picture Library Slideshow Web Part, it provides such functionality can
    meet your requirement.
    Here is a link about How to Use the Picture Library Slideshow Web Part in SharePoint 2013:
    http://community.bamboosolutions.com/blogs/sharepoint-2013/archive/2013/03/29/how-to-use-picture-library-web-part-for-sharepoint-2013.aspx
    If you want to develop your own Slider, I would suggest you take a look at these JavaScript Image Slider plugins which can make us easier to create a custom one:
    http://www.1stwebdesigner.com/freebies/javascript-sliders-scrollers/
    http://wowslider.com/
    http://www.woothemes.com/flexslider/
    Best regards
    Patrick Liang
    TechNet Community Support

  • How to read list item and display Title and on click hyperlink as value by javascript /jquery

    on newform.aspx just above the top of cancel button I want to put 1 hyperlink "Help"
    but I want to do this by script/jquery by reading my configuration list where 1 column is TITLE and other is- URL
    in TITLE column will write "Help" and in URL column  I will write
    http://portal1234/sites/sudha/MyHelppage.aspx
    so script should read Title and display Help--->1st part
    Script should read Value column and on click of help-(display link) the respective url should be open in new window.-->second part
    Please let me know reference code for adding anchor tag dynamically by reading from list
    I can see hyperlink near cancel button-
    $(document).ready(function(){
    var HelpLinkhtml ='<a href="#" text="Help">Help</a>';
    var position =$("input[value='Cancel']").parent("td").addClass('ms-separator').append(HelpLinkhtml);
    now for reading from list I am trying below script-
    $(document).ready(function() {
        GetHelpLinkFromConfigList();
    function GetHelpLinkFromConfigList()
     //The Web Service method we are calling, to read list items we use 'GetListItems'
     var method = "GetListItems";
     //The display name of the list we are reading data from
     var list = "configurationList";
     //We need to identify the fields we want to return. In this instance, we want the Title,Value fields
     //from the Configuration List. You can see here that we are using the internal field names.
     var fieldsToRead = "<ViewFields>"+"<FieldRef Name='Title' />"+"<FieldRef Name='Value' />"+"</ViewFields>";
     //comment
     var query = "<Query>" +
                            "<Where>" +
                                "<Neq>" +
                                    "<FieldRef Name='Title'/><Value Type='Text'>Help</Value>"
    +
                                "</Neq>" +
                            "</Where>" +
                            "<OrderBy>" +
                                "<FieldRef Name='Title'/>" +
                            "</OrderBy>" +
                        "</Query>";
     $().SPServices(
     operation: method,
        async: false,
        listName: list,
        CAMLViewFields: fieldsToRead,
        CAMLQuery: query,
        completefunc: function (xData, Status) {
        $(xData.responseXML).SPFilterNode("z:row").each(function() {
        var displayname = ($(this).attr("ows_Title"));
        var UrlValue = ($(this).attr("ows_Value")).split(",")[0];
        AddRowToSharepointTable(displayname,UrlValue)
    function AddRowToSharepointTable(displayname,UrlValue)
        $("#NDRTable").append("<tr align='Middle'>" +
                                    "<td><a href='" +UrlValue+ "'>+displayname+</a></td>"
    +
                                   "</tr>");
    <table id="NDRTable"></table>
    Thanks :)
    sudhanshu sharma Do good and cast it into river :)

    Hi,
    From your description, you want to add a help link(read data from other list) into new form page.
    The following code for your reference:
    <script src="http://code.jquery.com/jquery-1.10.2.min.js" type="text/javascript"></script>
    <script type="text/javascript">
    ExecuteOrDelayUntilScriptLoaded(AddHelpLink, "sp.js");
    function AddHelpLink() {
    var context = new SP.ClientContext.get_current();
    var list= context.get_web().get_lists().getByTitle("configurationList");
    var camlQuery= new SP.CamlQuery();
    camlQuery.set_viewXml("<View><Query><Where><Eq><FieldRef Name='Title'/><Value Type='Text'>Help</Value></Eq></Where></Query></View>");
    this.listItems = list.getItems(camlQuery);
    context.load(this.listItems,'Include(Title,URL)');
    context.executeQueryAsync(function(){
    var ListEnumerator = listItems.getEnumerator();
    while(ListEnumerator.moveNext())
    var currentItem = ListEnumerator.get_current();
    var title=currentItem.get_item("Title");
    var url=currentItem.get_item("URL").get_url();
    var HelpLinkhtml ='<a href="'+url+'">'+title+'</a>';
    $("input[value='Cancel']").parent("td").addClass('ms-separator').append(HelpLinkhtml);
    },function(sender,args){
    alert(args.get_message());
    </script>
    Result:
    Best Regards
    Dennis Guo
    TechNet Community Support

  • Custom component Search and Result view using value node :pls help

    Hi Experts,
    I am creating a Custom component with Search and Result view using value nodes.
    This is the code I wrote in the Search button event handler method.
    The data which gets in lv_search I need to put in lv_col .
    Can somebody guide me for this.
    Points will be awarded .
    METHOD eh_onsearch.
      DATA : lv_current TYPE REF TO if_bol_bo_property_access,
             lv_search  TYPE zcrm_orgstruct_search,     "Search value node structure
             lv_result  TYPE zcrm_orgstruct_result,         "Result value node structure
             lv_col     TYPE REF TO if_bol_bo_col.
      lv_current ?= me->typed_context->search->collection_wrapper->get_current( ).
      CALL METHOD lv_current->get_properties
        IMPORTING
          es_attributes = lv_search.
      me->typed_context->searchresult->collection_wrapper->set_collection( lv_col ).
      op_toresultview( ).
    ENDMETHOD.
    Regards,
    Lakshmi

    Hi Lakshmi,
    Could you please share with us how it was solved.
    "CALL METHOD lv_current->get_properties
    IMPORTING
    es_attributes = lv_search."
    Did you get any values in lv_search ?
    Because while using value nodes for search view (which inherits from advance search controller  class), the above method does not return any search values entered in the fields.
    Please let me know how did you solve it.
    Thanks & Regards
    Vidhya

  • CSOM and O365 Auth

    Hello,
    Ultimately I am wanting to use the Project SDK to authenticate to a Project Online site to pull projects, but I'm having trouble authenticating through O365.
    I followed this blog:
    http://blogs.msdn.com/b/kaevans/archive/2014/02/23/call-o365-using-csom-with-a-console-application.aspx
    to authenticate to my SharePoint online site. I'm met with the following exception with my console app:
    Microsoft.SharePoint.Client.IdcrlException was unhandled
      HResult=-2147186646
      Message=The Application ID (AppID) for which the service ticket is requested does not exist on the system.
      Source=Microsoft.SharePoint.Client.Runtime
      ErrorCode=-2147186646
      StackTrace:
           at Microsoft.SharePoint.Client.Idcrl.IdcrlAuth.ParseFPDomainName(XDocument xdoc)
           at Microsoft.SharePoint.Client.Idcrl.IdcrlAuth.RequestFederationProviderInfo(String domainname)
           at Microsoft.SharePoint.Client.Idcrl.IdcrlAuth.GetFederationProviderInfo(String domainname)
           at Microsoft.SharePoint.Client.Idcrl.IdcrlAuth.InitFederationProviderInfoForUser(String username)
           at Microsoft.SharePoint.Client.Idcrl.IdcrlAuth.GetServiceToken(String username, String password, String serviceTarget, String servicePolicy)
           at Microsoft.SharePoint.Client.Idcrl.SharePointOnlineAuthenticationProvider.GetAuthenticationCookie(Uri url, String username, SecureString password, Boolean alwaysThrowOnFailure)
           at Microsoft.SharePoint.Client.SharePointOnlineCredentials.GetAuthenticationCookie(Uri url, Boolean refresh, Boolean alwaysThrowOnFailure)
           at Microsoft.SharePoint.Client.ClientRuntimeContext.SetupRequestCredential(ClientRuntimeContext context, HttpWebRequest request)
           at Microsoft.SharePoint.Client.SPWebRequestExecutor.GetRequestStream()
           at Microsoft.SharePoint.Client.ClientContext.GetFormDigestInfoPrivate()
           at Microsoft.SharePoint.Client.ClientContext.EnsureFormDigest()
           at Microsoft.SharePoint.Client.ClientContext.ExecuteQuery()
           at ReadProjectList.Program.Main(String[] args) in d:\Projects\Samples\CSOM\ReadProjectList\Program.cs:line 39
           at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
           at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
           at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
           at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
           at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
           at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
           at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
           at System.Threading.ThreadHelper.ThreadStart()
      InnerException:
    I followed the MSDN guidelines for creating an app permissions in SharePoint have the following tags in the app.config file:
    <appSettings>
    <add key="ClientId" value="some_guid"/>
    <add key="ClientSecret" value="this is a secret"/>
    <add key="Realm" value="some_guid"/>
    </appSettings>
    Here is the following code that gives me the error:
    private const string pwaPath = "https://smartdeploy.sharepoint.com/sites/pwa";
    var pass = new SecureString();
    "somepassword".ToList().ForEach(c => pass.AppendChar(c));
    ClientContext test = new ClientContext(pwaPath);
    test.Credentials = new SharePointOnlineCredentials("[email protected]", pass);
    test.Load(test.Web);
    test.ExecuteQuery();
    I know I'm missing something here... ??
    Thanks!
    Allen Anderson -- Cireson -- www.cireson.com

    Hi,
    You can use batch processing with csom. Ex.
    function CreateListItems(objMyArray) {
    var itemArray = [];
    var clientContext = SP.ClientContext.get_current();
    var oList = clientContext.get_web().get_lists().getByTitle('MyList');
    for(index in objMyArray){
    var curObject = itemArray[index];
    var itemCreateInfo = new SP.ListItemCreationInformation();
    var oListItem = oList.addItem(itemCreateInfo);
    oListItem.set_item('Title', curObject.title);
    oListItem.update();
    itemArray[i] = oListItem;
    clientContext.load(itemArray[i]);
    clientContext.executeQueryAsync(onQuerySucceeded, onQueryFailed);
    And it goes well.(No Performance issue)

  • How to create URL link for telephone number ,open to account search page and account result page ?

    Hi Experts,
    Bussines role - ZCC_ICAGENT 
    If user open this bussiness role and open Account page ,user enter telephone number and enter search account ,then result will be displayed.Instead of 3 clicks ,user click direct URL link ,telephone number is parameter,account Search and account result  page will be opened direct link.
    So how to do it..could you please provide me step by step...what are the steps wee need to follow for creating URL ..how to do it..Please help..
    Thanks
    Kalpana

    Hi kalpana,
    You dont need to do any setting for this.
    Following URL will be used as per your requirement.
    http://rrnewcrm.ril.com:8000/sap(bD1lbiZjPTI0MiZkPW1pbg==)/bc/bsp/sap/crm_ui_start/default.htm
    ?sap-system-login-basic_auth=X&sap-system-login=onSessionQuery&saprole=ZCC_ICAGENT&
    sap-phoneno=9999999999
    Here parameter sap-phoneno will contain the number you want to search for.
    In component ICCMP_BP_SEARCH, go to view BuPaSearchB2B. write below code in its inbound plug IP_INBOUNDPLUG-
    DATA: lt_ivr_url_param TYPE tihttpnvp,
             ls_ivr_url_param TYPE ihttpnvp,
             lr_searchcustomer TYPE REF TO if_bol_bo_property_access,
             ls_searchcustomer TYPE crmt_bupa_il_header_search.
    CALL METHOD cl_crm_ui_session_manager=>get_initial_form_fields
           CHANGING
             cv_fields = lt_ivr_url_param.
    lr_searchcustomer ?= me->typed_context->searchcustomer->collection_wrapper->get_current( ).
         CHECK lr_searchcustomer IS BOUND.
    READ TABLE lt_ivr_url_param INTO ls_ivr_url_param WITH KEY name = 'sap-phoneno'.
    IF ls_ivr_url_param-value IS NOT INITIAL.
             ls_searchcustomer-telephone = ls_ivr_url_param-value.
       CALL METHOD lr_searchcustomer->set_properties( EXPORTING is_attributes = ls_searchcustomer ).
             eh_onsearch( ).
        ENDIF.
    Thanks & Regards
    Richa

  • Data storage in a context node and in a context attribute.

    Hi All,
    I want to know how exactly the data is stored in context node (internal table) and in context attribute (single value) in memory during the runtime.
    Regards,
    Yugesh A

    Hi Andrea,
    Sorry I got it wrong , for lr_comp you will have to take reference from controller IMPL class.
    DATA:
              lr_entity TYPE REF TO cl_crm_bol_entity,
            lr_comp TYPE REF TO ( component controller IMPL class),
             lv_ref_guid     TYPE        crmt_object_guid,
             lr_collection TYPE REF TO cl_crm_bol_bo_col,
             lr_bdc type ref to  if_crm_ui_data_context,
             comp_controller type cl_bsp_wd_component_controller.
    lr_comp  ?= me->comp_controller.
    IF lr_comp IS BOUND.
        TRY.
    lr_entity ?= lr_comp->ZTYPED_CONTEXT->ZBTCUSTOMERH->collection_wrapper->get_current( ).
         lv_ref_guid = lr_entity->get_property_as_string( iv_attr_name = 'REF_GUID' ).
          CATCH cx_sy_ref_is_initial.
          ENDTRY.
    ENDIF.
    Hope it helps.
    Regards,
    Manjeet Singh.

  • To read value of name1 to eh_onsave and also to make uitility class.

    Hi,
    My requirement is to read (get) the value of name1(bp_head, bphead/account details,header,name1) to eh_onsave.
    Please suggest me to achieve this through iv_relation_name.
    I have written select statement in eh_onsave,they suggested to make utility class and call the method of that utility class to get values.
    How to to achieve this .
    Regards,
    Kishore.

    Hi,
    EH_ONSAVE method is in BPHEADOverview which has a context node BuilHeader bound to component controller context node PARTNER. You can directly read name1 from BUILHEADER, not necessary to use iv_relation_name. Use the below sample code in eh_onsave method,
    data: lr_ent       type ref to cl_crm_bol_entity,
             lv_name1 type string.
        lr_ent ?= me->typed_context->builheader->collection_wrapper->get_current( ).
        lv_name = lr_ent ->get_property_as_string( iv_attr_name = 'NAME1'  ).
    Regards,
    Arun

  • How to set selected entity of a collection in the current, and publish it.

    Hi frnds,
      I have collection which contains n number of entities,
    now i am  filtering the collection and getting a unique entity.
    what i need is that i want to publish this entity as current.
    How can I set this filtered entity to the current?
    regards
    Ashraf.

    Hi Ashraf,
    You have to iterate the collection using the following methods first till you access the entity to which you want to change the
    focus.
    IF_BOL_BO_COL~GET_FIRST
    IF_BOL_BO_COL~GET_NEXT
    IF_BOL_BO_COL~GET_PREVIOUS
    IF_BOL_BO_COL~GET_LAST
    Once you reach the corresponding entity, the following method will give that entity when called.
    IF_BOL_BO_COL~GET_CURRENT
    Then you have to call the following method to publish this focus.
    IF_BOL_BO_COL~PUBLISH_CURRENT
    If you have already iterated to the unique entity in the collection, then you just need to do the publish_current.
    Regards,
    Leon

  • CSOM and Batch Insert Performance

    Can we Batch requests while inserting records into SharePoint lists?
    Did anyone notice any performance issues while  bulk inserting 75 rows of 15 columns per row into SharePoint 2013 using CSOM? 
    V

    Hi,
    You can use batch processing with csom. Ex.
    function CreateListItems(objMyArray) {
    var itemArray = [];
    var clientContext = SP.ClientContext.get_current();
    var oList = clientContext.get_web().get_lists().getByTitle('MyList');
    for(index in objMyArray){
    var curObject = itemArray[index];
    var itemCreateInfo = new SP.ListItemCreationInformation();
    var oListItem = oList.addItem(itemCreateInfo);
    oListItem.set_item('Title', curObject.title);
    oListItem.update();
    itemArray[i] = oListItem;
    clientContext.load(itemArray[i]);
    clientContext.executeQueryAsync(onQuerySucceeded, onQueryFailed);
    And it goes well.(No Performance issue)

Maybe you are looking for

  • How do I transfer the songs from my ipod to a new computer?

    I loaded a bunch of cds onto itunes on an old laptop and then synced it to my nano.  That lap top crahsed and burned and I would like to be able to get the cds from my nano onto my new lap top. There are approximately 175 discs worth of music and i c

  • How to handle exception in select statement

    eg:select empno into variable_1 from emp where empno=10 (Fails here the value of variable_1 should be 010) select empno into variable_1 from emp where empno=102 (sucess) in this statement i have to handle no_data_found exception can u please suggest

  • Standard Idoc or BAPI to trasfer the routes and stages data

    Hi guys, We want to transfer the routes and stages data from one SAP system to other SAP system . can u suggest any standard idocs or BAPIs to do the job. thanks sankar Edited by: sudhakar murthy on Apr 1, 2009 10:18 AM

  • Why are pre-built graphics blurry on retina displays?

    I have designed multiple vector infographics in Inkpad (iPad app) and imported them into Adobe Muse. The desktop version of graphics looks great. iPad version is blurry and pixelated. No matter how I export the grpahics (ie: .png, .jpeg, .gif) it is

  • How to reverse movement by BAPI GOODSMVT CREATE?

    Dear all,     i want to use BAPI GOODSMVT CREATE  to do the revese for the movement , this is my 1st to use this BAPI ,  can anyone here can give me the  sample how to use this funtion to reverse the movement ... as i know is use the code for 06, for