Solved

Formula sort of working

Posted on 2003-12-01
10
355 Views
Last Modified: 2013-12-18
Hi Guys

This does not send a mail when Type = "Other"

Also when Type ="Mission" it should list the dates and location it only list the first Start and End Date

@Command([FileSave]);To get DocNum

O :=@If(type ="Sick":"Mission";Type+" "+ "Notification for"+" "+NameFull+"  " +"# "+@Trim(DocNum);
             type ="Other";"Out of Office Notification for"+" "+NameFull+"  " +"# "+@Trim(DocNum);"");

ooo := NameFull+" "+"will be on Mission."+@NewLine+"Start Date: "+" "+@Text(StartDate_2)+" "+"End Date: "+" "+@Text(EndDate_2)+" "+Location;@NewLine;+
"Start Date: "+" "+@Text(StartDate_3)+" "+"End Date: "+" "+@Text(EndDate_3)+" "+Location_1;@NewLine;+
"Start Date: "+" "+@Text(StartDate_4)+" "+"End Date: "+" "+@Text(EndDate_4)+" "+Location_2;@NewLine;+
"Start Date: "+" "+@Text(StartDate_5)+" "+"End Date: "+" "+@Text(EndDate_5)+" "+Location_3;@NewLine;


S := @If(type = "Sick";"Sick";"Other";"Out of Office";"");
R := @If(type ="Other";OtherInfo;"");

MailRemark:=NameFull+" "+"will be"+S+@NewLine+@NewLine+"Out of Office Type: "+type+@NewLine+@NewLine+"Start Date: "+@Text(StartDate)+@NewLine+@NewLine+"End Date: "+@Text(EndDate)+@NewLine+@NewLine+R +@NewLine+@NewLine+"Best Regards";"";
@SetField("ApprovalStatus" ; "Approved" );
notify := " A notification will be sent to " + @Name([CN];MailTo) + " ." ;

MailRemark1 :=@Trim(ooo);

MailTo:= cur_Manager:cur_SiteManager:profile_WhoToNotify:@If(WhoelsetoNotify1 != "";WhoelsetoNotify1;"");
MailCc:= "";
MailSubject:=O;
@Do(@Prompt([OK];"Send Notification";notify);
@MailSend(MailTo;MailCc;"";MailSubject;@If(type != "Mission";MailRemark;MailRemark1);"";[IncludeDoclink]));
@Command([FileSave]);
@Do(@SetField("SaveOptions"; "0");@PostedCommand([FileCloseWindow]))
0
Comment
Question by:adspmo
  • 3
  • 3
  • 2
  • +2
10 Comments
 
LVL 24

Expert Comment

by:HemanthaKumar
ID: 9851586
Probably it is breaking before it can reach mailsend function. Create a prompt statement and embed it into your formula for debugging purpose..

~Hemanth
0
 

Author Comment

by:adspmo
ID: 9852125
Hi there

A quick question about

Authors fields

When i am using userroles in a Authors field it does not seem to worl

e.g.  Authors Computed Allow Multiple Value

@Trim("[Admin]":Approver_1:Approver+_2)

It shows up as being [Admin] in the properties but doesn't allowm me in

Do I neeed to use @IsMember ....UserRoles or what?

James
0
 

Author Comment

by:adspmo
ID: 9852126
Hi there

A quick question about

Authors fields

When i am using userroles in a Authors field it does not seem to worl

e.g.  Authors Computed Allow Multiple Value

@Trim("[Admin]":Approver_1:Approver+_2)

It shows up as being [Admin] in the properties but doesn't allowm me in

Do I neeed to use @IsMember ....UserRoles or what?

James
0
 
LVL 14

Expert Comment

by:p_partha
ID: 9852176
hi
It shd definitely work. The authors field shd have the value like

"[Admin]":Approver_1:Approver_2

Just check for the role name, it is case sensitive

Partha
0
 
LVL 24

Expert Comment

by:HemanthaKumar
ID: 9852288
Make sure it is multivalued field and is Authors type :-)
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 19

Expert Comment

by:madheeswar
ID: 9854869
use canonical format for Authors field while using names.
0
 
LVL 31

Expert Comment

by:qwaletee
ID: 9856359
[IncludeDOcLink] will fail on a new document.  Couuld this be occuring?

Also, try the followng check:

@Do(@Prompt([OKCANCELLIST]:[NOSORT];"Send Notification";notify;"";
("SendTo="+@Text(MailTo)) :
("CopyTo="+@Text(MailCc)) :
("Subject="+@Text(Subject)) :
("Type="+@Text(Type)) :
("Multivalue type?"+@Text(@Elements(Type)>1)) :
("Remark text" + @Text(@If(type != "Mission";MailRemark;MailRemark1)))
);
@MailSend(MailTo;MailCc;"";MailSubject;@If(type != "Mission";MailRemark;MailRemark1);"";[IncludeDoclink]));

0
 

Author Comment

by:adspmo
ID: 9861219
Ok I now have it sending

What I need is for when the type is Mission for it to include the Start and Endate and Location for each range that has been selected
0
 
LVL 24

Accepted Solution

by:
HemanthaKumar earned 350 total points
ID: 9861832
How was it fixed ?

Already you have defined this

ooo := NameFull+" "+"will be on Mission."+@NewLine+"Start Date: "+" "+@Text(StartDate_2)+" "+"End Date: "+" "+@Text(EndDate_2)+" "+Location;@NewLine;+
"Start Date: "+" "+@Text(StartDate_3)+" "+"End Date: "+" "+@Text(EndDate_3)+" "+Location_1;@NewLine;+
"Start Date: "+" "+@Text(StartDate_4)+" "+"End Date: "+" "+@Text(EndDate_4)+" "+Location_2;@NewLine;+
"Start Date: "+" "+@Text(StartDate_5)+" "+"End Date: "+" "+@Text(EndDate_5)+" "+Location_3;@NewLine;

only thing is you have to refine it so that it will not include empty date fields

oooTable := @IF( StartDate_2 != "" & EndDate_2 != ""; "Start Date: "+" "+@Text(StartDate_2) +" "+"End Date: "+" "+@Text(EndDate_2)+" "+Location; "" )  + @NewLine + @IF( StartDate_3 != "" & EndDate_3 != ""; "Start Date: "+" "+@Text(StartDate_3) +" "+"End Date: "+" "+@Text(EndDate_3)+" "+Location; "" )  + @NewLine +@IF( StartDate_4 != "" & EndDate_4 != ""; "Start Date: "+" "+@Text(StartDate_4) +" "+"End Date: "+" "+@Text(EndDate_4)+" "+Location; "" )  + @NewLine + @IF( StartDate_5 != "" & EndDate_5 != ""; "Start Date: "+" "+@Text(StartDate_5) +" "+"End Date: "+" "+@Text(EndDate_5)+" "+Location; "" )  + @NewLine;

ooo := NameFull+" "+"will be on Mission."+@NewLine +@Trim(oooTable);

0
 
LVL 31

Expert Comment

by:qwaletee
ID: 9871876
Hmm, Mission. Sounds like a charitable or religious organization, a la Save the Children, Medecins Sans Frontieres, or just plain missionary work.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

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…
This is an old article, please see an updated version of this article, located here: http://www.experts-exchange.com/articles/23619/Notes-8-5x-Windows-7-Notes-info-and-tips.html
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

863 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now