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

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

Recommended Posts

Posted

I have created an elaborate field export script that seems to work fine. It seemed a monumental task compared to this I now can't seem to figure out...

I run into trouble trying to prepare the content for export - my steps are:

Modify Last Find - this works and finds the records based on the field I want - which happens to be the first in the layout.

I then want to sort the found records by my Date field in ascending order and when sort is done, go to the First record.

Sadly, FM fails to perform the Sort at all. No Idea why. Sorting works manually and as a separate script - saving the criteria and choosing "perform without dialog" circumvents the dialog...

But I now have 3 scripts instead of just one - one to find, one to sort and go to first record and the last to export the found and sorted... Ideally, I want my script to ask which section I want to export (my find criteria - a single field), allow me to choose the find parameter in that field and then execute the rest without any interaction from me.

Help greatly appreciated... it feels like the solution must be really simple.

Thanks

Manca

Posted

This is very basic but should do what you want. I can elaborate if you like.

Go to Layout["layout name"]

Enter Find Mode[pause]

//Allow the user to enter find criteria, pressing return or enter will continue the script.

Perform Find

if [ Get ( LastError ) = 0 ]

Sort

Export

end if

Posted

Since you are on a Mac, print your script to Preview, and copy and paste it into a Reply, so we can see it.

It's odd that your sort isn't working, are your sure that it is really a Date and not a text field (if it is a calculation, then be sure that you have this as a type Date).

I'm not sure why you have to do a modify last find, but maybe that will become clear when we see the script.

HTH

Lee

Posted

This is what I have:

Modify Last Find

Sort Records [ Specified Sort Order: Bob Howard Content::RecordDate; ascending ]

[ Restore; No dialog ]

Go to Record/Request/Page

[ First ]

I verified the RecordDate field is indeed of type Date.

Thanks

Manca

Posted (edited)

OK, you suggestion worked. Still not sure why my script stops... I am now able to do it all on one script, thanks!

The only thing I modified from yours was - I added a

Go to Record/Request/Page [ First ] command so the Export happens from page 1 in found set.

On a semi-related note - do either of you know if FM Pro is capable of creating folders at the export destination? It would be easier if I could have it create any specified folders in the file path - now if they don't exist, the script fails. So currently, if I want to be certain I am working with the latest version of the export, I have to replace my folder structure with an empty one and then re-export. If I could just erase and have Fm replace missing folders, that would be neat... You know, the way a Unix command creates the destination if none such exists and replaces it if it does.

Manca

Edited by Guest

This topic is 5582 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.