Uploaded image for project: 'Nuxeo Platform'
  1. Nuxeo Platform
  2. NXP-27185

Fix date type field not updating with automation scripting

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 10.10
    • Fix Version/s: None
    • Component/s: Core
    • Environment:
      All

      Description

      I created a document with a custom schema where a date type field named contract:endDate exists.

      That I created an automation script: contractReport connected to an action button: customCRenovation where, once clicked, the date is updated one year.

      The script and button are working but the date doesn't always in webui, returning to the 1st date of the document. If the page is refreshed, the date then is correctly updated.

      Also when I stop the server and launch it again, all the changes made in the contract:endDate are lost, so the changes aren't being saved in the database.

      Automation Script:

      // Add one more year to the contract:endDate
      
      function run(input, params) {
        
        var endDate = input ["contract:endDate"];  
         
        endDate.add(1, 1);
          
        Document.Update(input, {
          'properties': {
            'contract:endDate': endDate
          },
          'save': true
        });
      }
      

      .jar in attachment

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 2 hours
                  2h