5 Replies Latest reply: Sep 23, 2013 4:43 AM by anai RSS

    fill one of the items automatically

    prog

      In my application there is a  payment form. I have 7 items which need to be filled. one of them items is (payment) and it should be display only. the computation will come from the total of all the orders prices in another table.

      please let me know how can I put the sql code for the payment field according to the invoiceno we select.

      Calendar

      http://10.100.30.33:8080/i/themes/theme_4/images/lov_icon.png


        • 1. Re: fill one of the items automatically
          vdsadhi

          You said,

           

          the computation will come from the total of all the orders prices in another table.

          Have you created any computation to populate the value for payment field??  Please give some more details?? What I understood is you want to fill the value in Payment field based on Invoiceno field value. Is it so? You can use dynamic action for that if you are in APEX version 4.x.

           

          Thanks

          Lakshmi

          • 2. Re: fill one of the items automatically
            prog

            correct I am using this code in jasper report which calculating the total

             

            SELECT SUM(ORIT.PRICE *OTOR.QUANTITY) - OT_INV.DISCOUNT AS TOTAL

            FROM OUTPATIENT_ORDER OTOR FULL JOIN ORDERITEMS ORIT ON (OTOR.ORDERID = ORIT.ORDERID)

            FULL JOIN OUTPATIENTINVOICE OTINV ON ( OTINV.INVOICENO = OTOR.INV)

            FULL JOIN OUTPATIENT_PAYMENT OT_INV ON (OT_INV.INVOICENO = OTINV.INVOICENO)

            WHERE OTOR.INV =$P{INV}

            GROUP BY OT_INV.DISCOUNT

             

            $P{INV} is representing the item invoiceno in the page. and the user is selecting it in the beginning from a dynamic pop list

            So once the user select the invoice no the payment field should be filled automatically according to the code above

            where should I put this code

            • 3. Re: fill one of the items automatically
              prog

              Any Solution please?

              • 4. Re: fill one of the items automatically
                prog

                I tried the dynamic action for the POPUP  LOV  (invoiceno)

                when the even change for the item invoiceno

                the action is set value for the item payment

                PL/SQL EXPRESSION 

                 

                select TOTAL

                into :P17_PAYMENT

                from OP-PAYMENT

                where INVOICENO =: P17_INVOICENO

                 

                I am getting the following error :

                error has occurred

                • ORA-06550: line 4, column 18: PLS-00103: Encountered the symbol "SELECT" when expecting one of the following: ( - + case mod new not null <an identifier> <a double-quoted delimited-identifier> <a bind variable> continue avg count current exists max min prior sql stddev sum variance execute forall merge time timestamp interval date <a string literal with character set specification> <a number> <a single-quoted SQL string> pipe <an alternatively-quoted string literal with character set
                • 5. Re: fill one of the items automatically
                  anai

                  I haven't really understood the beginning of the thread, but as far as your last post goes, try this.

                   

                  Change the true action to Execute PL/SQL code.

                  Then use this code:

                   

                   

                  begin
                  
                  select TOTAL
                  into :P17_PAYMENT
                  from OP-PAYMENT
                  where INVOICENO =: P17_INVOICENO;
                  
                  end;
                  

                   

                  Page items to submit: P17_INVOICENO

                  Page items to return: P17_PAYMENT

                   

                  HTH.