We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 6848
    • 52 Posts
    Hi, I have following MIGX (only part of the code for easier explanation)
            {
              "MIGX_id":1,
              "field":"title",
              "caption":"Title",
              "inputTVtype":"text",
              "pos":1
            },
            {
              "MIGX_id":2,
              "field":"file",
              "caption":"Document",
              "inputTVtype":"file",
              "pos":2
            },
            {
              "MIGX_id":3,
              "field":"file2",
              "caption":"Timestamp",
              "inputTVtype":"file",
              "pos":2
            },


    I would like to implement following functionality:
    1. A user uploads a file to the "document" field.
    2. After the file is uploaded and the value of the field is set a code is executed, which:
    2.1. takes the value of the document field
    2.2. generates a timestamp file (this I know how to do using TSA and openssl)
    2.3. sets the value of "timestamp" field with the link to the generated file

    How can I hook to the creation of the record, take the value from "document" field and set the value in "timestamp" field?
    I appreciate any help.
      • 6848
      • 52 Posts
      Is this impossible or too simple to be answered smiley?

      Is the answer in https://forums.modx.com/thread/102029/migx---elaborate-field-before-close#dis-post-550021 valid in this case?
      Looks like using a snippet in this.renderChunk of the target field will do the job. Is this correct? [ed. note: ddim last edited this post 7 years ago.]