Search these areas:
Help
Support Forums
Product Info



-Introduction
-DataWeb: What's New
-Creating an Application
-The DataWeb Designer
-Application Management
-Data Tables
-Data Tables
-Views
-Templates
-Components
-Data Analysis
-Members
-Security
-Importing
-Exporting
-FTP
-JavaScript
-Object Model
-Full-Text Search
-Domain and Email Hosting
-HotBlock Modules
-Account Management
-Glossary
-New Responsive UI Module





DataWeb Help
Support Forums
Tutorial
Script Library
Knowledge Base

Home > Support

Support Forum



Nagging Email ScriptQuestion
timesharevalues asked:
You helped us out a couple weeks ago with a question about an email script .  We are deploying it in other areas after the initial success.  Ran into an error message we can't seem to work around.  The application is built from the document library application.

It is executed in After_insert in the wsDocTable, a subdirectory of wsDocLib.  I wonder it the subdirectory status requires this to be pathed.  I have tried that without success. 

The only other thought is whether the script needs to be located elsewhere in the application. 

In advance - thanks


Error Message: Unhandled Exception: Error (Table.Errors.Exception) occurred in '/wsDocLib/wsDocTable/wsDocTable.data' at line 6 -- An exception occurred while trying to select records from table 'wsDocTable'. This exception may be thrown if the table cannot be found or if the user does not have the necessary permissions. Additional Information: Invalid expression 'undefined'.

Script:
function Data_AfterInsert(record, previous)
{
var emailObj = new email();
var note1 = "Internal Tracking Message";
var rs = new Resultset( "wsDocTable", "Title, File", "rowid = " + record.wsDocTable );
if( rs.next() )

emailObj.from = "info@timesharevalues.com";
emailObj.replyTo = "info@timesharevalues.com";
emailObj.to = "manoske@attbi.com";
             emailObj.contentType = "text/html";
   emailObj.subject = "Document Uploaded to Tracking System";
             emailObj.body = "The following document was uploaded to the TimeshareValues Tracking Systems: " + "<hr>" + "<p>"+ "Title: "+ record.Title + "<p>" + record.file = "<p>"+ "Date/Time: " + record.Created.format("view date/time") +"<br>"+ "By: " + record.OwnedBy + "<p>" + note1;

emailObj.send();
}
 
  nicks responded:
  The error that you're getting looks like it's coming from the filter:
"rowid = " + record.wsDocTable

Do you really have a field in the table "wsDocTable" which is itself called "wsDocTable"?  If you do not, then "record.wsDocTable" will be equal to "undefined".
 
  timesharevalues responded:
  Thanks - that was the error.  Appreciate that  
  timesharevalues responded:
  DataWeb considers this issue closed.
If you have additional questions or comments about this issue, please open it again.
If you have questions about a different topic please open a new support question.

Thanks,
DataWeb Support
 
  Please Log On
or create your own DataWeb Account.
Affiliate | Partner | Terms of Use | Privacy Policy | Contact Us | Pricing | Bring DataWeb In-House    
DataWeb, 720 North 10th Street, A #145, Renton, Washington 98057 *425-583-5970* Fax 484-770-4706* Email Us