Hi,
I created a table enhancement using AET. I informed a name for a Z table. The Z table and a new Z UI component were successfully generated and I could insert the assignment block for this new UI component successfully in the main view. In the UI Component Workbench I see my Z table in the Context as a Context Node. Everything seems to be correct, and I can insert, edit and delete entries in this table using the Assignment block, and the entries are correctly saved with the parent_id and the object_id.
The problem is that this table must have lines with fixed value for one of the fields (the first field after the object_id) for all documents created depending on the number of lines of a check table, where we will maintain values for this field using a maintenance view. The other fields of the table enhancement must be edited. I can't allow insertion of entries, I can only allow Edit. I could set the field as disabled in the GET_I_<FIELD> method and it worked. And I could hide the buttons Insert and Delete in IF_BSP_WD_DYN_BTN_CONTROL~GET_BUTTONS, and it worked.
But I don't know how to force the table to always start with fixed lines and the fixed values in this field.
What I need is:
Select values of field1 in a check table.
Ex:
ZCHECKTABLE-FIELD1 |
---|
VALUE1 |
VALUE2 |
VALUE3 |
So, every time a new document is created, the assignment block needs to automatically bring a table like below, with only Edit button. User will fill the other fields and when the document is saved, the 3 lines must be saved in the Z table.
FIELD1 | FIELD2 | FIELD3 |
---|---|---|
VALUE1 | ||
VALUE2 | ||
VALUE3 |
The next time the document is displayed, this initialization will not be necessary, the table must show what was saved, and this part of showing what is in the Z table is working because I tested first using the button Insert to insert lines, saved, closed and then when I open again the document the entries are displayed and I can edit them (So, the AET created all the necessary codes for that). It's only for the first time, to force that the table will always have these lines with field1 saved.
I am new to CRM and to BOL/GenIL, so I am facing difficulties to make this work. I tried to work with method ON_NEW_FOCUS, as this method is called from method CREATE_ZTABLE, I followed How to display a z-table in an assignment block - CRM - SCN Wiki and included new entries in the collection from the Z check table just after the call of super->on_new_focus.
The values are shown (so I had 3 lines with the first field filled) but when I saved the document, the table was not updated. As the wiki was only explaining how to display a Z table, I am sure I'm missing some steps.
Can someone give me any clue?
Thanks you so much,
Anne.