Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 278
  • Last Modified:

Hot-spot from an e-mail not working

Hi There:

In my database I have a form that has a field set up as a hot spot.  The Click event runs an agent that opens another related document.  This works fine when in the database.  

However, there is also an action, 'Send and E-mail', that copies the form into an email message allowing the user to send out an email with the form in it. When the e-mail is received and opened the hot spot no longer functions properly.  An error is returned saying 'The specified agent does not exist'.  It should open the same related document from the database.

Any suggestions, explanations?

Thanks a lot,

Brad.
0
BECKETBM
Asked:
BECKETBM
2 Solutions
 
HemanthaKumarCommented:
When you mail out the form, the related agents or script libraries are not mailed out. So you will get into these kind of problems..

In order to mail out fully functional document to the users follow these

1. Enable Store form in document form property
2. Don't externalize scripts (like agents, script libraries or use lsx)
3. Create all functions and scripts within the form and save it.

Now when you mail the document attach the form with document (look for Notesdocument.send in help)



~Hemanth
0
 
qwaleteeCommented:
Problem is that the hotspot calls an agent in the "current" database.  When in "your" database's form, that's the agent you wrote, and it works fine.  When in an e-Mail, it tries to find an agent by that name in the user's mail database, which does not work, of course.

So, you need the e-mail to contain enough hidden information to locate teh other database and possibly provide some content as to which document is being refereced. And youthen need to either:

1) put all the code in teh hotspot directly
or
2) have the hotspot open the agent in the source database

...and of course, it won't work at all if the mail user has a different server, or is working offline.

An example of some code that might work:

FORWARD CODE, setting source (s_) info:
docID := @Text(@DocumentUniqueID);
server := @Subset(@DbName;1);
path := @Subset(@DbName;-1);
@Command([MailForward]);
FIELD s_docID := docID;
FIELD s_server := server;
FIELD s_path := path;

HOTSPOT CODE:
agent := "My agent name";
ENVIRONMENT macroPassValue := s_docid;
@If(s_server = "" & s_path = ""; SKIP_DB_OPEN; @PostedCommand([FileOpenDatabase; s_server : s_path));
@PostedCommand([ToolsRunMacro]; agent);



You MAY have to change the agent so that it is sensitive to the environment variable.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now