Solved

Duplicate a custom LU

  • 1 September 2023
  • 5 replies
  • 75 views

Userlevel 2
Badge +9

Hello.

Is that possible to duplicate a whole custom LU?

So far, I have 3 identical custom LU and I know that I will have to make more, all of them have the exact same model?

icon

Best answer by romsar 7 September 2023, 11:11

View original

5 replies

Userlevel 2
Badge +6

Hi @romsar ,

Yes you can have the same model in multiple Custom LUs, but the name of the entity can not be the same. 

/Trewon

Userlevel 2
Badge +9

Hello @Trewon 

The LU I want to duplicate has heaps of CF, their names will stay the same, unlike the LU and the page ones. How can I make a duplication?

Userlevel 2
Badge +9

Hello @Trewon 

I got no feedback, may you tell me more?

Userlevel 2
Badge +6

Hi @romsar ,

Currently there is no way of duplicating a custom LU with all of it’s attributes. It only duplicates the LU details. 

/Trewons

Userlevel 2
Badge +9

Duplicate every custom field (with only persistant fields) :

INSERT INTO custom_field_attributes_tab 
(
lu,
lu_type,
attribute_name,
data_type,
format,
data_length,
default_value_type,
default_value,
mandatory,
insertable,
updateable,
queryable,
lov,
indexed,
private,
alternate_key,
published,
used,
enabled_on_reports,
index_name,
prompt,
custom_field_type,
custom_field_impl_type,
expression,
read_only_expression,
metadata,
constraint_type,
lov_view,
lu_reference,
ui_object,
note,
definition_modified_date,
rowversion
)
SELECT
'new LU name' as LU,
lu_type,
attribute_name,
data_type,
format,
data_length,
default_value_type,
default_value,
mandatory,
insertable,
updateable,
queryable,
lov,
indexed,
private,
alternate_key,
published,
used,
enabled_on_reports,
index_name,
prompt,
custom_field_type,
custom_field_impl_type,
replace(expression, 'string to replace', 'new string value') as expression,
read_only_expression,
metadata,
constraint_type,
lov_view,
lu_reference,
ui_object,
'new note' as note,
definition_modified_date,
rowversion
FROM custom_field_attributes_tab
where lu='lu name as reference'
AND CUSTOM_FIELD_TYPE='PERSISTENT_FIELD'

I didn’t test yet to duplicate read only CF, but I would import such fields right after every persistant CF got imported in first, and proceed step by step (like import in first read only CF which only use persistant fields, before importing read only CF which use other read only CF from the same datatable, ect).

I manually created the new LU as it wasn’t a big task .

Reply