User Class (How do we instantiate a user class in Studio?)

How would I instantiate using the following user class in a WebForm?

User Class

I created a user class named ucJeremyClass in Studio under the Explorer’s Classes theme.

	this.log = []
function clearLog()
	this.log = []
function addEntry(note : string)
function getLog()->json : string
	json = jsonStringify(this.log, *)
function countLog()->count : integer
	count = this.log.length

WebForm Data Source

In a WebForm, I also created a data source named myLog to hold a reference to an instance of ucJeremyClass.


  1. How do I instantiate my user class ucJeremyClass to assign a reference to the data source named myLog?

  2. Where can user classes be used in Qodly?

Hey Jeremy.

Only exposed Function through DataStore (ds), DataClass, Entity or Selection can be used directly in Qodly studio. In your case:

User classes can be used in DataStore, DataClass, Entity, Selection’s functions or the other user classes’s functions.

  1. How do I instantiate my user class ucJeremyClass to assign a reference to the data source named myLog?

Do you need this class to handle all your logs or it will be logs by webForms ?


I would like to know how to assign the log instance both globally and for just a single WebForm.

For the moment, I am trying to keep the log simple. So, I would like to assign it to a WebForm.


here’s a use case, in the dataStore you can create two exposed functions

exposed function getLogs() : string
	var logcs : cs.log
	if ( == null)
		use (, kShared)
exposed function addLogs(note: string)
	if ( != null)

i created a simple webForm

logs is a text component to display the logs
log is a text input and add is a button
first you should create 2 data sources (both of them are strings)
bind logs to the text component to display logs and bind log to the text input


on webForm’s onLoad add this event

and add those event to onClick on add button

you should get something like this

and when you click on add

PS: you will see i saved the class’ object in the session’s storage so if the session is kept alive you can get the logs.