portal page 2 data objects--need bottom one to refresh

Sort:
You are not authorized to post a reply.
Author
Messages
drhoades44
Advanced Member
Posts: 46
Advanced Member

    We have a portal page with 2 data objects (vendor invoices top; invoice payments at bottom).  The problem is that if we filter or hit Previous or Next, we need the bottom data object to disappear until an invoice is clicked (based on the new query). Does anyone know how to do this?

    David Williams
    Veteran Member
    Posts: 1127
    Veteran Member
      You might be able to update the 2nd DME with a query that you know won't return any records. An event, like clicking Next, should be able to trigger the update.
      David Williams
      drhoades44
      Advanced Member
      Posts: 46
      Advanced Member
        That makes sense but I don't know where to put the Triggers on the Filter, Next and Previous.
        John Henley
        Senior Member
        Posts: 3348
        Senior Member
          Look at the events for the DME object, like OnApplyFilter, etc. In there you could set the 2nd data object invisible, something like this:

          var objDme = page.objects["data1"];
          if (objDme) then
          objDme.style.visibility = "hidden";
          Thanks for using the LawsonGuru.com forums!
          John
          drhoades44
          Advanced Member
          Posts: 46
          Advanced Member
            I tried putting the following code in the portal script page:

            function data0_OnApplyFilter()
            {
             var objDme = lawForm.objects["data0"]
             var objDme1 = lawForm.objects["data1"];
             //if (objDme) then
              //objDme1.style.visibility = "hidden";
              //objDme1.hide = 1;
            }

            I get this error:
            Error sending event - data0_OnApplyFilter

            I need to know
            1. How/where to put the code to hide or refresh the bottom. If I hide it, I have to have an event so when an row is clicked in the top, the bottom is not hidden (OnRowClick).
            2. If someone has some Portal Page javascript, a sample that I could see, I would really appreciate it. This is very new to me. I'm not sure if the code goes in the main xml file or if it needs to go in the xml files for the data objects.
            3. Of lesser importance, I would like to translate CBTRANS.REC-STATUS in the bottom data object to actual text. I know how to write the case statement (don't know how to use rules), but don't know how to get it in the data object.

            Any help is greatly appreciated!!
            Eddie Smith
            Advanced Member
            Posts: 39
            Advanced Member
              If you found a solution to hiding the 2nd DME query,we would be interested to know it as well. We would like to do the same thing we an AR portal page. In case you have not solved your 3rd question concerning CBTRANS_REC-STATUS description instead of the code, all you need to do is edit the source XML code by adding , xlt to the field as follows...<FIELD name="REC-STATUS,xlt"....
              David Williams
              Veteran Member
              Posts: 1127
              Veteran Member
                To hide the 2nd Query until a record is selected in the 1st Query, simply set the data1 Auto Hide to Yes and then pass the select criteria to your data1 query when you click a row in the first. See attached.
                Attachments
                David Williams
                Eddie Smith
                Advanced Member
                Posts: 39
                Advanced Member
                  David, what if your query has no select criteria? I tried remming that portion out of your script but it still does not work.
                  David Williams
                  Veteran Member
                  Posts: 1127
                  Veteran Member
                    If there's no criteria then why hide it?
                    David Williams
                    Eddie Smith
                    Advanced Member
                    Posts: 39
                    Advanced Member
                      Because, we are using a filter on the first dme for the end user to narrow the search results. The filter allows the user to enter the company and trans type and optionally the invoice number. It's not critical that the 2nd dme to be hidden, but we would like for it to hide whenever the user clicks the "find" button on the filter parameter menu and only appear whenever the user clicks on a row in the 1st dme.
                      You are not authorized to post a reply.