0 Replies Latest reply on Jun 15, 2015 8:29 AM by stuarts24

    Dynamic Stamp - Prepopulate text field

    stuarts24

      I have a dynamic stamp that I created but I need to add a value, if it exists, which is located under "Document Properties/Custom" to a text box on the dialog when it initially displays.  The Name of the Value in Document Properties/Custom is "tPExhRY1".  For the life of me I cannot figure out how to make this happen.  The scripting I have so far is:

       

      var dialog = {
              ExhNum: "",


              commit:function (dialog) { // called when OK pressed
                      var results = dialog.store();
                      this.ExhNum = results["txt1"];
                     
              },     

              description:
              {      
                      name: "Exhibit Stamp",    // Dialog box title
                      elements:
                      [      
                              {      
                                      type: "view",
                                      elements:
                                      [      
                                             {       
                                                      name: "Exhibit Number:",
                                                      type: "static_text",
                                              },     
                                              {      
                                                      item_id: "txt1",
                                                      type: "edit_text",
                                                      char_width: 8
                                              }, 
                                          {      
                                                      type: "ok_cancel",
                                                      ok_name: "Ok",
                                                      cancel_name: "Cancel"
                                              },     
                                      ]      
                              },     
                      ]      
              }      
      };


      if(event.source.forReal && (event.source.stampName == "#JcvSpJdDr50IYVmKy6fCED"))
      {
        if ("ok" == app.execDialog(dialog))
        {
          var cMsg = dialog.ExhNum;
          event.value = cMsg;
          event.source.source.info.tPExhRY1 = cMsg;

          cMsg = dialog.ExhNum;
          this.getField("tPExhRY1").value = cMsg;
        }
      }

       

      Any assistance would be greatly appreciated!