Normal Topic Limiting Exports (Read 641 times)
BWETTLAUFER
Full Member
***
Offline



Posts: 216
Location: Cambridge, Ontario
Joined: Apr 9th, 2010
Limiting Exports
Aug 30th, 2016 at 12:52pm
Print Post Print Post  
Hey folks,

I managed to do an Application update and limit mass updates by shutting down the command tree and giving a 'mass update' button with access levels... which is great, but now I have staff who need access to Exports ... without opening the command tree up again.

I tried building a mass update to run the exports, and I think this should work, except I keep getting the error 'ASCII Export Failed To Create File'.  Am I missing something?

Code
Select All
#include "sbasic_include.sbas"

stat vSpecList as String
stat vSpec as String
stat vResult as String
stat vDestination as String
stat vRun as int

vSpecList = @SpecCommand(6, 3, "")				// Get a list of saved Export specs
vSpecList = @SortStringArray(vSpecList, 0)			// Sort them

If vSpecList = ""						// Make sure there is at least one spec to show in popup list
	@MsgBox("No saved Mass Update specs found!", "", "(HINT: Save one first)")
Else
{
	vSpec = @PopupChoiceList(vSpecList, "CHOOSE AN UPDATE")	// Display the list of specs
	vDestination = @PromptForUserInput("EXPORT DESTINATION?",".\export\" + DBCltNo + "-" + @num(@serverdate())+".csv")

	If vSpec <> ""						// Make sure a spec name was selected
	{
		vRun = @LoadExportSpec(vSpec)
		RunExportSpec(vDestination, "", "", 0, 0, 0, 0, 0, 0, 0, 1)
	}
}
 

  
Back to top
IP Logged
 
Carl Underwood
Senior Member
Members
*****
Offline



Posts: 1351
Location: New Hampshire
Joined: Mar 11th, 2003
Re: Limiting Exports
Reply #1 - Aug 30th, 2016 at 2:20pm
Print Post Print Post  
If you manually create the "export" folder, it should work.

Or you could check to see if it exists, and automatically create it if needed. Take a look at @DirectoryExists and @CreateDirectory.
  


Carl Underwood
CDU Computer Consulting LLC
Epsom, New Hampshire
Back to top
IP Logged
 
BWETTLAUFER
Full Member
***
Offline



Posts: 216
Location: Cambridge, Ontario
Joined: Apr 9th, 2010
Re: Limiting Exports
Reply #2 - Aug 30th, 2016 at 2:41pm
Print Post Print Post  
Hmmmm ... could it be a problem because I'm using a client session and calling on my Linux server?  My Linux server doesn't have a S:\ path mapped ...
  
Back to top
IP Logged
 
BWETTLAUFER
Full Member
***
Offline



Posts: 216
Location: Cambridge, Ontario
Joined: Apr 9th, 2010
Re: Limiting Exports
Reply #3 - Aug 30th, 2016 at 4:34pm
Print Post Print Post  
Hi guys ... got it.  Because it's Linux, it needs a case-sensitive destination ... so .\Data\Export\test.txt worked just fine.

Thanks Carl!
  
Back to top
IP Logged
 
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re: Limiting Exports
Reply #4 - Aug 30th, 2016 at 5:54pm
Print Post Print Post  
Because its Linux, you might want to use slashes instead of back-slashes. Though, if it is working with back-slashes, Sesame might be handling that for you.
  

Mark Lasersohn&&Programmer&&Lantica Software, LLC
Back to top
IP Logged
 
BWETTLAUFER
Full Member
***
Offline



Posts: 216
Location: Cambridge, Ontario
Joined: Apr 9th, 2010
Re: Limiting Exports
Reply #5 - Aug 30th, 2016 at 8:01pm
Print Post Print Post  
Worked okay with the backslashes, apparently ...
  
Back to top
IP Logged