Skip to main content
Participant
March 10, 2022
Question

dynamic stamp java script

  • March 10, 2022
  • 1 reply
  • 320 views

i have this error with the following code. What can i do 

SyntaxError: missing : after property id 

95 at line 96

  var FormRouting = {
              return: 'cancel',
              DoDialog: function() {
                  return app.execDialog(this);
              },
            
              bchk1: false,
              bchk2: false,
              bchk3: false,
              bchk4: false,

              initialize: function(dialog) {
                 var dlgInit = {
                    Chk1: this.bchk1,
                    Chk2: this.bchk2,
                    Chk3: this.bchk3,
                    Chk4: this.bchk4,
                 };

                 dialog.load(dlgInit);
              },
     
              commit: function (dialog) {
                  var oRslt = dialog.store();
     
                  this.bchk1 = oRslt['Chk1'];
                  this.bchk2 = oRslt['Chk2'];
                  this.bchk3 = oRslt['Chk3'];
                  this.bchk4 = oRslt['Chk4'];
              },

              description: {
                titlename:"personal data", align_children:"align_left", width:500, heigth:400, elements:[
                    {
                         type:"cluster", name:"data entry", align_children:"align_left", elements:[
                             {
                               type: "view",align_chilren: "align_row", elements:
                               [
                                   {
                                       type:"static_text", name:"Code A:  Approved"
                                   },
                                   {
                                         item_id:"Chk1", type:"check_box",alignment:"align_fill", width:5, heigth:20
                                   }
                               ]
                             },

                             {
                               type: "view",align_chilren: "align_row", elements:
                               [
                                   {
                                       type:"static_text", name:"Code B:  Approved As Noted"
                                   },
                                   {
                                         item_id:"Chk2", type:"check_box",alignment:"align_fill", width:5, heigth:20
                                   }
                               ]
                             },

                             {
                               type: "view",align_chilren: "align_row", elements:
                               [
                                   {
                                       type:"static_text", name:"Code C:  Revise & Resubmit"
                                   },
                                   {
                                         item_id:"Chk3", type:"check_box",alignment:"align_fill", width:5, heigth:20
                                   }
                               ]
                             },

                             {
                               type: "view",align_chilren: "align_row", elements:
                               [
                                   {
                                       type:"static_text", name:"Code 😧  Rejected"
                                   },
                                   {
                                         item_id:"Chk4", type:"check_box",alignment:"align_fill", width:5, heigth:20
                                   }
                               ]
                             },
                         ]
                    },

                    {
                        alignment: "align_right",
                        type: "ok_cancel",
                        ok_name: "ok",
                        cancel_name: "cancel"
                    }
                ],
  },

if (event.source.forReal && event.source.stampName == "#stamp"){
         if('ok' == FormRouting.DoDialog()) {
             if (FormRouting.bchk1) {
                 this.getField('check box1').checkThisBox(0, true);
             }

              if(FormRouting.bchk2){
                   this.getField('check box2').checkThisBox(0, true);
              }
 
              if(FormRouting.bchk3){
                   this.getField('check box3').checkThisBox(0, true);
              }

              if(FormRouting.bchk4){
                   this.getField('check box4').checkThisBox(0, true);
              }
         }
};

 

This topic has been closed for replies.

1 reply

try67
Community Expert
Community Expert
March 10, 2022

You're missing a closing curly bracket at the end of the dialog object, before:

if (event.source.forReal ...