function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
FlatFiveFlatFive 

Can't get Event.Subject to merge, account fields merge fine. ??

I'm trying to create a simple pop-up window to reflow data in a more printable format. I can access all the account fields including my custom fields with no problem, but these are basically appointment cards I'm trying to print and I'd like to grab information about the event as well, such as subject, location, date and time, etc. The event is in the future of my test record, and it is an event, not a task. Why won't event fields show up?

Here I reduced the code to its simplest form.

<html>
<body>
Account Name:{!Account.Name}<br>
Event Subject:{!Event.Subject}<br>
</body>
</html>

When I execute this code, the result is:

Account Name: John Smith
Event Subject:

Any help is appreciated.
ssurferssurfer

You did say any help... not sure i know much more than you, but here's what i think:

The relationship between Account and Event is a 1-to-many. I don't think you'll be able to display a list of events without a query. From what i understand you should be able to create a query selecting the events you want (future events with AccountID=yourAccountID)

You'd also need an array to hold the events in as your loop function finds them for you. I'm sorry that i can't give you any code for this, i'm slightly lost myself :(

Greg HGreg H
The auto-population of fields such as {!Account.Name} and {!Event.Subject} in an sControl is dictated by how the sControl is accessed.  If you access your sControl through a link on your account detail page then the sControl knows the Account information but not the event information because the event information could be from any number of events.  Now access your sControl from the event detail page and you will be able to see both event information and account information.  This is, of course, as long as you have the event tied to the account correctly either through direct assignment or a contact association.
 
Although there may be many solutions to your problem, I will list two:
  1. Move the link for your sControl to the event detail page.
  2. Modify your sControl to provide a drop down list of possible events associated to the account prior to displaying the printable event card.
The first option is significantly easier than the second but the second may be necessary if your business need is to have the event card accessible from the account page.
-greg