Savelyev_Vyacheslav

getRemAttrServer

Jul 18th, 2024
226
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function findReCollectionIds(reModelId) {
  2.   var reCollectionIds = [];
  3.   var gr = new SimpleRecord('sys_re_model_collection');
  4.   gr.addQuery('re_model_id', reModelId);
  5.   gr.query();
  6.   while (gr.next()) {
  7.       reCollectionIds.push(gr.getValue('re_collection_id'));
  8.   }
  9.   reCollectionIds.push(reModelId);
  10.   return reCollectionIds;
  11. }
  12.  
  13. function findColumnNamesByReContainerIds(reContainerIds) {
  14.   var columnNames = [];
  15.   var gr = new SimpleRecord('sys_re_attribute');
  16.   gr.addQuery('re_container_id', 'IN', reContainerIds);
  17.   gr.query();
  18.   while (gr.next()) {
  19.       columnNames.push(gr.getValue('column_name'));
  20.   }
  21.   return columnNames;
  22. }
  23.  
  24. function getColumnNamesByReModelId(reModelId) {
  25.   var reCollectionIds = findReCollectionIds(reModelId);
  26.   return findColumnNamesByReContainerIds(reCollectionIds);
  27. }
  28.  
  29. const reModelId = '172121150506068425';
  30. const columnNames = getColumnNamesByReModelId(reModelId);
  31. ss.info(columnNames);
Advertisement
Add Comment
Please, Sign In to add comment