Forum Discussion

KaityStrong's avatar
KaityStrong
Qrew Member
3 years ago

Pastie Database - User Defined Page

Hello,
I am currently trying to create a ranking column on one of my reports and found some documentation in past forums regarding a method for this in the Pastie Database (I will include these below for reference). While I was going through the steps to implement this I found a note on creating a creating a User Defined Page named "module.js."  You would place custom code in the section under the alert statement in the User Defined Page.
My problem, is that I don't seem to know what a User Defined Page is or how to make one. Would anyone be able to provide assistance?
Thank you!
The Image Onload Technique Used With QuickBase================================ - Pastebin.com
Pastebin remove preview
The Image Onload Technique Used With QuickBase================================ - Pastebin.com
Not a member of Pastebin yet? Sign Up , it unlocks many cool features! The Image Onload Technique Used With QuickBase The image onload technique is a workaround that allows you to load and execute a user supplied javascript file immediately upon loading one of the following five types of pages: It is a safe and flexible technique and is one of only two ways of accomplishing this feat.
View this on Pastebin >


------------------------------
Kaity Strong
------------------------------
  • AustinK's avatar
    AustinK
    Qrew Commander
    Pretty much anything you find for the IOL technique is no longer possible as written in the guides because Quickbase disabled the use of JavaScript easily in the apps. It is still possible to use in other ways but you will need to utilize service workers I believe and it is quite a bit more involved as you will need to come up with your own solution there and then implement what you have linked into it.
    • KaityStrong's avatar
      KaityStrong
      Qrew Member
      That's a bummer. Thank you for letting me know. Do you know of any other ways to make a ranking report?

      ------------------------------
      Kaity Strong
      ------------------------------
      • MarkShnier__You's avatar
        MarkShnier__You
        Icon for Qrew Legend rankQrew Legend
        if your dataset is not too large like thousand of records and not 10's of thousands you can use Formula Queries.  The info below was posted by @Elwyn Dow . who I believe is a developer at Sympo.

        I have other examples and also there is a nice video by Ms Junkie. https://www.youtube.com/watch?v=sHU8pB38N2Y  Her enthusiasm in the morning is better than a morning coffee.  @Quick Base Junkie


        https://community.quickbase.com/communities/community-home/digestviewer/viewthread?MessageKey=85f95242-4b4d-4a61-9f07-1a1c80f53a73&CommunityKey=d860b0f8-6a48-487b-b346-44c47a19a804&tab=digestviewer#bm85f95242-4b4d-4a61-9f07-1a1c80f53a73


        Ranking formula using the new Query functions. Will rank records based on numeric field.  Ranks top 10, top 100, etc – or every value…

        var bool descOrder = true;            // true if ranking from high to low, otherwise false
        var number maxrank = 0;             // 0 to rank every number, else 10 to rank 1 through 10, 100 to rank 1 through 100, etc
        var number fieldId = 17;              // the field id of the numeric field being ranked - CHANGE AS NEEDED
        var number rankThis = [number field];  // the numeric field being ranked - CHANGE AS NEEDED
        var number rank    = If($descOrder, Size(GetCellValues(GetRecords("{"&$fieldId&".GT."&$rankThis&"}"),$fieldId))+1,
                                            Size(GetCellValues(GetRecords("{"&$fieldId&".LT."&$rankThis&"}"),$fieldId))+1);
        If($maxrank=0,$rank, If($rank<=$maxrank,$rank,null))

        ------------------------------
        Elwyn Dow ​​​​

        ------------------------------
        Mark Shnier (YQC)
        mark.shnier@gmail.com
        ------------------------------