Jump to content

john renfrew

Members
  • Content Count

    635
  • Joined

  • Last visited

  • Days Won

    19

john renfrew last won the day on October 17 2018

john renfrew had the most liked content!

Community Reputation

35 Excellent

About john renfrew

  • Rank
    enthusiast, with a bit of geek
  • Birthday 06/21/1957

Profile Information

  • Gender
    Male
  • Location
    UK

Contact Methods

  • Website URL
    http://attitude.upright-group.com
  • Skype
    rwu2359

FileMaker Experience

  • Skill Level
    Intermediate
  • FM Application
    16 Advanced

Platform Environment

  • OS Platform
    Mac
  • OS Version
    Sierra

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. john renfrew

    SendMail with attachments

    instead of this one line msg.setRecipient(Message.RecipientType.TO, new InternetAddress(to))
  2. john renfrew

    SendMail with attachments

    you need three extra variables, with a list of addresses to send to for TO: CC: and BCC: then something like to.tokenize('\n').each{ msg.setRecipient(Message.RecipientType.TO, new InternetAddress(it)) } //end each if (cc){ copy = cc.tokenize('\n') copy.each{ msg.addRecipient(Message.RecipientType.CC, new InternetAddress(it)) }//end each }//end if if (bcc){ copy = bcc.tokenize('\n') copy.each{ msg.addRecipient(Message.RecipientType.BCC, new InternetAddress(it)) }//end each }//end if
  3. john renfrew

    SendMail with attachments

    Noel depends on which function you are using but something like this... // then the attachment(s) if (attachmentPath) { fl = attachmentPath.tokenize('\n') fl.each{ attachmentPart = new MimeBodyPart() attachmentPart.attachFile(it) mainMultipart.addBodyPart(attachmentPart) //content } //end each }//end if
  4. john renfrew

    SafetyNet for Wasabi

    The Wasabi interface is binary compatible with S3... Cant wait for the European data centre to open....
  5. Pseudo code:: SM Reset Register Groovy Set $var to ChooseFolder Ran once, behind the FM window - I think I reported this previously - and then beachballed next time
  6. Ryan changed the default memory size to 512 and it has worked 3 times and then crashed on the 4th....
  7. Bailey... beachballs straight away on mine MBP17" 10.12.6 FMP 17.0.2 and latest SM Over the years the Swing stuff has given the most problems, apart from some of the really edge case stuff I have done...
  8. john renfrew

    MS sqlserver just got easier

    And for this of you that have read all the way to the bottom....... We can also use this with FileMaker JDBC!!! The parts you need to change are import com.filemaker.jdbc3.J3SimpleDataSource and db = [server:'myserver', port:2399, databaseName:'database', username:'user', password:'pass'] and ds = new J3SimpleDataSource() you do need the file to be shared with JDBC/ODBC and a user account with access privileges.
  9. john renfrew

    MS sqlserver just got easier

    apologies: return '{"error":-1,"error_message":e.getMessage()} is missing a final quote and some + signs, should be return '{"error":-1,"error_message":' + e.getMessage() + '}'
  10. john renfrew

    MS sqlserver just got easier

    UPDATE If you want to the same things with the mysql-connector-java-8.0.12.jar from MySql https://dev.mysql.com/downloads/connector/j/8.0.html the you need to change just three lines in the above import com.mysql.cj.jdbc.MysqlDataSource and db = [server:'servernameorip', port:3306, databaseName:'name', username:'user', password:'pass'] and ds = new MysqlDataSource()
  11. john renfrew

    Getting Error #13 for BaseElements Plugin

    Have you tried inserting it fro URL using the file:/// protocol???
  12. john renfrew

    Export Container doesn't work on FMServer

    There is an issue which I know that 360works are aware of and working to fix with this version to do with the fmpro.getContainerStream method.... It's tricky because some older versions, which do work, might not load properly on Server 17 - those might be fine on FMS16.. Don't think it will be too long before there's a fix.
  13. john renfrew

    Export Container doesn't work on FMServer

    which version of SM???
  14. As promised... With the new ScriptMaster which uses a sandboxed JVM it is now possible to load driver jars at runtime, whereas before they had to be installed in the Java/Ext folder This makes a function to tak to MS sql server possible. Sample code below... Get the jar file referenced from the Microsoft website. As this is from some production code we are using record as the column name for the record index, and the data comes back pipe delimited, but you easily change those... If you leave the find blank it will just return the id of the first record in the list. if you UPDATE it should return the number of rows affected, and hopefully if you INSERT it will give you an array of the record ids that were inserted - use at your own risk obviously... test, test, test. // MS_SQL( fm_query ; fm_find? ) // v4.5 // 18_10_14 JR // performs SQL query on MSsqlserver database and returns fm_find | record // fm_query is SQL statement e.g. SELECT * FROM Table // fm_find{optional} is list of field names to return in answer, and adds 'record' as last value - pipe delimited // requires mssql-jdbc-7.0.0.jre8.jar - this can now be loaded at runtime // assumes a column called 'record' as the ID import groovy.sql.Sql import java.sql.Statement import com.microsoft.sqlserver.jdbc.SQLServerDataSource t1 = System.currentTimeMillis() //edit this for your solution IDX = 'record' db = [server:'servernameorip', port:49513, databaseName:'name', username:'user', password:'pass'] ds = new SQLServerDataSource() ds.setUser(db.username) ds.setPassword(db.password) ds.setServerName(db.server) ds.setPortNumber(db.port) ds.setDatabaseName(db.databaseName) sql = ds.getConnection() Statement stmt = sql.createStatement() answer = al = ex = '' sqlt = fm_query[0..2].toUpperCase() try { if(sqlt == 'UPD') { //update ex = stmt.executeUpdate (fm_query) } else if(sqlt == 'INS') { //insert ex = stmt.executeUpdate(fm_query) } else { //select ex = stmt.executeQuery(fm_query) } //end if } catch (e) { return '{"error":-1,"error_message":e.getMessage()} } //end try if(sqlt == 'INS' || sqlt == 'UPD') { //insert or update sql.close() return ex } else { if(!fm_find) { //default find is 'record' id of first returned answer ex.next() answer = ex.getString(IDX) } else { sqlFind = fm_find.tokenize('\n') while (ex.next()) { for (i in 0..<sqlFind.size()){ //pipe delimited, change last character for \t etc. al = al + ex.getString("${sqlFind[i]}") + '|' }// end for answer = (answer? answer + '\n' : '') + al + ex.getString(IDX) al = '' } //end while } //end if } //end if sql.close() if(!answer) { return '{"error":-1,"error_message":"empty set"}' } else { t1 = System.currentTimeMillis() - t1 } //end if return answer.trim()
  15. john renfrew

    getContainerStream throws error on FMS16

    It is an issue that 360works are aware of, and as I far as I know working on... It affects my work quite significantly, especially now that the older versions do not install on FMS!7
×

Important Information

By using this site, you agree to our Terms of Use.