function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
smiley2345smiley2345 

Insert 1 to 3 rows using

smiley2345smiley2345

Sorry about that blank post..:smileywink:

I have been reading these posts and haven't found my exact example.

I don't know VB very well, and have not spent alot of time with the excel connector, but what I would like to do is have my user click a button and have it upload 1 - 3 rows in a particular spreadsheet.  They are not to technical (obviously I'm not much more then them)LOL.  I have found the sfqueryall function.  I was hoping there is a sfinsertrow.  Even if the function just did 1 row that would be awesome for me.

Thanks so much

 

 

 

Ron HessRon Hess
it's in there, you may have to dig but the src is editable so you can epose that function if it's not alerady.

BritishBoyinDCBritishBoyinDC
In the modules section, open up s_force

Search for insert_Range

It's designed to be generic - using whatever object name you have requested. The basic syntax for creating a new contact for few records would something like this, where irow is the row number you are referencing, so you can just loop through using a For-Next loop or something similar...

Code:
 Dim soc(0) As SObject3
  Set soc(0) = g_sfApi.CreateObject("contact")
      
    soc(0)("LastName") = Range("a1").Cells(irow, 11).Value
    soc(0)("FirstName") = Range("a1").Cells(irow, 10).Value
    soc(0)("Phone") = Range("a1").Cells(irow, 12).Value
    soc(0)("Email") = Range("a1").Cells(irow, 9).Value
    soc(0)("AccountId") = "0015000000IF2zU"
       
'call batch method
     
    g_sfApi.Create soc, False

 

smiley2345smiley2345
Thank you so much I will try this when I get back from Vacation and let you know if I got it to work.
 
Kim