Using SPServices with Columns of type BusinessData

Sep 29, 2011 at 6:43 PM

I am migrating a lot of content and need to copy the value from one "text" field to a "BusinessData" field.

In the code attached, by BusinessData field is "SAP" where I need to pass the current value from single line of text field "Title".  If I send the value in "Title" to another field, it works fine.

I have the odd CAMLRowLimit and caml query strictly for testing purposes...

Help!!

--Bill

 

<SCRIPT type=text/javascript src="http://idnetmonitor/sites/rc/mastercode/jquery.current.min.js"></SCRIPT> <SCRIPT type=text/javascript src="http://idnetmonitor/sites/rc/mastercode/jquery.SPServices-0.5.8.min.js"></SCRIPT> <SCRIPT type=text/javascript> $().SPServices({ operation: "GetListItems", async: false, listName: "{7696418A-9C36-4B83-A812-16D2145B934C}", CAMLRowLimit: 3, CAMLQuery: "<Query><Where><Lt><FieldRef Name='ID' /><Value Type='Counter'>5</Value></Lt></Where></Query>", CAMLViewFields: "<ViewFields><FieldRef Name='Title' /><FieldRef Name='SAP' /><FieldRef Name='ID' /></ViewFields>", completefunc: function (xData, Status) { $(xData.responseXML).find("[nodeName=z:row]").each(function() { var title = $(this).attr("ows_Title"); var id = $(this).attr("ows_ID"); updateBDC(title,id) }); } }) function updateBDC(title,id){ alert(title) alert(id) $().SPServices({ operation: "UpdateListItems", async: false, listName: "{7696418A-9C36-4B83-A812-16D2145B934C}", ID:id, 
<SCRIPT type=text/javascript src="http://idnetmonitor/sites/rc/mastercode/jquery.current.min.js"></SCRIPT>

<SCRIPT type=text/javascript src="http://idnetmonitor/sites/rc/mastercode/jquery.SPServices-0.5.8.min.js"></SCRIPT>

<SCRIPT type=text/javascript>

  $().SPServices({
    operation: "GetListItems",
    async: false,
    listName: "{7696418A-9C36-4B83-A812-16D2145B934C}",
    CAMLRowLimit: 3,
    CAMLQuery: "<Query><Where><Lt><FieldRef Name='ID' /><Value Type='Counter'>5</Value></Lt></Where></Query>",
    CAMLViewFields: "<ViewFields><FieldRef Name='Title' /><FieldRef Name='SAP' /><FieldRef Name='ID' /></ViewFields>",
    completefunc: function (xData, Status) {
      $(xData.responseXML).find("[nodeName=z:row]").each(function() {
        var title = $(this).attr("ows_Title");
        var id = $(this).attr("ows_ID");

updateBDC(title,id)


    });
   }
  })

function updateBDC(title,id){

alert(title)
alert(id)


     $().SPServices({
      operation: "UpdateListItems",
      async: false,
      listName: "{7696418A-9C36-4B83-A812-16D2145B934C}",
      ID:id,
      batchCmd: "Update",
      valuepairs: [["SAP",title]],
      completefunc: function(xData, Status) {

      }
     });

}






</script>
Sep 29, 2011 at 6:45 PM

Bad cut and paste - here is the script:



<SCRIPT type=text/javascript src="http://idnetmonitor/sites/rc/mastercode/jquery.current.min.js"></SCRIPT>

<SCRIPT type=text/javascript src="http://idnetmonitor/sites/rc/mastercode/jquery.SPServices-0.5.8.min.js"></SCRIPT>

<SCRIPT type=text/javascript>

  $().SPServices({
    operation: "GetListItems",
    async: false,
    listName: "{7696418A-9C36-4B83-A812-16D2145B934C}",
    CAMLRowLimit: 3,
    CAMLQuery: "<Query><Where><Lt><FieldRef Name='ID' /><Value Type='Counter'>5</Value></Lt></Where></Query>",
    CAMLViewFields: "<ViewFields><FieldRef Name='Title' /><FieldRef Name='SAP' /><FieldRef Name='ID' /></ViewFields>",
    completefunc: function (xData, Status) {
      $(xData.responseXML).find("[nodeName=z:row]").each(function() {
        var title = $(this).attr("ows_Title");
        var id = $(this).attr("ows_ID");

updateBDC(title,id)


    });
   }
  })

function updateBDC(title,id){

alert(title)
alert(id)


     $().SPServices({
      operation: "UpdateListItems",
      async: false,
      listName: "{7696418A-9C36-4B83-A812-16D2145B934C}",
      ID:id,
      batchCmd: "Update",
      valuepairs: [["SAP",title]],
      completefunc: function(xData, Status) {

      }
     });

}






</script>



Coordinator
Sep 30, 2011 at 5:45 AM

will266:

I haven't tried to use these techniques on a Business Data column; it's simply never come up in my work. I really don't know the answer, but maybe one of the other folks who troll these discussions will.

M.

Sep 30, 2011 at 2:07 PM

Thanks for the prompt reply - I am really hoping someone will have tried this before and figured out a resolution.

We are trying to integrate SAP data into SharePoint via BDC - users collaborate on conceptaul Projects, which can ultimately become real SAP Projects.  We want them to be able to collaborate, and see key bits of SAP data without having to go into SAP. 

I only need to be able to take the 1500 or so Projects that already exist in as "single line of text" values, and leverage them with the Business Data - unfortunately you cannot use Data Sheet View to copy and paste into a Business Data column - I was hoping to do this "one-off" to fill in the information.

Worst case, I will grab an intern!!

Thanks again!

Bill