English
Common Issues
About 317 wordsAbout 1 min
2026-01-09
Troubleshooting Guide
- Deleting Detail Data
Use theremoveDetailfunction to delete detail data. The where closure should filter out data that meets the criteria.
If multipleremoveDetailoperations target the same object data within the same UIEvent, only the lastremoveDetailwill take effect.
Reference code:
List list = context.details['object_I71Sd__c']
UIEvent event = UIEvent.build(context) {
List deleteList = []
list.each { item ->
def map = item as Map
if (map['field_xxx__c'] == '001') {
deleteList.add(map)
}
// Batch delete details
log.info('Executing batch deletion, details to be deleted: ' + deleteList)
}
removeDetail 'object_I71Sd__c' where { x -> (deleteList.contains(x['field_2Q2qf__c'] as String)) }
}
return event- Using UI Events in Complex Scenarios (1 Master with Multiple Details)
When using UI event functions with multiple detail objects and data conditions, advanced capabilities shown in the screenshot won't work as expected when used within loops.
Incorrect example (advanced capabilities not working):
UIEvent event = UIEvent.build(context) {
// Update master object data
// Using UI event advanced capabilities like: hiding detail objects, hiding detail buttons, business types, fields, etc.
}
// Get currently operated detail data
Map currentData = event.getCurrentDetail()
// Query data and perform assignment operations
event = UIEvent.build(context) {
// Edit detail data
editDetail "object_uw3UD__c" set("field_jjulF__c": pro_unit, "field_68p0q__c": pro_kemu_id, "field_vmevL__c": pro_kemu_code) where { x -> (x["field_L72j3__c"] as String) == pro_id }
}
return eventRecommended more flexible approach:
UIEvent.Builder builder = UIEvent.Builder.create(context)
// Call builder methods directly as documented in UI Event documentation (see screenshot)
builder.editObject 'object_0wK5p__c' hidden(true)
return builder.getUIEvent()
Rewritten function:
UIEvent.Builder builder = UIEvent.Builder.create(context)
// Update master object data
builder.editMaster("name": "test", "b": 2)
// UI event advanced capabilities like hiding detail objects
builder.editObject 'object_0wK5p__c' hidden(true)
// Get currently operated detail data
UIEvent event = UIEvent.build(context) {
}
Map currentData = event.getCurrentDetail()
// Query data and perform assignment operations
Fx.object.find('xxxx', xxx)
// Edit detail data
builder.editDetail "object_uw3UD__c" set("field_jjulF__c": pro_unit, "field_68p0q__c": pro_kemu_id, "field_vmevL__c": pro_kemu_code) where { x -> (x["field_L72j3__c"] as String) == pro_id }
return builder.getUIEvent()