?
Solved

somes codes are executed while some are not

Posted on 2004-04-29
7
Medium Priority
?
219 Views
Last Modified: 2013-12-18
Hi,
I use the following formula for a button
however only the mailsend line is executed
all other fields keep their original content rather than the assigned one from the
following codes. I guess it does not matter with the type of the
fields since I can set the field contents of same fields using same codes
for another button.
Any clues?
thanks!!!

FIELD bstatus :="approved";
FIELD status := "Registered";
@MailSend(user;ITuser;"";"Your PPCR is approved" ;"";"Your PPCR is approved.";[IncludeDoclink]);
@SetField("MAIL_SEND"; "Y");
FIELD regHis :=  "On " + @Text(@Now) + ", " + @Name([CN];@UserName);
FIELD regStatus :=  "On " + @Text(@Now) +",  " + @Name([CN];@UserName);
@Command([FileSave]);
@PostedCommand([OpenFrameset];"Sales")
0
Comment
Question by:damoncwk
[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
  • 3
  • 2
  • 2
7 Comments
 
LVL 19

Expert Comment

by:RanjeetRain
ID: 10946899
Are these fields computed or computed for display type? That may be the case.
0
 

Author Comment

by:damoncwk
ID: 10947006
Hi,
They are all editable fields.

I have tried something different and noted that
if I add a text field A beside the button

the button will set the content of field B to be that of field A
If i fill in field A then in addition to the mail being sent out
field B is also set to the value of field A.
If I delete field A and the button set
the content of B to some hardcoded string then
only the mail is sent out but the content of field B remains its original value.
0
 
LVL 15

Expert Comment

by:Bozzie4
ID: 10947164
The document has been saved already, before sending the mail ?

I've pasted this code in a test appl.  and for me, it works fine (except that I can't open the frameset, of course)
I do have some problems getting the mail delivered : this only works if I save the document first ....

If you use R6, you can detect an error in the mailsend command like this :
@iferror(@MailSend(user;ITuser;"";"Your PPCR is approved" ;"";"Your PPCR is approved.";[IncludeDoclink]);@return( @prompt([ok];"error";"Error sending mail"));

Maybe change @command([filesave]) to @postedcommand([filesave]) ?

cheers,

Tom
0
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!

 

Author Comment

by:damoncwk
ID: 10956810
I still encounter the same problem even if I create a new
button and paste the code to the new button.
is there any possible causes?
Thanks!
0
 
LVL 15

Expert Comment

by:Bozzie4
ID: 10957011
Yes, there are possible causes :

- the value of the fields is changed somewhere else (querysave event, field translation, computed fields)
- the user can't edit the document (rights ?)
- the document is not in Edit mode

cheers,

Tom
0
 

Author Comment

by:damoncwk
ID: 10958124
Hi Tom,
How can I set a form in edit mode when I open it from a document link in mail
or from a view?
Basically i want to open it in edit mode based on the user role.

Thanks.
0
 
LVL 19

Accepted Solution

by:
RanjeetRain earned 375 total points
ID: 10959522
Is it on web or client?

In client,use PostOpen event to execute a UIDOC.EditMode = True

Further, to cause a document to automatically open in edit mode unconditionally, you can set it form property "Automatically enable edit mode" on the second tab of form properties. But be warned that will not perform any role testing. To test for the role you can consider writing a function.

If it is for web, you can use the EditDocument URL command. The syntax is: http://Host/Database/View/Document?EditDocument 
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

  In today’s Arena we can’t imagine our lives without Internet as we are highly used to of it. If we consider our life style just for only 2 min we found that face to face communication is swapped by e-communication.  Every Where from Works place to…
This article covers general Notes 8.5 troubleshooting information including recreating the Notes\Data folder.
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…

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