?
Solved

Adjust content in a couple of fields

Posted on 2005-03-02
11
Medium Priority
?
210 Views
Last Modified: 2013-12-18
I need to run an agent on a bunch of selected records that will do the following:

1) Check to see if the Categories field contains "Competitive Agents" and the SubCategories field contains the substring "Reboxetine -- "

If the above is false
2) Do nothing

If true
3) Overwrite the contents of the Categories field with the string "Reboxetine" and remove the substring "Reboxetine -- " from the SubCategories field and capitalize the first letter of the remaining SubCategories field contents.

Example:

We start with

Categories = "Competitive Agents"
SubCategories = "Reboxetine -- adverse effects"

we end up with

Categories = "Reboxetine"
SubCategories = "Adverse effects"

I haven't done any Notes work in a gazillion years and would prefer to find a way to do the above using formula rather than script, but will be VERY HAPPY to get anything that does the trick. Please provide as much detail as possible

Thanks!
0
Comment
Question by:GessWurker
[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
  • 6
  • 4
11 Comments
 
LVL 24

Expert Comment

by:HemanthaKumar
ID: 13440110
Try this in your agent...

@if( @Contains(Categories;"Competivice Agents") &  @Contains(SubCategories;"Reboxetine -- ") ; @return(0); "");
FIELD Categories := "Reboxetine";
FIELD SubCategories := "Adverse effects";
""

~Hemanth
0
 
LVL 14

Expert Comment

by:p_partha
ID: 13440163
@if (<yourcategoryfieldname>="Competitive Agents" & @contains(<yoursubcategoryfieldname>;"Reboxetine--");@do(@setfield(<yourcategoryfieldname>;"Reobxetine");@setfield(<yoursubcategoryfieldname>;@propercase(@trim(@right(<yoursubcategoryfieldname>;"--")))));@success)

Put this in a agent and make it to run on selected documents. Also change the <yourcategoryfieldname> to your categoryfield name and subcategory also

Partha
0
 

Author Comment

by:GessWurker
ID: 13440178
~Hemanth:

Your suggestion will only work for records that have "Reboxetine -- adverse effects" in the SubCategories field. I need a more intelligent agent. There are many possibilities for what might be in the SubCategories field. Such as:

Reboxetine -- depression
Reboxetine -- reviews
Reboxetine -- drug interactions
Reboxetine -- seasonal affective disorder
Reboxetine -- any number of possibilities
0
Technology Partners: 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 14

Expert Comment

by:p_partha
ID: 13440204
did u try mine?...

@if (Categories="Competitive Agents" & @contains(subcategories;Reboxetine--");@do(@setfield(Categories;"Reobxetine");@setfield(subcategories;@propercase(@trim(@right(subcategories;"--")))));@return(0))

Partha
0
 
LVL 14

Expert Comment

by:p_partha
ID: 13440254
Ok try this , it will definitely work:


@If (Categories="Competitive Agents" & @Contains(subcategories;"Reboxetine--");@success;@return(""));

field categories:="Reobxetine";
field subcategories:=@ProperCase(@Trim(@Right(subcategories;"--")))

Partha
0
 
LVL 14

Expert Comment

by:p_partha
ID: 13440272
if there is a space after "Reboxetine--" then try this:

@If (Categories="Competitive Agents" & @Contains(subcategories;"Reboxetine --");@success;@return(""));

field categories:="Reobxetine";
field subcategories:=@ProperCase(@Trim(@Right(subcategories;"--")))

Partha
0
 

Author Comment

by:GessWurker
ID: 13440282
There is a space. Your first suggestion didn't work. Now trying the second...
0
 

Author Comment

by:GessWurker
ID: 13440321
Partha:

Almost! Just one thing. I only want propercase on the first word in the SubCategories field.

i.e., a SubCategories field that contains  

Reboxetine -- drug interactions

should convert to

Drug interactions

NOT

Drug Interactions
0
 
LVL 14

Accepted Solution

by:
p_partha earned 2000 total points
ID: 13440406

@If (Categories="Competitive Agents" & @Contains(subcategories;"Reboxetine --");@success;@return(""));

FIELD categories:="Reobxetine";
FIELD subcategories:=@UpperCase(@Left(@Trim(@Right(subcategories;"--"));1)) +@RightBack(@Trim(@Right(subcategories;"--"));1);

Partha
0
 

Author Comment

by:GessWurker
ID: 13440465
Perfect!
0
 
LVL 14

Expert Comment

by:p_partha
ID: 13440479
Thanks for the points :)

- Partha
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

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…
Article by: Rob
Notes 8.5 Archiving Steps and Tips This article covers setting up a Notes archive, and helps understand some of the menu choices making setting up and maintaining a Notes archive file easier.
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…

777 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