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

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

Recommended Posts

Posted

Am I missing something? The script is making me "continue" the script twice - pause mode (continue), and find mode (find). Also, the step "show custom dialog" comes in before the find mode so it doesn't work either way.

Set Field [ Publications::gPublicationID; Publications::PublicationID ]

Go to Layout [ "Contact" (Contact) ]

Enter Find Mode [ ]

[ Pause ]

Perform Find/Replace [ ]

[ No dialog ]

Show Custom Dialog [ Title: "Add Individual to Publication"; Message: "Do you want to add " & Contact::ContactDisplay2 & " to the

distribution list?"; Buttons: "Yes", "No" ]

If [ Get(LastMessageChoice) = "1" ]

Set Field [ Contact::gContactID; Contact::ContactID ]

Go to Layout [ "PublicationsContact" (PublicationsContact) ]

New Record/Request

Set Field [ PublicationsContact::PublicationID; Publications::gPublicationID ]

Set Field [ PublicationsContact::ContactID; Contact::gContactID ]

End If

Go to Layout [ "Publications" (Publications) ]

Thanks in advance.

Edited to add - if i break up the script after go to layout, perform the find manually and then manually start the second half of the script it works fine?? confused.gif

Posted

Make sure the Enter Find Mode [] step really, really has "pause" unchecked.

Posted

Sorry, I probably needed to clarify. It has to pause once because the user then needs to input their search criteria. The problem is it a) then pauses AGAIN before executing find mode and : runs the custom dialog before being able to click on find.

Posted

If you have "Enter Find Mode [pause]" then you DO NOT need another "Pause/Resume Script" step directly after it. This will make two pauses.

Posted

I don't see two pauses in your script; however, I see no Set Error Capture [On] nor a test if no records found. If no records are found during your find, FM with ask you if you wish to continue. Is this what is happening?

Posted

I think you misread my post Vaughn (sorry it's hard to put it in words on a post). I don't want another pause resume script. What I am saying is with the current enter find mode [pause] it is pausing twice. It should only pause once [user enter data] then perform find and continue with rest of script.

Moonshadow - I will add in the error capture. But there is one record returned. As I said, if i split it into two scripts - i.e perform script 1, search for the document, perform script 2, it works perfectly. This should thus be replicated by simply adding in the steps enter find mode[pause], perform find, and yet when i add the script 1, find steps and script 2 together it automatically adds an additional pause which shouldn't be the case.

Thanks.

Posted

The results you say you are getting are in conflict with the script you listed. In fact, there is no Perform Find [Replace] in 7. There is no way the Show Custom Dialog could be coming before the Find, unless ...

I'll bet that New Record/Request is generating a new find - again. frown.gif

Posted

I'm not psycho I promise Moonshadow. It's definately pausing twice.

hmm so perhaps I need to create a new blank record early on and put a flag on it, go and ask the user did they want to add it in, if Yes add the data in, if no go and delete the newly created blank record??

Posted

Don't solve your problem by complicating it. I repeat, there is no Perform Find [Replace, no dialog]. Are you sure you haven't selected something improperly? Can you post your file?

Posted

This is what you posted:


Enter Find Mode [ ] 

[ Pause ] 

Perform Find/Replace [ ] 

[ No dialog ] 

Show Custom Dialog [ Title: "Add Individual to Publication"; Message: "Do you want to add " & Contact::ContactDisplay2 & " to the 

distribution list?"; Buttons: "Yes", "No" ] 

I find it ambiguous. I read this as:

Enter Find Mode [] (no pause)

Pause/Resume Script []

Show Custom Dialog [yada yada yada]

The steps above will enter Find mode then pause; after clicking Continue the custom dialog will display.

If you have the "pause" option selected in thew Enter Find Mode step you will get two pauses: one from the Enter Find Mode step, then another from the Pause/Resume step. Two pauses. Twice asked to continue the script.

That is why I asked you to make sure the pause option is not selected in the Enter Find Mode step.

Posted

You have an error in your script-step...

You are using Perform Find/Replace [ ] as I suspected and have actually done before. smile.gif

The tipoff is you are using 7. And in 7, unlike prior versions, the Perform Find [ ] no longer has an option to Replace. Neither does Enter Find Mode [ ]. So when you said Replace, I was suspicious.

Nice looking solution you have there, by the way. wink.gif

Posted

I get it... "Perform Find/Replace" which changes text inside fields, instead of "Perform Find" which searches for records matching the criteria.

Well spotted Moonshadow. The two steps should be given names that are less alike to avoid confusion.

Posted

Vaughan said...The two steps should be given names that are less alike to avoid confusion.

Agreed.

Kiwiora, I changed it to Perform Find[] and it works correctly. However, you will also want to add Set Error Capture [On] and trap - because I just received FM's good 'ole standard error dialog when no records were found. smile.gif

And I noticed you have used this script-step instead of Perform Find [] through several of your scripts. Did I mention I like the way you design? smirk.gif

Posted

Kiwiora -- praise indeed from Moonshadow!

Are the rest of going to be given a chance to be similarly impressed? ;-)

Posted

Yeah, well, I notice we all read right by his original post of Perform Find/Replace a couple of times! biglaff.gif

Sometimes we see what we expect to see; something I fight daily.

Make 'em wait, Kiwiora, it'll be worth it. yep.gif

Posted

Doh,

Replaced Perform find/Replace with the little sucker Perform Find and hey presto it works. I wouldn't have thought to go searching for another perform find!! I got into the same "New to FM7" trap remembering to script it to go to appropriate layouts to get a table.

Thanks for the compliment - it's not finished yet (although about 80%). If you have any critique please feel free as it's my first real big nasty FM7 db i've done. All the rest have been pretty easy sailing. I had a precise brief to have to use the company colours which is pretty lousy as far as layouts go but i think it looks pretty clean and modern i guess.

Sorry for the confusion Vaughan - Thanks' anyway. It's just the way scripts get printed to pdf - i.e it's really enter find mode[pause] but for some reason it prints it as [] and pause on the next line. It now reads:

Set Field [ Publications::gPublicationID; Publications::PublicationID ]

Go to Layout [ "Contact" (Contact) ]

Enter Find Mode [ ]

[ Pause ]

Perform Find [ ]

Show Custom Dialog [ Title: "Add Individual to Publication"; Message: "Do you want to add " & Contact::ContactDisplay2 & " to the

distribution list?"; Buttons: "Yes", "No" ]

If [ Get(LastMessageChoice) = "1" ]

Set Field [ Contact::gContactID; Contact::ContactID ]

Go to Layout [ "PublicationsContact" (PublicationsContact) ]

New Record/Request

Set Field [ PublicationsContact::PublicationID; Publications::gPublicationID ]

Set Field [ PublicationsContact::ContactID; Contact::gContactID ]

Set Field [ PublicationsContact::ManualFlag; "1" ]

End If

Go to Layout [ "Publications" (Publications) ]

Now all i have to do is write in the error capture and statements around how many records found. yahhh

It's always the simplest of things that get you stumped for the whole day.. it's now 4pm and how easy was that.. lol laugh.gif

Thanks guys.

Posted

Just by the way - I hate the way they now call it "Last Message Choice"... isn't it my current choice? lol

AND i hate how when you specify a button to perform a script you then have to click again to select the script... useless second step...

AND i wish you could duplicate a table....

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