I am having a great deal of difficulty getting an @DBLookup formula to work in an Input form in a databse which I will refer to here as the source database.. The formula is:
@DbLookup ("" : "NoCache" ; "" : Mammals_SR_Courses.nsf; "PetInfo" ; DBCPetsList; 2; "")
Petinfo is a two-column view in a different database, which I refer to as the target database. The two columns and associated data are:
The source database has a shared field called DBCPetsList. This shared field is an editable dialog list field. It uses @DBColumn to call the PetInfo View in the target database and allow the user to select one of the pets in the Pets column. This is working fine, and the user can select one of the pets in the generated list. The @DBColumn Choices formula used in DBCPetsLIst is:
Also in the source database is a shared field called DBLPetfood. DBLPetfood contains the @DBLookup formula shown above:
@DbLookup ("" : "NoCache" ; "" : Mammals_SR_Courses.nsf; "PetInfo" ; DBCPetsList; 2; "").
I have placed the @DBLookup formula in the Input Validation object of the shared field. I read that I was supposed to do that in the Domino help pages. Then, when I press F9 to refresh the page, I want to see an entry from the Petfood shared field from the target database. In other words, if the user selects "Birds" from the DBCPetsList field, pressing F9 should make "Seeds" appear in the DBLPetfood field. Instead, I get the following message: "Incorrect datatype for database function".
I have tried all kinds of troubleshooting methods to figure out what is going on, but I have had no luck. I made sure that all fields are text fields, all are editable, all are non-multi value. I've tried using both column number and field name in the formula, and nothing different happens.
I found a way to test my code and make sure the data is right. I created a button that has the following formula:
@Prompt([Ok]; "Lookup key";
@If(@IsError(DBCPetsList); "ERROR: " + @Text(DBCPetsList);
@IsText(DBCPetsList); "\"" + @Implode(DBCPetsList; "\": \"") + "\"";
@Implode(@Text(DBCPetsList); ", ")
result := @DbLookup ("" : "NoCache" ; "" : Marquesas_SR_Courses.nsf; "PetInfo" ; DBCPetsList; 2; "");
If I choose "Birds" in DBCPetsList, this test button returns "Birds." So I think that means it's working okay.
I learned that I can paste my code in a text field and press Shift F9. When I paste in my @DBLookup formula, I get this: ERROR: A view of that name cannot be found in the specified database
I've verified that I have the right View Name: PetInfo. The other field in the source database has no trouble accessing the view. I thought maybe I had the wrong column #, but that is not the case, and as I wrote earlier, it does not work using field name, either. I'm out of troubleshooting ideas. I would be really grateful if someone would look at my rpblem and offer some solutions. Thanks!t