September 29, 201213 yr I have a BD with addresses etc. One function I have is to pint a envelope. Now sometimes I might want, for example, the company name or country in it and sometimes not. Is there a way to make the field editable before I print? At the moment it is not and I can no find a way to make it so. (I get the message: This action cannot be performed because this field is not modifiable.) I have a Database that pulls all the information together as a calculation. TrimAll ( List ( Title ; TrimAll ( First Name & " " & Last Name ; 0 ; 0 ) ; TrimAll ( Company ; 0 ; 0 ) ; TrimAll ( Street 2 ; 0 ; 0 ) ; TrimAll ( Postal Code 2 & " " & City 1 ; 0 ; 0 ) ; TrimAll ( State Province 2 ; 0 ; 0 ) ; Let ( c = TrimAll ( Upper ( Country 1 ) ; 0 ; 0 ) ; If (Country Current Envelope ≠ c ; c ; "" ) ) ; ) ; 0 ; 0 ) I hope there is a easy solution.
September 29, 201213 yr A calculation field cannot be edited. However there are some options: one is to have a second "override" text field, and include this is the calculation field calc: Case( not isempty( override ) ; override ; TrimAll ( List ( Title ; TrimAll ( First Name & " " & Last Name ; 0 ; 0 ) ; TrimAll ( Company ; 0 ; 0 ) ; TrimAll ( Street 2 ; 0 ; 0 ) ; TrimAll ( Postal Code 2 & " " & City 1 ; 0 ; 0 ) ; TrimAll ( State Province 2 ; 0 ; 0 ) ; Let ( c = TrimAll ( Upper ( Country 1 ) ; 0 ; 0 ) ; If (Country Current Envelope ≠ c ; c ; "" ) ) ; ) ; 0 ; 0 ) )
September 29, 201213 yr sometimes I might want, for example, the company name or country in it and sometimes not. Why don't you make that part of your calculation? The problem with editable fields is that once edited, they stay edited (until edited again). --- BTW, was there a sale at the TrimAll store? :hmm:
September 29, 201213 yr Author Thanks, tried this, but it hangs on ( override ) message is: The specified field cannot be found. Why don't you make that part of your calculation? . Thanks, for that, but unfortunately I do not understand what it is you mean or possibly how to do this. Sorry I am a novice here.
September 29, 201213 yr You could have a checkbox field to indicate which elements of the address to include. Then your calculation would have something like = ... Case ( not IsEmpty ( FilterValues ( "Company Name" ; AddressElements ) ) ; Company ) ; ... I am not sure how and when you print, but it would probably be most convenient to make AddressElements a global field - so it would turn elements off/on for all addresses at once and still allow each user to make their own choices..
September 30, 201213 yr Author Thanks. You could have a checkbox field to indicate which elements of the address to include. Then your calculation would have something like = ... Case ( not IsEmpty ( FilterValues ( "Company Name" ; AddressElements ) ) ; Company ) ; ... OK now I have: but it hangs on AddressElements and tells me: The specified field cannot be found. I am not sure how and when you print, I have a button to make either a A4 or a normal envelope and than it prints the record(s). It does this in a separate template, using a calculation field. is this what you mean? ... Case ( not IsEmpty ( FilterValues ( "Company Name" ; AddressElements ) ) ; Company ) ; not isempty( override ) ; override ; TrimAll ( List ( Title ; TrimAll ( First Name & " " & Last Name ; 0 ; 0 ) ; TrimAll ( Company ; 0 ; 0 ) ; TrimAll ( Street 2 ; 0 ; 0 ) ; TrimAll ( Postal Code 2 & " " & City 1 ; 0 ; 0 ) ; TrimAll ( State Province 2 ; 0 ; 0 ) ; Let ( c = TrimAll ( Upper ( Country 1 ) ; 0 ; 0 ) ; If (Country Current Envelope ≠ c ; c ; "" ) ) ; ) ; 0 ; 0 ) ) ...
September 30, 201213 yr I am afraid you are mixing up two different suggestions, Vaughan's and mine. In my suggestion, AddressElements is a new field you need to create. This would be the checkbox field used to indicate which elements to include in the calculated label. Once you have that, the line = ... Case ( not IsEmpty ( FilterValues ( "Company Name" ; AddressElements ) ) ; Company ) ; ... would come instead of your current = ... TrimAll ( Company ; 0 ; 0 ) ; ... This is just an example - you need to do the same thing for every element you want to able to switch on/off. I have a button to make either a A4 or a normal envelope and than it prints the record(s). It does this in a separate template, using a calculation field. is this what you mean? I meant it's not quite clear what scope do you want the selection to have. If you are printing 100 addresses, do you want to include/remove the company name on all of them at once? Or is this choice made individually for each address?
September 30, 201213 yr Author Thanks. I meant it's not quite clear what scope do you want the selection to have. If you are printing 100 addresses, do you want to include/remove the company name on all of them at once? Or is this choice made individually for each address? OK I need it to print one envelope for one person I am sending stuff to. Up till now I did not uses it for mass mailing. I will look at your other suggestions when I am back at the computer it is on.
September 30, 201213 yr Author I am afraid you are mixing up two different suggestions, Vaughan's and mine. In my suggestion, AddressElements is a new field you need to create. This would be the checkbox field used to indicate which elements to include in the calculated label. Once you have that, the line = ... Case ( not IsEmpty ( FilterValues ( "Company Name" ; AddressElements ) ) ; Company ) ; ... would come instead of your current = ... TrimAll ( Company ; 0 ; 0 ) ; ... Ok that works, in a test version, but as soon as I ad a second record to the DB, it appears as an other tick-box, I must be doing something wrong. Mmm.
September 30, 201213 yr as soon as I ad a second record to the DB, it appears as an other tick-box Not sure what you mean by that.
October 1, 201213 yr Author Not sure what you mean by that. I am working in a test copy that is empty. I enter the name of a company. So far so good. I have a tick box to turn it of or on in the printing. Now I enter a second company and automatically a second tick box appears with the name of the second company. Same if I enter a third etc.
October 1, 201213 yr I am afraid I still don't understand the problem. Does this work for you? AddressElements.fp7.zip
October 1, 201213 yr Author Good morning comment. Yes that helps me to see what I did wrong! Thanks a million, somehow I do not always get the logic of FMP in the programming department. Needles to say it works! Thanks again Eric PS, BTW is there a way to mark answers as the solution in this forum?
Create an account or sign in to comment