12 Replies Latest reply on Mar 18, 2019 7:43 PM by fac586

    Javascript Code Size Limit

    niki71

      Hello,

      does anyone know if there is a character limit by executing javascript code?

       

      Example: Dynamic Action -> Execute JavaScript Code (Code > 4045 characters) -> value too long error...

       

      Thanks and regards

      niki71

       

      Apex 18.2

        • 1. Re: Javascript Code Size Limit
          Dharmendra Kumar-Oracle

          Hi,

           

          You can not save more than 4K character. You can place a file with the JS code and reference it or divide the code which is independent and place it to multiple actions.

           

          Thanks.

          • 2. Re: Javascript Code Size Limit
            fac586

            niki71 wrote:

             

            Hello,

            does anyone know if there is a character limit by executing javascript code?

             

            Example: Dynamic Action -> Execute JavaScript Code (Code > 4045 characters) -> value too long error...

            In this case there is a limit of 4000 bytes. Move the JavaScript source code to an external file and just call the required method(s) from a stub in the DA editor.

            • 3. Re: Javascript Code Size Limit
              Scott Wesley

              Then ask the question - why do I have so much JavaScript code under one dynamic action response? Could I go more declarative?

              • 4. Re: Javascript Code Size Limit
                niki71

                Thanks for your help.

                 

                Regards

                niki71

                • 5. Re: Javascript Code Size Limit
                  DSteele41

                  fac586

                   

                  I'm having this same issue is

                   

                  How is this accomplished

                  "In this case there is a limit of 4000 bytes.

                  Move the JavaScript source code to an external file and just call the required method(s) from a stub in the DA editor" 

                   

                  specifically placing the Code in a "File" and call the required  method(s) from a stub in DA editor ?

                   

                  Thank You

                   

                  DSteele41

                  • 6. Re: Javascript Code Size Limit
                    fac586

                    DSteele41 wrote:

                     

                    fac586

                     

                    I'm having this same issue is

                     

                    How is this accomplished

                    "In this case there is a limit of 4000 bytes.

                    Move the JavaScript source code to an external file and just call the required method(s) from a stub in the DA editor"

                     

                    specifically placing the Code in a "File" and call the required method(s) from a stub in DA editor ?

                    Start by answering Scott's question: why are you trying to include more than 4KB of JavaScript in a dynamic action? What is the purpose of this code?

                    • 7. Re: Javascript Code Size Limit
                      Scott Wesley

                      This is better asked in a new question, linked to this one, but he's referring to a literal, old fashioned JavaScript file.

                      This file would live on the middle tier, with all its friends, and included in page attributes - check out the inline help for examples.

                      Here's an example of calling a JS function that's been included in the page.

                       

                      • 8. Re: Javascript Code Size Limit
                        DSteele41

                        Scott Wesley @fac586

                        Thank You both for Replying

                         

                        This JSCode Calculates Totals for Page Items in 2 Reports.... and I've found that using Javascript in Calculations to be much faster and reliable than doing it through PL/SQL

                        fac586 these calculations stem from the Report that you suggested be in a "Classic Report" or "Interactive Report"
                        which I'm looking to create a Stored Procedure for all the PL/SQL D.A.'s getting the Data..... currently they are in 1 D.A. with Several True Actions...
                        I'm 90% sure there is a better solution ...just not sure what

                         

                        I will repost Question and tag you in it....if that's not proper please let me know...just attempting to let you see visually what I'm referring to.

                         

                        DSteele41

                        • 9. Re: Javascript Code Size Limit
                          Scott Wesley

                          Some behaviours belong in JS, so they can be done solely on the client, but 4000 chars sounds excessive for that.

                          • 10. Re: Javascript Code Size Limit
                            fac586

                            DSteele41 wrote:

                             

                            This JSCode Calculates Totals for Page Items in 2 Reports.... and I've found that using Javascript in Calculations to be much faster and reliable than doing it through PL/SQL

                            I find that very hard to believe. JavaScript is notorious for inexact floating point calculations.

                            fac586 these calculations stem from the Report that you suggested be in a "Classic Report" or "Interactive Report"

                            I only suggested a classic report with a custom report template, which has been demonstrated here.

                            which I'm looking to create a Stored Procedure for all the PL/SQL D.A.'s getting the Data..... currently they are in 1 D.A. with Several True Actions...
                            I'm 90% sure there is a better solution ...just not sure what

                            I am 100% certain there is a better solution, but I cannot provide it without a complete understanding of the problem, which I am not going to get from a set of incomplete App Builder screenshots,

                            • 11. Re: Javascript Code Size Limit
                              DSteele41

                              fac586
                              Looking at your Demonstration Report Link  https://apex.oracle.com/pls/apex/f?p=586005:143:14391860516774::NO:::

                               

                               

                              Is that a Classic Report  based on PL/SQL or PL/SQL returning SQL Query  or did you generate it strictly through HTML ?...If So How do you get it Neatly Formatted as You have it ?
                              as well... How would I reference my page items and data being pulled from database?

                               

                              Hopefully I'm phrasing those questions correctly... My colleagues and I really like the way that is formatted and want to replicate

                               

                              Thank You again for reply,

                               

                              DSteele41

                              • 12. Re: Javascript Code Size Limit
                                fac586

                                DSteele41 wrote:

                                 

                                fac586
                                Looking at your Demonstration Report Link https://apex.oracle.com/pls/apex/f?p=586005:143:14391860516774::NO:::

                                 

                                 

                                Is that a Classic Report based on PL/SQL or PL/SQL returning SQL Query or did you generate it strictly through HTML ?...If So How do you get it Neatly Formatted as You have it ?
                                as well... How would I reference my page items and data being pulled from database?

                                 

                                Hopefully I'm phrasing those questions correctly... My colleagues and I really like the way that is formatted and want to replicate

                                This isn't relevant to the original topic of this thread. Let's continue with the previous question: Page Layout Columns Rows