Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const fields = fieldsOfView('itsm_change_request', '171389475835325430')
- print_r(fields)
- function fieldsOfView(tableName, formId) {
- let tableID = (new SimpleRecord('sys_db_table')).get('name', tableName).sys_id;
- let field = new SimpleRecord('sys_ui_form_element')
- field.addQuery('form_section_id.form_id.table_id', tableID)
- field.addQuery('form_section_id.form_id', formId)
- field.addQuery('column_id', 'ISNOTEMPTY')
- field.orderBy('position');
- field.query();
- let fieldLocation = {};
- let section = [];
- let fieldName = [];
- let sectionAndFieldNemes = [];
- while (field.next()) {
- fieldLocation[field.column_id.column_name] = getDisplayName(field.column_id)
- }
- return fieldLocation
- }
- function getDisplayName(ID) {
- let field = new SimpleRecord('sys_translation')
- field.addQuery('record_id', ID)
- field.addQuery('language_id', ss.getUser().language_id)
- field.query();
- field.next()
- return field.value
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement