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

Please chech this script before I use it.


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

Recommended Posts

Hi Vaughan,

We’re using the separation model as you know and the script runs between two TO’s Contacts and Invoices.

Both you and Soren make excellent points, my only problem is having any idea what those points are! :( Could you tell me how I would change the above script to accomplish what we’re all talking about?

Thanks guys and one day I’ll understand all this stuff and be known as the “Ayatollah-of-Rock-n’ Rolla”.

Milo

Link to comment
Share on other sites

#Go to the invoice layout 

Go to Layout [ “Customer Entry” (Invoices) ] 

#Make the invoice 

New Record/Request 

#Push the contact ID from the variable 

Set Field [ Invoices::ContactId; Get(Scriptparamter) ] 

# 

Commit Records/Requests 

[ Skip data entry validation; No dialog ] 

Where the contact ID is the scriptparamter!

But you can even sophisticate it a bit more by using the script parameter in the autoenter when the record is made, this will let omit the set field step...

--sd

Igotit2.zip

Link to comment
Share on other sites

Hi Soren,

First I feel I must appologize for the amount of time we've spent on this one script, but I'm sorry to report I'm still in trouble.

Now the ID number is captured and is placed on the invoice with the new record. The problem is I stay on the Contacts layout in stead of the Invoice layout.

I tried some things to make it work but no luck.

Milo

Link to comment
Share on other sites

No worries, we've all been beginners once and a while ... no need to be so apologetic!!!!!

Zip your stuff an e-mail it to me off forum, and I'll try figure out what's the problem ... you'll find the details in my profile!

--sd

Link to comment
Share on other sites

Hi Soren,

Thanks for making the offer to send my solution over to you. I'm not sure I know how to break it up to accomplish it and thought maybe I could try this one more time.

Let me show you how the scripts are set up.

On the script you made for me above "Post#269546" it is called from my Contacts layout in the Contacts TO. I added the following at the bottome of the script just after your,

Go to Layout (Original layout)

If [ Contacts::NumbergTest1 + Contacts::NumberTest2 = Contacts::NumberTestAnswer ]

Clear [ Contacts::NumberTestAnswer ]

[ Select ]

Go to Layout [ “Invoices-Enter Invoice” (Invoice_Entry) ]

End If

I can tell from the way the script performs that where I've added this presents a problem. I simply don't know where to put it.

The Perform script "Make Invoice" in your script "Post#269546" is exactly as shown in your Post#271239.

Can you see from this what I've messed up and what can be done to correct it?

Milo

Edited by Guest
Link to comment
Share on other sites

Go to Layout (Original layout)

The above could be hardwired to a specific layout, instead...

If [ Contacts::NumbergTest1 + Contacts::NumberTest2 = Contacts::NumberTestAnswe r ] 

Clear [ Contacts::NumberTestAnswe r ] 

[ Select ] 

Waht are you doing here?? You're adding two fields and compare them with a third, why??

--sd

Link to comment
Share on other sites

Hi Soren,

The last field on our sign up layout is "NumberTestAnswer" where two random numbers are shown and here you give the answer. So it would be something like:

"NumberTest1" is [color:blue]3 and "NumberTest2" is [color:blue]4 you must put [color:blue]7 in the "NumberTestAnswer" field to continue.

Since this is the button you click to check that selected fields are not empty and move on to the Invoice layout. I thought this is where it would go. I guess I was wrong hu!

Milo

Link to comment
Share on other sites

Since I already have been naughty and used a $flag variable, could you just put the extra condition in before the calling of the "Make Invoice" script, it's done in a few lines ... if the math doesn't add up set $flag=0

--sd

Link to comment
Share on other sites

Not quite, try instead this:


....

Exit Loop If

End Loop

If [ Contacts::NumbergTest1 + Contacts::NumberTest2 ≠ Contacts::NumberTestAnswe r]

    Set Variable [ $flag; Value:0 ] 

End if

If[$flag]

     Perform Script ["Make Invoice"]

Else

    ....

...remember the scriptparameter!

--sd

Link to comment
Share on other sites

Hi Soren,

Now nothing is working as it should. When I call this script it no longer puts **************** in empty "Must Enter fields" and no longer pays attention to the "NumberTestAnswer". It just goes to the Invoice file and does not make a new record. Here's the script.

Go to Layout [ “Field Validation” (Contacts) ]

Set Variable [ $flag; Value:1 ]

Set Field [ Contacts::ErrorField; "" ]

Go to Field [ Select/perform ]

Go to Next Field

Set Variable [ $stopValue; Value:Get ( ActiveFieldName ) ]

Loop

If [ Length(Filter(Get ( ActiveFieldContents ) ;"*")) ]

Set Field [ "" ]

End If

Go to Next Field

Exit Loop If [ $stopValue = Get ( ActiveFieldName ) ]

End Loop

Loop

If [ IsEmpty ( Get ( ActiveFieldContents ) ) ]

Set Field [ TextColor ( "**********************" ; RGB ( 0 ; 0 ; 0 ) ) ]

Set Variable [ $flag; Value:0 ]

End If

Go to Next Field

Exit Loop If [ $stopValue = Get ( ActiveFieldName ) ]

End Loop

If [ Contacts::NumbergTest1 + Contacts::NumberTest2 ≠ Contacts::NumberTestAnswer ]

Set Variable [ $flag; Value:0 ]

Go to Layout [ original layout ]

Clear [ Contacts::NumberTestAnswer ] [ Select ]

Go to Layout [ “Contacts-Entry” (Contacts_Entry) ]

End If

If [ $flag ]

Perform Script [ “Create New Voter Order” ]

Else

Set Field [ Contacts::ErrorField; "Fields with **** are required to continue!" ]

End If

Milo

Link to comment
Share on other sites

The 3 extra "math" fields should be omitted from the tab order, since they serve a different purpose! In fact all fields needs to get scrutinized if they have anything to do with enty of data or are part of the hacker prevention.

Go To Next Field, follows the established tab-order, which the developer can modify if he/she wishes.

However does your description indicate that the looping is terminated too early, I would say you need to exploit the debugger and dataviewer here.

Further more would it be better that you post screendumps, because the indent's in loops and conditions, would reveal a too dyslexic put End Loop or End If, right away!

--sd

Edited by Guest
Link to comment
Share on other sites

  • 2 weeks later...

Hey Guys,

This is quite a conversation and I can see why it has 1165 posts. It gets us into areas and ways of calculations and scripting that you don't see that often. Now that 9 offers us so much more flexibility to SQL and PHP It's become a real adventure.

Milo I'd like to show you how smart I am by posting some Grandiose script, but the truth is Soren took all the fun out of it by his great scripting, the boy is good, you can tell by his smile! :) Who said it was a smile only a mother could love... :blush2:

All You need to re-dress the script… Woo-Ha-Yee-Ha and just after you got back into men’s clothing. :( We like to keep our comments (did I say Comment) transparent around here so you could make that a Glass dress, now that bare’s looking into! :smile2:

Here's your script and all I've done is changed the location of where the print invoice is called and I think it will work without a hitch.

Live Long & Prosper,

Harry

Change_To_Sorens_Script.jpg

Link to comment
Share on other sites

Hi Harry,

It works, I can’t believe I’ve been pulling my hair out trying to make this work and all I had to do was move the Perform Script step. Wow!

I never did get the script working I was just too embarrassed to send another post to Soren saying “IgotIt doesn’t GotIt”!

I take great issue however, with you talking about my wearing dresses. It was wrong and you were wrong! I never said I went back to men’s clothing! :)

Thanks; I can’t begin to tell you that this nightmare is over. Soren, Harry, everyone thanks so much.

Oops, a wind came in and blew my skirt up. :shocked:

Milo

Link to comment
Share on other sites

I was just too embarrassed to send another post to Soren

C'mon, it's part of the learningprocess not quite to get it the first time around ... this blog has some noteworthy point's to make:

http://www.anecdote.com.au/archives/2006/03/data_informatio.html

Continue to ask, it's not embarrasing - what sometimes could be felt a little tiresom is when context and purpose are kept secret... You Milo have been frank and open about yours, so there is absolutely nothing to hessitate about!!!!!!

--sd

Link to comment
Share on other sites

Hi Soren,

Thank you for the kind message, it was very gracious of you and much appreciated. I will be very happy when I learn more of all that is FileMaker and be able to help other as you guys have helped me.

Harry’s right about the smile, it tells volumes about the kind of guy you are and I’ll even bet you have a white hat! :)

Thanks Soren and all of you that give so much of your time to help others.

Milo

Link to comment
Share on other sites

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