October 5, 200223 yr 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
October 5, 200223 yr 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
October 5, 200223 yr 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.
October 5, 200223 yr Author 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
October 5, 200223 yr Author 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
October 5, 200223 yr 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.
October 7, 200223 yr Author 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
October 7, 200223 yr Author 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
Create an account or sign in to comment