Skip to main content
Question

How to load custom modules or code pages

  • July 1, 2017
  • 0 replies
  • 63 views

I am trying to step up my coding knowledge and experience within Quick Base. I know there are ways to create code pages and pull in custom scripts. My struggle is basically this, I am not a code writer. I have implemented a couple of items but want to take it to the next level. I understand the code pages, but am not quote sure how to make the call to the module and what fields (text formula fields) to add to the form to make that call.

Some detail would be greatly appreciated....once someone shows me how to turn on the light switch I will get it!

  • Quickbase Alumni
  • July 4, 2017
i think you can use the famous IOL Technique

Just create  a formula text field and make  the "Allow html tags" as checked

Paste the below code on the formula 
"<img qbu=\"module\" src=\"/i/clear2x2.gif\" " &  "onload=\"javascript:if(typeof QBU=='undefined'){QBU={};$.getScript('" &  URLRoot() &"db/" &Dbid() &"?a=dbpage&pagename=module.js&rand='+Math.random())}\">"    Create a page in Home-Settings-Pages-New Page and have the below code     $(document).ready(function(){  alert("Page is Loaded !!")  })    Save the page as module.js

Write whatever code you wish to have in the module.js. 

You can rename the page , but the same page name should be called on the formula too.

I hope this will solve your issue!!

  • Quickbase Alumni
  • July 4, 2017
Is this custom code limited to being used only on a form where that formula text field is loaded? What if I wanted to use some additional, external functions in formula field formulas? Is this possible? How does the IOL technique with the formula text field work for that situation?