6

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

Per Henrik Lausten
  • 21,331
  • 3
  • 29
  • 76
lbert
  • 61
  • 2
  • 4
    And what error do you get? – Nikita Mar 02 '16 at 17:58
  • 7
    Please re-open this question. The answer below is the correct explanation. It is a misunderstanding of coding conventions, not a question seeking debugging help. The request to put it on hold is a misunderstanding of the platform, technology and explainable causes. – Paul Stephen Withers Mar 03 '16 at 10:30
  • 5
    This is a legit question on the XPages platform. Needs to be reopened. – Serdar Basegmez Mar 03 '16 at 11:19
  • 2
    Agreed. This is a perfectly valid question to anyone using XPages Technology. This should not be on hold and needs to be reopened. – David Leedy Mar 03 '16 at 12:46

1 Answers1

7

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.

Paul Stephen Withers
  • 15,699
  • 1
  • 15
  • 33