Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Very nice. I would add a few things.

In the Totals script, add Allow User Abort [Off] to the beginning, so users can't click the Cancel button when the report previews; remove the Enter Browse Mode step and add Close Window [Current Window] and Adjust Window [Maximize] steps instead, so that the report is closed and the main window isn't half hidden. Add an Adjust Window [Maximize] step just before the Halt Script in the Cancel and Return script. And I wouldn't tile the windows in the Invoice Summary script, because the criteria window isn't large enough. I would either Adjust Window [Maximize] or Adjust Window [Resize to Fit] when the new window is opened.

  • Author

With the way I have it set up now, it solves my problem without too much effort. Now I need to start focusing on how to make reports that will print well, and include print buttons on the layouts. Then I also want to make sure that the user is prompted when exiting the program to make a backup. Maybe even automatically if possible. After that, I plan on setting it so the layouts cannot be changed unless I log in. That should do it, unless I think of something later. I will be working on that next, and beg for help if I get stuck. (Highly Likely)

A couple questions though (What a suprise?)

1) When I use scripts to open a new window, like for the help screen, the original screen changes shape. Why?

2) Is there a way to have my phone number fields force the data into a format like (661) 555-1212? I am sure there is, but I don't see this option

3) If I want the Membership status to fill in with certain text color or fill color, Do I make a field and put it behind the status field, so it looks like it is changing when it really isn't?

Thanks Dave

  • Author

Thanks -queue-

I will look at it when I get home tonight. I think we posted the last one about the same time.

Dave

1. You're using the Arrange All Windows step, which is going to resize all open windows so that they all fit on the screen simultaneously. This is what I meant when I said I wouldn't tile the windows.

2. Yes, but it's much easier to use an auto-enter calculation that overwrites the entered data with formatted data and has 'Do not replace existing value for field' deselected. This has been discussed during the last week or two. I'm sure you can find a thread that will give you an explicit formula to use.

3. If you want a different text color to be used depending on what the status is, this can also be accomplished using an auto-enter calculation and was discussed within the last day or so on another thread. A different fill color will require a calculated container field that uses global container fields (or repetitions from a global container) to use the correct color (or none) depending on the status. Case( Status = "this"; gRed; Status = "that"; gBlue ) This field would be stacked below the status field, and the status field would be set as transparent.

  • Author

1. That makes sense

2. I found it. "(" & Left(CONTACT_PHONE_NUMBER;3) & ") " & Middle(CONTACT_PHONE_NUMBER;4;3) & "-" & Middle(CONTACT_PHONE_NUMBER;7;4))

Just so I understand it, the Middle(CONTACT_PHONE_NUMBER;4;3) is saying start with the fourth character from the left and give me three characters? If that were true, 1234567891 would work right. But if the user types 123-456-7891, then it would return (123) -45-6-78

3. I will try this, but why a global field? Does a global field mean it can only have one value? Sounds right.

Thanks again,

Dave

2. Use the Filter function first, to clear out non-numeric characters. Let( P = Filter( CONTACT_PHONE_NUMBER; "1234567890" ); "(" & Left( P; 3 ) & ") " & Middle( P; 4; 3 ) & "-" & Middle( P; 7; 4 ) ). Then it doesn't matter what extraneous characters are entered, because they will be ignored.

3. Global field values are the same for every record in a table. So you can create a box in Layout Mode with the fill/border color you want, copy it, then paste into a global container field in Browse Mode, and it will be available to all records. Otherwise, you would have to copy and paste into a normal container field for every existing record, and do the same for each new record that is created. It also takes up much less space, because it only has to be 'stored' once.

  • Author

Thanks alot,

I have uploaded the current file, if you would please take a look. I got the phone number thing to work out. smile.gif

I also tried the container bit, but it doesn't seem to work. Could you see where I have gone wrong?

Thanks Dave

I wouldn't make the container calculation an auto-enter. I don't think container calcs work that way anyway. Change it to a calculation field. Also, format the field's behavior so that it does not allow entry.

  • Author

Thanks -queue-,

That was the problem, I changed the field to a calc, no entry, and it works fine now.

Question, I found several places where they talk about validation, but most disscusions assume you know how to do it. I, of course, can't figure out this simple task.

How do you set validation to check for multiple items.

Lets say you wanted, field must have a @,(anywhere in the field), at least 4 numbers, and no j's, k's or l's. Can you do all this on one field?

I would think that this would be simple, and I am sure that it is, but how?

Thanks Dave

You want to validate based on a calculation. Using your example,

Position( field; "@"; 0; 1 ) and Length(GetAsNumber(Substitute(field; "0"; "1" ))) > 3 and not PatternCount( Upper(field); "J" ) and not PatternCount( Upper(field); "K" ) and not PatternCount( Upper(field); "L" )

would work as a validation.

  • Author

Thanks again,

Position( field; "@"; 0; 1 ) "You would think it would be as simple as 'must contain(@)' or something similar. In reading the help file, I can't make sense of what exactly his is saying. What does the 0;1 mean?

and Length(GetAsNumber(Substitute(field; "0"; "1" ))) > 3 On this one I see that it has to be greater than 3, but once again there is a 0;1 ??? If you are saying that the filed has to be greater than 3, why the 0;1? Does that somehow designate numeric values?

and not PatternCount( Upper(field); "J" ) and not PatternCount( Upper(field); "K" ) and not PatternCount( Upper(field); "L" )

This part makes sense, except this would only rule out capital J,K,and L? I thought that was what Upper meant.

Thanks -queue-

Dave

You could also use PatternCount( field; "@" ) in place of the Position function. They don't mean exactly the same thing, but what you're looking for in a validation is only a 'yes or 'no'. A zero would be 'no' and any other value would be a 'yes'. What the Position function does here is test whether "@" is present in field, starting at the 0th character and looking for the first occurrence. If the test is true, then it will return the first position of the @ in field. For example, if @ were the third character in field, it would return 3. If the test is false, then it will return zero and the validation will fail.

GetAsNumber("0a0b0c0d1") will return 1. By converting the zeroes into ones, using the Substitute function, we ensure that the leading zeroes will not be ignored. GetAsNumber(Substitute("00001"; "0"; "1" )) returns 11111. Since we are testing for at least 4 digits in the field, this ensures we account for all possible leading zeroes and don't return a false value.

Upper(field) converts every letter character in field to a capital letter. This allows us to test only for "A" instead of "a" and "A", etc. and still have the correct result.

  • Author

I went back and changed the body to the fields I wanted, instead of using a portal, and it worked. I am not sure if I am just working around the proper solution, but it works.

That way I do not need a second table with a self-join.

,

Why on earth can't the help section explain things like that? Then I wouldn't have to ask so many questions. I have tried to find a book that teaches all these calculations, and I have two already, but none explain it well or show examples on how or why you would use them. I think they just assume you are a programmer, and it should make sense.

I created a new layout to show all invoices, just like the portal in the client/invoices layout, except I want all the invoices. So I created a self-join with the invoice table, and tried to make a portal. It only shows one record. So I changed the fields back to the original invoice table, no luck. You would think by now, I would get this:(

I have the latest table, if you have the time to check it out.

Thanks as always,

Dave

If you want to show all the invoices in a portal, you need a relationship using the cartesian join (X) operator. This matches every record in both TOs to each other. Your relationship uses the = operator, which will only match one record to itself, where ID = ID.

You don't need a portal in this case though. Just put the Invoices fields on the layout and change the layout to View as List (View -> View as List, in Browse Mode).

The online help does explain the functions fairly clearly and provides examples to demonstrate how they work. It just takes practice figuring out how to combine functions efficiently, to produce the desired effect. I've learned the most from John Mark Osborne's site and from downloading all the sample files Ugo, DJ, Ray, Vaughan, Bob Weaver, and other gurus post on this site. There are so many possibilities for usage with each function and combination of functions that no one book could describe them all or list ones that would be specific to your solution. That is why we have these wonderful forums for such things.

Don't feel bad for asking all of your questions. If you don't ask, you may never learn. After all, that's why we're here, to help answer them. smile.gif

  • Author

I see.

That is what I figured out after awhile. Since there is not a common field for all invoices, there would be no way to show them all with a portal, unless I was to make a field and put the same value in it for all invoices, then base the search on that.

So I did what you said and made the fields, and then went to list mode.

I put all the header info in the header, and only one line with the fields in the body. That seemed to work. Now comes the another problem. I decide to put a total in a trailing subsummary. Well that sounds easy enough. I take the Total field and put it in the trailing subsummary, nothing happens. Not only does nothing happen, I don't even see the trailing subsummary, as if it is invisible when I show the list.

So then I figure, I guess I can't just use the total field, put it in the subsummary and let Filemaker do the rest. Maybe I must have a summary field in the subsummary. Well that didn't work. So no luck on that so far.

Second, I was wondering if Filemaker has two capabilities that I can't find. One feature that would be nice is in layout mode, I could select any field, button, graphic, etc., hit a certain key, and it would show me everything about the selected item. (i.e. I select a field, click whatever, and up comes what field it is, its attributes, any calcs or formatting assigned to the field on this layout) That would be nice. Another nice thing would be to be able to have a field on a layout, and make it invisible in browse mode. This would be handy, especially while you are still working on the DB.

I see that alot of people on here are posting that they are having trouble making fields transparant. I thought that was just a matter of clicking on the top left choice that looks like 2 hollow squares under the fill tools. Maybe they are talking about earlier versions that didn't this. Or I just don't understand what they are talking about.

Thanks again -queue-, or do you prefer JT?

Dave

Subsummaries are only reliable when previewing and printing. You would have to put a summary total field in the header or footer to see it in Browse Mode.

You can get the formatting information for a field by right-clicking (I assume it would be Option-left-clicking on a Mac) on one. The calculation information is only available in the field definition. Portal and button formatting is available by double-clicking (Cmd-clicking?) the object.

You may call me either. The newspaper called me LJ last week, so I guess anything goes.

Update: it appears that a trailing grand summary is available in list view. When did this become an option?

  • Author

I see that alot of people on here are posting that they are having trouble making fields transparant. I thought that was just a matter of clicking on the top left choice that looks like 2 hollow squares under the fill tools. Maybe they are talking about earlier versions that didn't this. Or I just don't understand what they are talking about.

Thanks, I will try that when I get home.

What about the above? Do you know about the transparancy issue?

Dave

I believe you are referring to making graphics transparent, which appears to be much more tricky than making fields transparent.

  • Author

I did mean fields. There is alot of talk about it on here. In FM7 you just click on the two hollow squares under the fill section, and the field is transparent. So I must not be getting what they are talking about.

But I would like to know if there is a way to keep fields invisible on a layout. That way, in layout mode they would be there to see what is going on, but when a user is in browse mode, etc., they do not see the fields. I know I can just remove them from the layout, but it would be nice to leave them on in certain cases.

The only thing I have found is to be able to make them not print.

Thanks Dave

Hmm. I haven't seen what you're describing. But it's easy to make a field 'invisible'. Set it to have no border or a border width of 'None', no background fill, and set the font to match the layout part's color. Format it to not allow entry in Browse or Find Mode, and you're done.

  • Author

That is what I thought. If I see it again in forum, I will let you know.

When I am making a script, I can't figure out how to switch between windows.

Also, if you want to make the new window a certain size, it asks for a name of the window. That doesn't make sense to me.

What I would like to do is as follows:

Make a new window, go to layout blah blah, resize to fit, put the window over here in a specific place.

or

Make a new window, go to layout, tile vertically, resize to fit, go back to original layout, resize this one to fit, then back to the new window.

I guess what I am saying is I want a new window, I don't want it on top of the old one, I want the original shape of the orignal window, I want the correct shape of the new window, and I want them tiled. That way, when a user opens a help screen, they can still see the window they are reading about. And I hate when the tile feature changes the shape to fill the screen.

As I said in the beginning, it looks like there is a feature to tell FM exactly where to put a window, but it wants a new name for the window. Why doesn't it just want the name of the layout?

Very confusing, but I am feeling good because I am getting close to this thing being done. smile.gif

Thanks alot,

Dave

You could have the same layout used for different windows, such as one in form view and one in list view. So the window name is crucial to operations. If you are using layout names for your window names, then you will use the same name when referring to a window. You may want to test that there isn't already a window open that contains the same name.

If [not Position(

  • Author

when my windows open they just use the name of the file, then as more windows open it will add a -1, -2, etc. I have not named any windows up to this point. I just let FM do it

So lets see if I get this. I could name a window upperrightcorner. And make it so that it will be in the upper right corner of the screen, at a set size, etc., then in a script say, open new window, specify (upperrightcorner), then go to layout whatever, and presto, the window is just where I want it? That would be great......

Dave

  • Author

Forget the last post.

I figured it out, and it works great.

My only complaint is that I can't find a way to have a window in layout mode tell you what the pixel dimensions of the layout. So you just have to play around till it works. Not a big deal. I will upload the latest soon, for anyone who is interested. I am getting closer smile.gif

Dave

  • Author

Well, here is a look at the latest.

When I am in the Client/Invoice layout, I have a portal that shows all of the clients invoices. On each one you have the ability to pull up that invoice with a click. It comes up in a new window using the invoice lookup script. I tried to perform a find so that when that window shows up, it has the record you want, and the rest of that clients invoices so you can scroll through them.

I can't seem to get it to work. It has all invoices.

When performing a find, how do I say, give me this record and all other records by this client? I know that I will need to show the staus area, if I can get this to work.

Thanks

Dave

When you Specify your GTRR step, select 'Show only related records'. Since your relationship is based on client id, only records for that client will be found.

  • Author

Wow, that was easy.

Thanks again, did you get a chance to see some of the improvements?

Dave

  • Author

Another question,

I have a field called taxable that has a checkbox, either it is checked or not

I have another field called category. This uses a value list, Pick either Product or Service

So what I was thinking is why not have the taxable field be a calculation, If the user selects Product as the category of the item, it is taxable, and if they select Service, it should stay unchecked.

I tried to make the Taxable field a calc, and use the Case calc Case(Category="Product";1;0)

This didn't work. I figured 1 would return true and 0 false, but I don't think I am going about this the right way since that just returns a number

Thanks

Clueless Dave

Category = "Product" should work. The 1 and 0 are redundant. Make Taxable a number field and use a value list of 1 for it. When you want to test it, use Case( Taxable ... ) for true (1) or Case( not Taxable ... ) for false (0).

  • Author

Thanks,

I made taxable a number field and used a calc, Case(Category="Product";1;0)

Then I made a field that displays on the layout a calc field, Case(Taxable="1";"Yes";"No")

That works. I think you were trying to show me a way to do it with one field, but I didn't understand. If this is what you meant then, I got it. smile.gif

But as far as I can tell, this works.

Dave

I meant that the Case test for your taxable calc is redundant. Category = "Product" is all you need. If it's true, it will return a 1; if false, zero.

You don't need an extra field to display. You can put Taxable on the layout and format it as a boolean. With the field selected, go to Format -> Number and select 'Format as Boolean'.

When you want to test Taxable for other calcs, you don't need the = "1" part, since a zero is false and a one is true. You only need Case( Taxable; result1; result2 ).

  • 3 weeks later...
  • Author

Sorry I have not been on in awhile. I wasn't ignoring your response. I have been in LAS at a convention, and trying not to lose money.

Thank you very much

Dave

Hmm, I wonder what the record is for posts in a single thread. Ask.gif

I don't know. But I'd rather not try to break it. ooo.gif

Create an account or sign in to comment

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.