Discussions

Expand all | Collapse all

can we use table aliases in scripts files

  • 1.  can we use table aliases in scripts files

    Posted 09-08-2016 20:38

    My application uses lots of jquery script files and the TABLE ID is hard coded everywhere.

    The problem is that these IDs changes when the application is either copied or a new sandbox environment is created and the IDs have to be changed in all the scripts.

    Is there a way to use the DB aliases in the script file or many be a better approach to handle this?, I tried using the DB aliases but that didn't work.



  • 2.  RE: can we use table aliases in scripts files

    Posted 07-07-2017 17:20
    You should be able to use _DBID_TABLENAME but I could be wrong about that. I definitely know that gDBID is global variable for the table ID your on. Hope that helps.


  • 3.  RE: can we use table aliases in scripts files

    Posted 07-07-2017 17:44
    You can't use table aliases in scripts. 

    However you can determine the mapping between table aliases and dbids using the API.

    Call dbid?act=API_GetSchema on the application dbid and the names and dbid's of each table will be listed within the <chdbids> tag.

    See also:

    How is the name of a table alias determined ?
    https://community.quickbase.com/quickbase/topics/how-is-the-name-of-a-table-alias-determined


  • 4.  RE: can we use table aliases in scripts files

    Posted 03-09-2018 23:57
    Oh I just posted on this.  Yes you can as long as you have the app dbid.

    https://community.quickbase.com/quickbase/topics/using-table-aliases-in-the-urls