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

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

Recommended Posts

Posted

Hi. I am new to this board. I am not new to Filemaker but I am not real knowledgable about scripting. Can you help me with this?

I have a database of many records and I have put a check box in it called "Advertiser".

What I need is for whenever anyone checks that box on any given record, a script will automatically add the text in the "account name" field from that record into a value list that they can choose from on another layout. Is this possible and how do I accomplish this?

Ron

Posted

Hi Ronzues,

If I understand your question, you won't need a script, but rather can have the new Value List update automatically by using a calculated field.

Create a calculation (text, index ON) with the following:

Case(not IsEmpty(Advertiser), AccountName)

Only Account Names with the Advertiser checked will appear in this calc field. Then create a new Value List, select 'Use values from field' and point to this new calculation. This new Value List will update with the Account Name every time the Advertiser checkbox is checked or unchecked. smile.gif

LaRetta

Posted

Hi Ron,

I'm not totally clear on what you are trying to accomplish. I would Usually use a calculation in the "account name" field that was based on the answer in "Advertiser", Others would look to make it a relationship smile.gif (Ugo)

Any how, why a Script?

Maybe a little more information as to what is in the two fields will help to determine which way to lead you.

Is Advertiser a list already, are there a list of account names already? Are the two fields in the same file?

HTH

Lee

Posted

Oops,

Took to long and typing my reply and LaRetta beat me to the punch.

Lee

smile.gif

Posted

Thank you very much LaRetta. That did the trick. I will definitely be checking in with you guys often. You are on the ball.

Ron

Posted

Of course Lee, no need for any calculation here.

Just use the field "Advertiser" as a key for a conditional value list, so you would be able to select either those selected or not.

The value list would therefore be more dynamic. grin.gif

Posted

Well Ive been readin about valuelists and they sounded confusing. This sounded easy to me and it worked when I tested it with creating a calc of sales. As staff enters salesguy in one popup and radio button commitment done. Popup on payroll form shows view salesmen to process only.

i think my mind is reeling with ideas on it. Its like filtering popups. question - can you put anything in a popup? I mean I know you can with custom but I mean the other options.

Pete

Posted

Hi all,

Still no need for any calculation in this situation.

A Self-Relationship with the "checkbox" field (flag field) at left side and right side, within the same file and a related value list using the newly created Selfjoin would be sufficient.

If this VL was to be used from another file, the SelfJoin would be substituted by a classic relationship (either with the flag field, or a global field if isn't there)

As my post was a quick "joking" answer to Lee, I should correct the following though :

As Ron has only one value to be checked, there would be no way to have a Conditional VL here, except if you were restricting the Value List to unused values

Posted

LaRetta,

I have done what you said and it seems to work great except for one thing(and of course I probably did something wrong). Whenever I check a box it adds to the value list but whenever I uncheck the box it doesn't remove the entry from the value list. What could be the culprit? Also, this same value list that is created and modified by the check box will eventually need to show up in a field in a seperate database. What is the best way to do it? I have it doing that right now but I don't have enough faith in myself to think that I have it working the best way.

Ron

Posted

Hi Ronzues,

The fact that your Value List is still displaying indicates that you have two values in your checkbox instead of just one. Yes/No, Y/N or 1/0 or (?). Since the calculation I provided checks to see if the Advertiser field is blank (OFF), and your checkbox contains a value regardless, this won

Posted

Thanks LaRetta!

I have the value list in the seperate database working the way that you just described so I will leave it alone. However, I will try your other option for the calculation as soon as I get a chance. Just so you have a little more info on the checkbox field: I created a checkbox field that points to a value list that only has 1 value "X". Therefore, they click to put an x in the box, or they click again to remove the x. In this case do I still need to make the change that you suggested to correct the problem?

Ron

Posted

Hi Ron,

No, you don't need to modify the calculation if you only have one value in the Value List - regardless of the value. Something isn't right. This process does work.

"I created a checkbox field that points to a value list that only has 1 value "X"." I thought this part already existed! Check the raw data in the field and make sure it only contains X or nothing.

Are you sure you attached the new Value List to the pop-up and not the old? Also, you mentioned "I have the value list in the seperate database." Be sure you are referencing the correct Value List. Double-check everything and let me know!!

LaRetta

Posted

Hi,

If really you have more than one value in this "checkbox" field, then it's not a flag anymore and gives even more credit to the SelfJoin solution. laugh.gif

using a calculation allows more flexibility in most instances. If using a self-join based upon the Advertiser field, no further control would be possible. If conditions change, a calculation would be required regardless and the join would also need to be changed to join on the new calculation. The Value List would also then need to point to this new calculation.

Sorry for this LaRetta, but a calculation is surely less dynamic than any SelfJoin. According to the situation, this SelfJoin could either use for the left side :

- a fixed global field populated with "Advertisers".

- a value list of those related "checkbox" values

- an auto-entered text field with the previous value list attached to it.

The Customer VL would therefore be conditionned by the left side key.

No calculation needed, still !! tongue.gif

if FM would allow a join on more than one field
Posted

Well, how do I say this ...

- a fixed global field populated with "Advertisers".

- a value list of those related "checkbox" values

- an auto-entered text field with the previous value list attached to it.

All add again to the complexity of the solution. How are you going to populate that global? How would you update it? Script. A Value List of a Value List? Interesting! Add a text field? Nah.

But it's good that you have a different opinion smile.gif It keeps me entertained! grin.gifgrin.gif

LaRetta

Posted

Ugo,

I want you to know that I am not ignoring your posts. I am reading them and trying to understand them, but at the time, I needed to get something working fast and LaRetta gave me a detailed solution right away so that is what I went with.

Ron

Posted

LaRetta,

A different opinion ? Nope. Simplest solution... wink.gif (at least this time...)

- In this instance, a single "Advertisers" in a global text field. That's all is needed.

- In other instance, when you want some dynamic list, a value-list of the "checkbox" - no problem, and still no calculations.

- In a tabbed interface, a single script in the tab (Customer/Supplier/Tax/Other) setting the global to the category and you'd be presented with the found set required.

Seems to me rather complex to implement a Case calculation in the related file, when all you have to do is find a match field in the related file.

Posted

I have a great suggestion, Ugo! Why don't you start your own Forum ... then you can post all your perfect solutions and demos (do you have them all fixed now?) for people just to pick from. Bookmark indeed. Take the helmet off - it's no longer fitting your head. grin.gifgrin.gif

LaRetta

Posted

Good god LaRetta,

I retain Friday as my best day, before a Sunny week-end...

Forget about it. It's surely not my style. I was really happy for these exercises. As you said, but I though you were serious, it IS interresting to have some different opinions. Did you lost your gremlins on your browser ?

You know I learn as well from your posts as from all others here.

About the demos. I'm VERY pleased to share the work I'm doing. I'm part of a community here, and only sharing what I've earned from all the posts HERE. I spend some time on them, and feel like they may be useful.

What kind of guy do you think I am ?

I really don't get it LaRetta ?!!!? What got you so upseted. Should we start a PM for this one....

Posted

Thanks for everyone's help. I got the value list problem solved. I had the calculation field created as text, auto-enter calculation instead of an actual calculation field. When I made that change it all worked just fine. You guys are great.

Ron

Posted

hi LaRetta

I read in your response to Pete that it is possible to assign 2 value lists in the same field. What you mean is that it can be done in different layouts or in one layout? In that case, you mean that i must have 2 occurences of the fielg in my layout, or is there another way?

Thanks

Posted

Hi nlo,

You would need to place two occurances of the same field. You can then attach different Value Lists to each. They can be placed in different layouts, or on the same layout (as in Gender field) - makes no difference. Both value lists will insert data into the same field because Value Lists are just a display of options.

You could set up a calc for a value list which limits what is displayed or use relationships. Maybe in one layout, you want all salesmen listed in the popup that Users can select from (because they need to choose from ALL salesmen). Maybe in another layout, you want only the TOP salesmen listed (because otherwise the list of Salesmen is too long to be easily used) and those Users only care about top sales info. Or you want a pop-up of Salesmen who need to be paid their commissions?

Create one Value List called All Salesmen and use values from field SALESMEN. Create another value list called Top Salesmen and point to a calc (create calc first, text INDEXED): Case(TotalSales > 100, SalesmanName). It allows filtering of the pop-ups.

Taking that further ... if you have several different fields (like questionaire example above) in which you need to insert a Salesman's name, you could create just ONE value list (All Salesmen) and attach that one value list to each field that you want salesmen names to appear in.

A Value List is extremely powerful because it can become: A multikey for n:n (many-to-many relationships), a list of script steps (global list that performs an operation on the first item, removes it and loops) and also adds the ability to store a mini-db within a field. Utilizing the ValueListItems() functions, it's quite powerful.

If you have a specific example of how you're thinking you may use this, we could clarify it further for you smile.gif

LaRetta

Posted

Hi LaRette,

thanks for the answer.

I didn't know that i can use value lists in these ways. I tested the filtering technique and i think its very usefull. This time, I am working on an educational project, and i think that i can make some changes in its structure.

Something more now. You wrote:

A Value List is extremely powerful because it can become: A multikey for n:n (many-to-many relationships), a list of script steps (global list that performs an operation on the first item, removes it and loops) and also adds the ability to store a mini-db within a field. Utilizing the ValueListItems() functions, it's quite powerful.

Does that means that I can use a value list to create a pop-up menu in my solutins? In that case, how can i assign a script in each item of the value list? Or can i create hierarchical selection like:

[color:"blue"] Provider[color:"white"]- - - - Equipment[color:"white"]- - - - Part

...[color:"white"]- - ------------- - ...[color:"white"]- - --------------- - ...

...[color:"white"]- - ------------- - ...[color:"white"]- - --------------- - ...

Apple --------> PM G4 --------> Power Supply

...[color:"white"]- - ------------- - ...[color:"white"]- - --------------- - ...

...[color:"white"]- - ------------- - ...[color:"white"]- - --------------- - ...

Thanks in advance

nlo

Posted

Hi nlo,

The answer to each of your questions is YES! Check out CobaltSky's website at http://www.nightwing.com.au/filemaker/, particularly the section on 'Working with Lists and Values.'

I believe what you describe as 'hierarchical selection' is the Conditional Value List example. You can create three Value Lists (Provider, Equipment & Part) based upon values from the fields and Equipment will display only a specific Provider's equipment, etc.

Examples of scripted pop-ups for scripts and layouts are in 'Finesse and Added Value.'

I suggest you check out some of these demos to get an idea of what is possible and what you want to accomplish. Then, if you run into a snag in implementation, post a new specific question.

In truth, all things are possible with FM with a bit of lateral thinking. How you accomplish it will depend upon your specific needs. smile.gif

LaRetta

Posted

Hi,

Does that means that I can use a value list to create a pop-up menu in my solutins? In that case, how can i assign a script in each item of the value list?

Once the "category" is selected from the Main VL, the other values would be selected according to the first one (automatically).

No script involved (at least for the Value List).

Note that for a Demo purpose, CobatSky's uses a global field as the category switch, and a custom Value List.

Yours could also be a text field and a "dynamic" value list (which value would come from your db fields)

Another cool sample have been released by DJ, and demonstrate how to create related records involving conditional Multikey VL.

Conditional VL in portal .

Posted

Hi LaRetta, Hi Ugo

Thanks for the links. Now I am trying to understand how they work.

I'll be back soon

nlo

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