Hey folks ... me again.
I'm now trying to build a mass update button to run imports ... however, every time I run it through the code below, I get an import error -- see administrative log for details message.
Can anyone see if I'm missing something obvious here?
#include "sbasic_include.sbas"
stat vSpecList as String
stat vSpec as String
stat vResult as String
stat vDestination as String
stat vRun as int
stat vStaff as string
stat vSpec1 as string
stat vSpec2 as string
stat vSpec3 as string
vSpec1 = @SpecCommand(6, 4, "") // Get a list of saved Mass Update specs
vSpec1 = @SortStringArray(vSpec1, 0) // Sort them
If vSpec1 = "" // Make sure there is at least one spec to show in popup list
@MsgBox("No saved Import specs found!", "", "(HINT: Save one first)")
Else
{
if @group <> "Management"
{
vStaff = @xlookup(@FN, @userid, "Staff Screen!StaffRef", "StaffMU")
vSpec2 = @containsstringarray(vSpec1,vStaff,0)
vSpec2 = @sortstringarray(vSpec2,0)
vSpec3 = @Popupchoicelist(vSpec2,"CHOOSE AN IMPORT")
}
Else
{
vSpec2 = vSpec1
vSpec2 = @sortstringarray(vSpec2,0)
vSpec3 = @Popupchoicelist(vSpec2,"CHOOSE AN IMPORT")
}
// vSpec3 = @PopupChoiceList(vSpec3, "CHOOSE AN IMPORT") // Display the list of specs
If vSpec3 <> "" // Make sure a spec name was selected
{
vDestination = @PromptForUserInput("File Import Location?","S:\Data\Import\" + DBCltNo + "export" + @num(@serverdate()) + ".csv")
If FileExists(vDestination)
{
Writeln("IMPORTING FILE")
Writeln(vSpec3)
vResult = @SpecCommand(SPEC_OPERATION_LOAD, SPEC_TYPE_IMPORT, vSpec3) // LOAD the Mass Update spec
vResult = @SpecCommand(SPEC_OPERATION_RUN, SPEC_TYPE_IMPORT, vSpec3) // RUN the Mass Update spec
}
}
}