Newbies Diego DAlessio Posted August 26, 2010 Newbies Posted August 26, 2010 Hello Folks! I came back from DevCon very enthusiastic with my iPad and FileMaker Go. I wrote a custom function that I thought would be a great time saver. It returns if the Ipad or iPhone is in portrait or landscape mode (it can be downloaded from http://www.solucionesfilemaker.com/demos.html) The thing is that now I want to attach a script trigger to the function and it does not work On objectModify does not work at all. Any ideas? Best Wishes, Diego D'Alessio Buenos Aires - Argentina (the southernmost FileMaker Developer of the world?)
bruceR Posted August 26, 2010 Posted August 26, 2010 You are leaving out important information. You do not attach a script trigger to a function - you attach a trigger to a layout object and you designate a script that will be performed. What object did you attach the script trigger to? What user action modifies this object? What does the script look like? Do you know how to use script triggers? Can you post a copy of your file?
Newbies Diego DAlessio Posted August 26, 2010 Author Newbies Posted August 26, 2010 Hello Bruce! The function is called from a calculation field and yes, I've been using script striggers since day 1. The .fp7 can be downloaded from www.solucionesfilemaker.com/demos.html Thanks! DD
bruceR Posted August 26, 2010 Posted August 26, 2010 (edited) Hello Bruce! The function is called from a calculation field and yes, I've been using script triggers since day 1. The .fp7 can be downloaded from www.solucionesfilemaker.com/demos.html Thanks! DD But you did not answer most of the questions. The script is never called by anything. The script has an additional problem; it tries to change the value of a calculated field. There are no script triggers in your file and there is no object which has an "OnObjectModify" trigger attached to it. Edited August 26, 2010 by Guest
David Jondreau Posted August 26, 2010 Posted August 26, 2010 Bruce is right, you've got a function, being evaluated in a conditional formatting calculation box. I don't see how you're using this function to trigger a layout change. And I don't see how you can trigger script that calls this one a device orientation change.
Newbies Diego DAlessio Posted August 26, 2010 Author Newbies Posted August 26, 2010 Hello, at www.solucionesfilemaker.com/downloads/rotate-2.fp7 there is the script attached to the field. Best wishes, DD
bruceR Posted August 26, 2010 Posted August 26, 2010 (edited) Hello, at www.solucionesfilemaker.com/downloads/rotate-2.fp7 there is the script attached to the field. Best wishes, DD You can suppress the error with an exit script [ false ] statement. You can trigger it by trying to type in the calc field; but it still isn't clear what you're trying to do. You state "You can use this function , for example, to switch layouts via script triggers." but that isn't true. Or - to be more precise - the layout switching cannot occur if the only thing the user does is change orientation. We do not have a native script trigger for window changes so nothing except conditional format appearance of the text is going to happen if the only thing the user does is rotate the device. Edited August 26, 2010 by Guest
Newbies Diego DAlessio Posted August 26, 2010 Author Newbies Posted August 26, 2010 You can suppress the error with an exit script [ false ] statement. You can trigger it by trying to type in the calc field; but it still isn't clear what you're trying to do. You state "You can use this function , for example, to switch layouts via script triggers." but that isn't true. Or - to be more precise - the layout switching cannot occur if the only thing the user does is change orientation. We do not have a native script trigger for window changes so nothing except conditional format appearance of the text is going to happen if the only thing the user does is rotate the device. Gee... So the answer to my question seems to be "yes", I wrote an almost useless function. I assumed that, as the content of the field changes I was going to able to attach a script , 'onObjectModify' and voilá, Change to x Layout. But, as ObjectModify does not works with calculation fields, the end goal of my function will be almost impossible to achieve. Thanks Bruce!
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now