Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

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

Domino/Lotus Notes - How Do I Populate a Field Value Based on a Variable in Another Field

I have charge account fields named "ChgNo1", "ChgNo2", "ChgNo3", and "ChgNo4" respectively. They are editable dialog lists providing the user an option to choose which account(s) should be billed for the transaction.

Based on the account(s) chosen, I would like to populate a field called "Distribution" with a list of names that will later be used to email the responsible department(s) contact(s).

The code I have currently placed in "Standard_21071" is not populating the field. "Standard_21071" is a names, computed field (I've also tried it a couple of other ways). Here's the code:

check := @If(@Contains(ChgNo1; "210-71")  | @Contains(ChgNo2; "210-71")  | @Contains(ChgNo3; "210-71")  | @Contains(ChgNo4; "210-71"); "Yes"; "No");
check = "Yes"; Standard_21071:"Charles Moore":"Willy Gabes";
Standard_21071

Also, I would like the formula to do the same for ChgNo1, etc. if it were account "210-80".

Please provide help, thank you.
0
fselliott
Asked:
fselliott
1 Solution
 
SysExpertCommented:
I would create a test DB and form and test there first.

also see

http://www.experts-exchange.com/Software/Office_Productivity/Office_Suites/Lotus_SmartSuite/Lotus_Notes/Q_20419809.html

http://www.experts-exchange.com/Software/Office_Productivity/Office_Suites/Lotus_SmartSuite/Lotus_Notes/Q_23961342.html


Do some testing and make sure that you understand the different field types.

I prefer lotus script to formula, since it is easier to debug and gives better control.

I hope this helps !

0
 
Sjef BosmanGroupware ConsultantCommented:
Let's split up the code, so you see what happens:

check := @If(@Contains(ChgNo1; "210-71")  | @Contains(ChgNo2; "210-71")  | @Contains(ChgNo3; "210-71")  | @Contains(ChgNo4; "210-71"); "Yes"; "No");
--> let's assume check is calculated correctly

check = "Yes";
--> this statement evaluates to True or False, and the result is discarded

Standard_21071:"Charles Moore":"Willy Gabes";
--> this statement evaluates to a list of at least 3 values, and the result is discarded

Standard_21071
--> the result of the last expression is returned as new value of the field; since nothing changed, the field's value wont change

What you probably meant:

check := @If(@Contains(ChgNo1; "210-71")  | @Contains(ChgNo2; "210-71")  | @Contains(ChgNo3; "210-71")  | @Contains(ChgNo4; "210-71"); "Yes"; "No");
@If(check = "Yes"; Standard_21071:"Charles Moore":"Willy Gabes"; Standard_21071)
0
 
fselliottAuthor Commented:
Thank you!
0

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

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