Alternative way to access item metadata on form

Alternative way to access item metadata on form

There are many ways to get item metadata in SBM - api, webservices, appscripts etc. However if you need it to be accessible from your javascript placed on state/transition form, it requires more complicated solutions, like creating AppScript which will read some tables and outputs JSON object you can use.

Alternative way is not ideal but simple and safe. If you are familiar with SBM templates, you may notice they contain many dollar-tags, like $INCLUDE(), $IF(), $SHELL() etc. They are processed by server and replaced with appropriate content (with respect to context, connected user, privileges). 

Let's consider a case when you need transition id and name in your script placed on transition form. In this case you should modify formbody.htm template. Find first <script> tag inside <body>, and add new variable declaration right here:

var transitionName_forCustomScript = "$TRANSITIONNAME()"; //I would suggest to don't use common names like transitionName to avoid any conflicts

Now transitionName_forCustomScript variable is accessible from your script on load. 

There is a list with tags could be used:

$SOLUTIONID() - id of current solution

$TABLEID() - id of current table

$TABLENAME() - table tame

$PROJECTID() - project name

$TRANSITIONID() - id of transition executing right now

$TRANSITIONNAME() - transition name

$TRANSITIONINTERNALNAME() - transition internal name

$USERID() - id of user which runs transition

$USERLOGINID() - user loginid

$USERLOCALE() - user locale

$USERAVATAR() - path to user avatar

Labels (1)

DISCLAIMER:

Some content on Community Tips & Information pages is not officially supported by Micro Focus. Please refer to our Terms of Use for more detail.
Comments
Thanks Dimitry, this should have been obvious. I have also found that I can place the "dollar tags" directly into an HTML/JavaScript widget. Alternately, I found some existing vars that I could usefully reference in my state form like so: var viewWindow = getViewWindowFromChild(window); if (viewWindow == undefined) return; var recordId = viewWindow.sRecordId; var displayId = viewWindow.issueId;
Yes, there are many variables already here you can use. Just be careful and don't override them 🙂
There are many ways to get item metadata in SBM - API, web services, app scripts etc. However, if you need it to be accessible from your javascript placed on state/transition from it requires more complicated solutions, like creating AppleScript which will read some tables and outputs JSON object you can use.
To get ALTERNATIVE WAY TO ACCESS ITEM METADATA ON FORM SBM - API, web services, app scripts etc , types of metadata in data warehouse administrative metadata structural metadata descriptive metadata is another name for msbuild item metadata functions structural metadata examples descriptive metadata is another name.
It has been seen that there are many ways to get item metadata in SBM - api, webservices, appscripts etc or if you need it to be accessible from your javascript placed on state/transition form, it requires more complicated solutions, like creating AppScript which will read some tables and outputs JSON object you can use.
As the world is getting digital day by day which is good for all of us but with this there is a negative thing in it too that the hackers can do anything if you are not giving proper attention on your part. Hackers are also now working as like viruses in our system. for more information
Ludo is a game which refreshes the childhood days in a modern way. Being a classic board game, it can be played between friends, family & kids via offline and also with online worldwide players by using online modes. This cross-platform multiplayer game app is available for Android mobile platform at the same time. Real chats and video calling features make LudoChat:https://play.google.com/store/apps/details?id=com.CRE8.LudoChat ludo more interesting and exciting among player of all age.
Top Contributors
Version history
Revision #:
2 of 2
Last update:
‎2020-01-30 18:14
Updated by:
 
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.