?
Solved

Display message after doc is saved

Posted on 2005-02-24
14
Medium Priority
?
256 Views
Last Modified: 2013-12-18
Experts,

I'm trying to get a message to appear after my document has been saved, passing all validation.  I can't put this in my PostSave event, because I have @MailSend code, and had trouble combing the two.

So, I'm thinking the best place to put this code is on my save button, but I have the following code and am having trouble making both work correctly, after combinging (still learning this formula language).

Can someone help?

My Save button (non web -- client only):

@If(@Command([FileSave]);
@Command([FileCloseWindow]);
ABORT)

My message I want to appear, if doc is saved, passing validation:

@Prompt([OK];"Prospect Submitted!";"Your request has been sent to the database administrator"+@NewLine+"You will receive an alert once your request has been processed.")

thanks in advance,

AliciaVee
0
Comment
Question by:AliciaVee
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 8
  • 3
  • 2
  • +1
14 Comments
 
LVL 31

Expert Comment

by:qwaletee
ID: 13399704
@If(@IsValid; @Prompt([OK]; "Document is OK"; "Saving and closing"); @Return(ABORT));
@PostedCommand([FileSave]);
@PostedCommand([FileCloseWindow]);

And you COULD combine it with your PostSave, but I would have to see what you have in your PostSave.
0
 

Author Comment

by:AliciaVee
ID: 13402796
qwalette -- I think the PostSave is better because now, I get extra messages with my field validation -- if I try to save when data is still missing, or if I try to use escape..

Here is my PostSave -- can you squeeze in this message?  This way, I know the "Document is OK" message will only appear if all has been validated and document is saving:

My current PostSave event:

@If(ProspectStatus="Pending";
@MailSend(DbAdmin;"";"";"3TS Prospect Request"; "A request to add prospect information in the 3TS has been submitted by: " +DocAuthor+@NewLine +"Prospect Profile:"+@NewLine+ ProspectName+", "+ProspectCity+ @NewLine +"Country:"+@NewLine +ProspectCountry;""+"Click this link to go to the project-----> ";[IncludeDoclink]);
@MailSend(DocAuthor;"";"";"3TS Prospect Request Completed!"; "Your request to add prospect information in the 3TS has been completed by: " +DocAuthor+@NewLine +"Prospect Profile:"+@NewLine+ ProspectName+", "+ProspectCity+ @NewLine +"Country:"+@NewLine +ProspectCountry;""+"You may now add your new 3TS project.  The prospect information has been added to the customer database"))

Also, I have this on my save button (I took it from a post that YOU answered to someone else...)  This is okay -- yes?:

@If(@Command([FileSave]);
@Command([FileCloseWindow]);
ABORT)

I noticed the save/close code you added in this post is slightly different (I'm not clear on what ABORT acutally does...but it helps to suppress the annoying popup save messages)

-AliciaVee
0
 

Author Comment

by:AliciaVee
ID: 13407761
All -- increasing the points because I have to have a prototype ready by Monday. Help....
0
Industry Leaders: 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!

 
LVL 1

Expert Comment

by:g40kkk
ID: 13412995
AliciaVee,
 I think you can use this formula (by combinding qwalette's answer and your PostSave):

@If(@IsValid; @Prompt([OK]; "Document is OK"; "Saving and closing"); @Return(ABORT));
@Command([FileSave]);
@Do( @If(ProspectStatus="Pending";
@MailSend(DbAdmin;"";"";"3TS Prospect Request"; "A request to add prospect information in the 3TS has been submitted by: " +DocAuthor+@NewLine +"Prospect Profile:"+@NewLine+ ProspectName+", "+ProspectCity+ @NewLine +"Country:"+@NewLine +ProspectCountry;""+"Click this link to go to the project-----> ";[IncludeDoclink]);
@MailSend(DocAuthor;"";"";"3TS Prospect Request Completed!"; "Your request to add prospect information in the 3TS has been completed by: " +DocAuthor+@NewLine +"Prospect Profile:"+@NewLine+ ProspectName+", "+ProspectCity+ @NewLine +"Country:"+@NewLine +ProspectCountry;""+"You may now add your new 3TS project.  The prospect information has been added to the customer database")));
@Command([FileCloseWindow]);


0
 

Author Comment

by:AliciaVee
ID: 13415453
g40kk,

I tried your solution and I got the following message:

"Attempts to execute nested form events"

I did however,  receive the email initiated from the @MailSend code.  
0
 
LVL 1

Expert Comment

by:g40kkk
ID: 13429089
Sorry I didn't test the code. I've never get that error msg.
Besides that error, is everything work fine?

Try this one.

@If(@IsValid; @Prompt([OK]; "Document is OK"; "Saving and closing"); @Return(ABORT));
@Command([FileSave]);
@If(ProspectStatus="Pending";
@MailSend(DbAdmin;"";"";"3TS Prospect Request"; "A request to add prospect information in the 3TS has been submitted by: " +DocAuthor+@NewLine +"Prospect Profile:"+@NewLine+ ProspectName+", "+ProspectCity+ @NewLine +"Country:"+@NewLine +ProspectCountry;""+"Click this link to go to the project-----> ";[IncludeDoclink]);
@MailSend(DocAuthor;"";"";"3TS Prospect Request Completed!"; "Your request to add prospect information in the 3TS has been completed by: " +DocAuthor+@NewLine +"Prospect Profile:"+@NewLine+ ProspectName+", "+ProspectCity+ @NewLine +"Country:"+@NewLine +ProspectCountry;""+"You may now add your new 3TS project.  The prospect information has been added to the customer database"));
@Command([FileCloseWindow]);
0
 

Author Comment

by:AliciaVee
ID: 13430903
g40kk -- still getting the same error.

yes, the emails are sent/received.  But I can't use the code when an error appears.  What I have done, for the interim, is display text on the form (instructions) letting users know that an email will be sent to them once their request is processed.  I would have liked to have this appear, after the document is saved, but for now, this is a viable workaround.  Would still like to get it working as I hoped.

AliciaVee
0
 
LVL 1

Accepted Solution

by:
watsonca earned 1600 total points
ID: 13701903
Hello AliciaVee, try this.

REM {Edits};
@If(FIELDNAME = ""; @Do(@Prompt([Ok]; "Validation Error"; "Error msg.");      
       @Command ([EditGotoField];"FIELDNAME"); @Return("")); "");

then you mail code. :-)
0
 

Author Comment

by:AliciaVee
ID: 13743673
Watsonca,

I will try your solution when I get back in the office on Monday.  Thanks for adding a post!

-AliciaVee
0
 
LVL 31

Expert Comment

by:qwaletee
ID: 13745953
You can't do @Command([FileSave]) from the PostSave.  That's why you are getting "nested events" -- the [FileSave] kicks off its own save, which causes another PostSave event to fire, while the original PostSave is still active.
0
 

Author Comment

by:AliciaVee
ID: 13747116
qwaletee,

okay -- I see your point.  So, is there another way around this?  Currentely, I have the message I want to appear after the form is saved -- displayed on the form.  So, once users complete the form, it saves and closes and brings them to the view where requests are pending.  Not cricital that I have a display message showing them that they will receive an alert once their request is processed, but it would be  a nice to have.  Again, here comes my MS Access experience playing tricks on me.  But -- I am getting used to Notes development and am actually starting to like it, even with its caveats and my struggles of learning a non-relational environment.
:)

AliciaVee
0
 
LVL 31

Expert Comment

by:qwaletee
ID: 13836830
You have all the peices, I hope you pulled them together.
0
 

Author Comment

by:AliciaVee
ID: 13850541
qwaletee,

Okay, so are you saying then that if I remove the:
@Command([FileSave]);

from the code already posted above -- it will work okay?  (I'm at home now, and will need to test this on Monday when I'm back in the office):

@If(@IsValid; @Prompt([OK]; "Document is OK"; "Saving and closing"); @Return(ABORT));
@Command([FileSave]); 'REM: REMOVE THIS??
@If(ProspectStatus="Pending";
@MailSend(DbAdmin;"";"";"3TS Prospect Request"; "A request to add prospect information in the 3TS has been submitted by: " +DocAuthor+@NewLine +"Prospect Profile:"+@NewLine+ ProspectName+", "+ProspectCity+ @NewLine +"Country:"+@NewLine +ProspectCountry;""+"Click this link to go to the project-----> ";[IncludeDoclink]);
@MailSend(DocAuthor;"";"";"3TS Prospect Request Completed!"; "Your request to add prospect information in the 3TS has been completed by: " +DocAuthor+@NewLine +"Prospect Profile:"+@NewLine+ ProspectName+", "+ProspectCity+ @NewLine +"Country:"+@NewLine +ProspectCountry;""+"You may now add your new 3TS project.  The prospect information has been added to the customer database"));
@Command([FileCloseWindow]);
0
 

Author Comment

by:AliciaVee
ID: 13868840
watsonca,

Wow.  Your code actually worked!  I had to tweak it a little, because of course I was not checking for an error, so I added the following:

@Do(@Prompt([Ok]; "Prospect Completed!"; "Your request has been sumbmitted. You will receive an email once your request has been processed.");

...and then my initial mail code.  That did it!
0

Featured Post

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For users on the Lotus Notes 8 Standard client, this article provides information on checking the Java Heap size and adjusting it to half of your system RAM in attempt to get the Lotus Notes 8.x Standard client to run faster.  I've had to exercise t…
Notes Document Link used by IBM Notes is a link file which aids in the sharing of links to documents in email and webpages. The posts describe the importance and steps to create a Lotus Notes NDL file in brief.
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses
Course of the Month9 days, 12 hours left to enroll

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question