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

Posted on 2010-01-05
Last Modified: 2013-12-18
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";

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

Please provide help, thank you.
Question by:fselliott
    LVL 63

    Expert Comment

    I would create a test DB and form and test there first.

    also see

    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 !

    LVL 46

    Accepted Solution

    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

    --> 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)

    Author Closing Comment

    Thank you!

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    What Should I Do With This Threat Intelligence?

    Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

    For Desktop Techs: How to retain a user's Notes configuration data when swapping out the end user's computer. (Assuming that you are not upgrading to a completely different version of Notes client) All you need to do is: 1) install Notes o…
    This is an old article, please see an updated version of this article, located here:
    how to add IIS SMTP to handle application/Scanner relays into office 365.
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

    759 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

    11 Experts available now in Live!

    Get 1:1 Help Now