Develop > Programming > Where can I use JavaScript in Service Manager? > Corresponding JavaScript syntax for RAD language tasks

Corresponding JavaScript syntax for RAD language tasks

Most Service Manager tasks can be translated from RAD language to JavaScript by using the JavaScript expressions identified in the following table. In the JavaScript expression, the ObjectName is the name of a Service Manager object such as a table.

Service Manager task RAD panel / expression JavaScript expression

Create a file variable

rinit

new SCFile(“filename”)

Select a record

select

RC=ObjectName.doSelect(“Query”)

Update a record

rupdate

RC=ObjectName.doUpdate()

Add a record

radd

RC=ObjectName.doInsert()

Delete a record

rdelete

RC=ObjectName.doRemove()

Refer to a field in a file

result=fieldname in filevariable

result=ObjectName.fieldname

Access an element of an array

result=rownumer in arrayname in filevariable

result=ObjectName.arrayname[rownumber]

Send a message to screen

call message application

print(“message”)

Convert a field / Object to string

str()

RC=ObjectName.getText()