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

How to make a field editable when the content is determined by a Database script.


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

Recommended Posts

Posted

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.

Posted

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 )

)

Posted

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:

Posted

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.

Posted

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..

Posted

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 )



)

...

Posted

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?

Posted

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.

Posted

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.

Posted

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.

Posted

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?

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