• If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Announcement

Collapse
No announcement yet.

app variable in grid title

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • app variable in grid title

    Is there a way to add an app variable in a grid title. Ie the user selects a ship date, we want the ship date to appear in the title that prints on the pdf

  • #2
    You can link app variables to the Download/Pdf Properties

    NAB - app var pdf.png

    Comment


    • #3
      good morning,

      I think what i am requesting is a bit more complex. see attached.

      Thanks in advance.
      Attached Files

      Comment


      • #4
        We will need a little more information

        What exactly do you mean by selects a supply date? Also, you mentioned filters however in your image I don't see any filters on that grid

        I think we will need the full picture of what you working with and trying to accomplish

        Thanks

        Comment


        • #5
          i attached my filter form.

          basically i want to put in my title what the user selected (along with some hardcoded verbiage)
          Attached Files

          Comment


          • #6
            Assuming you have a button that once clicked will filter your grid based on the form values

            First link an app variable to your gird widgets title "General/Title" then have your button first call a button program "EXNABBTN" that will determine what the title should be and set the app variable. Then do your normal processing...

            Comment


            • #7
              Okay i got this to work by using the execute script and setting my title in my grid to
              [apptitleheader]

              however i have another question, not sure if i should create a new post,
              but my date shows up as 2021-02-22 and i want it in month day year format.

              I am not seeing anything in the execute script to convert it?

              var vfrmShipDate = getAppVar('frmShipDate'),
              vtoShipDate = getAppVar('toShipDate'),
              vfrmSupplyDate = getAppVar('frmSupplyDate'),
              vtoSupplyDate = getAppVar('toSupplyDate');

              if (vfrmShipDate!=='0001-01-01'){
              setAppVar('apptitleheader', 'Work Order For EJ Loose' + '<br>' +
              'Ship Date Range: ' + vfrmShipDate + ' ' + vtoShipDate);
              }
              if (vfrmSupplyDate!=='0001-01-01'){
              setAppVar('apptitleheader', 'Work Order For EJ Loose' + '<br>' +
              'Supply Date Range: ' + vfrmSupplyDate + ' ' + vtoSupplyDate);
              }

              Comment


              • #8
                You can use an embedded helper to convert the date to month day year. Just need to pass in the date;

                Example:
                Code:
                var vfrmShipDate = getAppVar('frmShipDate'),
                    vtoShipDate = getAppVar('toShipDate'),
                    vfrmSupplyDate = getAppVar('frmSupplyDate'),
                    vtoSupplyDate = getAppVar('toSupplyDate'),
                    convertDate   = function(d) {
                        return Valence.query.util.Helper.grid.renderDateToMDY(d);
                    };
                
                if (vfrmShipDate!=='0001-01-01'){
                    setAppVar('apptitleheader', 'Work Order For EJ Loose' + '<br>' +
                                                'Ship Date Range: ' + convertDate(vfrmShipDate) + ' ' + convertDate(vtoShipDate));
                }
                if (vfrmSupplyDate!=='0001-01-01'){
                    setAppVar('apptitleheader', 'Work Order For EJ Loose' + '<br>' +
                                                'Supply Date Range: ' + convertDate(vfrmSupplyDate) + ' ' + convertDate(vtoSupplyDate));
                }

                Comment


                • #9
                  works perfectly! thanks

                  Comment

                  Working...
                  X