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

Calc to contain all "Emails" from a portal


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

Recommended Posts

Posted

Using a portal, each row has a field with an email address. I need to have a calc field that will grab all the emails from the portal on the page and list them with a line break between each one. Tried this a number of ways with no luck. Anyone done one like this before?

LR

Posted

Don't use a portal. Do it with a list view in the related file. You can use a Go to Related Record (show) to isolate the set of records you need. Create a list view just for this purpose. Put the email address field on it and NOTHING ELSE, no labels, no other fields, no graphics, nada. When you execute a Copy All script step on this layout in Browse Mode, followed by a paste to a text field on another layout, you will get a carriage return separated list of email addresses.

-bd

Posted

Another option is to use the ValueListItems() function. Just define a valuelist based on the same relationship that the portal is based on. The ValueListItems() function will then return the related items separated by carriage returns.

Posted

I kind of have to do it as a function. The related portal is a self relationship within the same database. I need the calc field on each record to look at the portal and list all the emails from the portal for that record. This calc result will then be used by another database file.

So let me see if I understand this...

My portal relationship is names "tasks." The field in the portal in question is named "email."

So I create a value list, selecting "Use values from field" and choose tasks::email.

Create my calculation using ValueListItems (dbname, valuelist).

I dont quite understand how this calc works. If I try to replace dbname with the name of my database, I just get an error "This field cannot be found."

I assume I replace valuelist with the name of my newly created value list?

LR

Posted

OK< Found my own answer.

ValueListItems("Contac.fp5", "Email")

have not used this function before, so the "" marks threw me. Used to using them for quoting text in a calculation.

Thanks for the solution...worked like a charm and did EXACTLY what I needed.

LR

Posted

No problem... there are a few caveats with this solution, however. Often it doesn't automatically refresh. Bob Weaver suggests this modification:

Valuelistitems("MyFile","ValLst") & Left("",Count(MyRel::AnyField))

And I like to take it one step further by replacing "My File" (the name of the file) with Status(CurrentFileName). This way, if you change the name of the file using Developer Tool or what-have-you, you don't have to worry about altering the calc.

Posted

With the addition suggested above, what exactly does the Count(MyRel::AnyField) portion do?

Do I replace the MyRel::AnyField with the same information that is in my value list? For example:

My value list looks like this:

Similar:Email Combined

So would the calc look like this:

Valuelistitems("Contact.fp5","Email") & Left("",Count(Similar::Email Combined))

LR

Posted

OK, now I see what you say by "Often it doesn't automatically refresh." So I include the new code:

Valuelistitems("Contact.fp5","Email") & Left("",Count(Similar::Email Combined))

But now the problem is that by adding this I can no longer turn indexing on.

LR

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