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
BKBK 

sosql query for excel tool kit. saving as a tab delimited

Hello,

After running the sosql query for 9 tables, contact, account, product2, etc.. I will need to save the files as a tab delimited. How can I save this without losing any information? Is there a toolkit I can dowload for this. It seems like the only way I can save without losing any data is by saving as a .xls. 

Thank you

ScotScot

BK,

I think you'll find that Excel complains that you'll lose information if you save the sheet as a tab delimited file, but in reality, you'll have exactly what you want. 

You will, of course, need to save each sheet as a separate tab delimited file.

Try it out, open the result, and you should be good.

Scot

BKBK

The thing is when I do that, Mailingstreet in the  contact table has has a tab between the street name and the suite # and everything gets shift over to the left( it moves over to a differnt cell) how can i rectify this probelm. Also, is there anyway to automate these macros where of these sosql qeury to be run everynight?

ScotScot

Not sure about the tab .. I have not had that trouble ... perhaps you have a real tab character in your stored values. You could probably update (fix) the data, or else try using comma delimited output rather than tab delimited.

As far as running and doing the 9 saves, this should be a standard macro issue.  You could even ... trigger the macro automatically when the excel sheet is opened.  If I remember correctly, if you make a macro named "Workbook_Open", it will be run automatically.

To automate the running, you'll need to find some scheduling software; I don't have any suggestion for that.

BKBK

Thanks for the info Scott,

it works for one query but how do i open all 9 queries at once when i open the the toolkit

BKBK

how do i force login when i open excel?

ScotScot

BK,

You would put a call to a login subroutine into the open routine. Depending on what you want to do, it could prompt for the userid/password, or have them built in.

An example, in vbscript, is:

Function MeSession()
     MeSession = False 
     Set binding = CreateObject("SForceOfficeToolkit.SForceSession") 
     if Len(binding.SessionId) > 0 Then
             MeSession = True 
             exit function 
     End If 
     MeSession = binding.Login(UserName2, PassWord2, False)
end function

I choose to call this within each piece of code which uses the api to ensure that I have a valid session.

Scot

ScotScot

BK,

Not sure I understand the question. To run multiple requests, you simply request them one after the other. For example, the following code (in vbscript) performs two retrieves.

Scot


Set qrs = binding.Query( _
    "Select Role,IsPrimary from OpportunityContactRole where OpportunityId = '" _
    & opid & "'", False)
OpPrimaryRole = false
OpRoleCount = qrs.size
OpRoles = " "
for each so in qrs
    OpRoles = OpRoles & " ! " & so.Item("Role")
    if so.Item("IsPrimary") = "true" then OpPrimaryRole = true
next

Set qrs = binding.Query( _
    "Select Role,IsPrimary from AccountContactRole where AccountId = '" & Acctid & "'", False) AcctPrimaryRole = false
AcctRoles = " "
for each so in qrs
   AcctRoles = AcctRoles & " ! " & so.Item("Role")
   if so.Item("IsPrimary") = "true" then AcctPrimaryRole = true
next