Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 2654 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted


I put a Triggered Script on a Container Field (in a portal row record) to run when it Validates (OnObjectValidate) and while it runs fine if I use the Insert File command to put content in the container if I just Drag and Drop the Triggered Script never runs. In other words am I correct in saying Drag and Droping content into a container field wont Trigger a script to run?



Any suggestions for a work around?

Posted

Yes I did try other Triggers (not all them because some of them made no sense for what I was trying to do). Since loading the container field creates a new record I also tried attaching the trigger to a calculated field that calculates when that happens and that didn't work either.

Posted

Dragging and Dropping into container fields works fine. That's no problem.

BUT, if you attach a Script Trigger to that container field is wont run (it isn't triggered) when you drag and drop your file into that container field.

It does however work (trigger the script) if you use the Insert File command instead of drag and drop to put file in the container.

That's what perplexes me.

Posted

I guess I didn't say it very clearly, but I have run a script on drag and drop to a container field and that link I gave you should have a simple file that shows how to do it.

  • 2 months later...
Posted

Well, its not just Container Fields that have this Drag & Drop problem the problem is intrinsic to Drag & Drop data entry period.

 

Okay I created a small sample file that illustrates the Drag & Drop problem I'm having.

 

In this example I have a marketing research file name Companies.fmp12. You enter the name of the company you want to research and click on the 'Google Company Name' button and it opens up a search page in Google for that 'Company Name'.

 

Companies.fmp12.zip

 

You would then open in the browser the pages you're interesting in attaching to the record and then Drag and Drop the URL form the address bar into the URL field (the first field with a bold red border).

 

Each portal row URL record has a field called 'URLs_DisplayOrder' which has been set to Auto-enter the Calculation: Get ( ActivePortalRowNumber ). While the Auto-enter Calculation works fine when you type text into a field or paste text in when you use Drag and Drop into a field it returns a value of '0' so I attached a Script Trigger to those fields bordered in red to run on 'OnObjectValidate' to set the value of the 'URLs_DisplayOrder' field to the portal row number.

 

If you're running Filemaker Advanced and run the file with the Debugger on you can see that when you Drag & Drop the URL into the field the script is never triggered but it works fine when you just copy and paste the text.

 

Drag & Drop doesn't let the portal record set the 'URLs_DisplayOrder' naturally and while it does trigger the script the script doesn't behave like it should and set the 'URLs_DisplayOrder' field correctly.

 

I added a Container field with the same trigger to illustrate how the same problem with Drag & Drop occurs with it too. 

 

Can anyone explain what's going on here?

Posted

I've run into this same problem trying to implement some novel mechanics into our solution; script trigger won't go off from drag and drop but will work from Insert File.  

 

This has got to be a bug.  However, I'm guessing there aren't many people trying to trigger scripts off of a container drag/drop in a portal, so I wonder what the odds are of it ever being fixed.  I'm running 12 by the way, and the bug is still present.

 

If I come up with any workaround, I'll be sure to share.  Feeling a little stopped dead in my tracks at the moment however.

 

**edit**

 

I found this information:  http://forums.filemaker.com/posts/e341abaa0e?lang=en_US

 

Note that this is a conversation from 2009.  Apparently there was some philosophical debate about whether drag and drop should trigger a script.  And this is for an OnObjectModify script.  I don't really get the logic...the drag and drop will clearly be modifying the field in question, just as right clicking and inserting would.  But there you have it, it appears this is an old bug that FM has declared to be 'working as intended'.  There may be some plugins that can do this, but I wouldn't count on any native functionality.

  • 4 years later...
  • Newbies
Posted

Paradigm I found a workaround for this b/c it was annoying me that it wouldn't trigger properly.

I created a SELF join and sorted the New Occurrence by the modification timestamp.

As soon as you drag drop into the container the modification timestamp changes as does the sorting.

This allows you to pull the record id and any other information that you would want to use in your resulting script trigger.

Apply it using the onModify script trigger to the Container.

May be a little late but someone else might find it useful.

This topic is 2654 days old. Please don't post here. Open a new topic instead.

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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