Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Code renders in browser but errors in the IBM Notes client

I have two computed fields and want update them. It works great in the browser, but the IBM Notes client gives an error.

Here is the code:

var Admin = @DbColumn("", "GoreAdmins", 1);
   var AdminBackup = @DbColumn("", "GoreAdmins", 2);
   if (Admin && typeof Admin == "string") Admin = new Array(Admin); 
   if (AdminBackup && typeof AdminBackup == "string") AdminBackup = new   Array(AdminBackup); 
   if (document1.isNewNote()) {
       document1.setValue("Admin", Admin);
       document1.setValue("AdminBackup", AdminBackup);
   };

I get the error on this line:
document1.setValue("Admin", Admin);

like image 287
lbert Avatar asked Mar 02 '16 17:03

lbert


1 Answers

The first parameter for @DbColumn() and @DbLookup needs to be the database, easiest done with @DbName(). The method of passing a blank string won't work in XPiNC. It's standard for Notes Client development, works for XPages on a browser but is bad practice for this very reason.

like image 122
Paul Stephen Withers Avatar answered Sep 22 '22 08:09

Paul Stephen Withers