Saturday, November 22, 2014

Collapse or Expand Group box on page using peoplecode


For Collapsing/Expanding group box on page using peoplecode you just need to reference the field associated with your group box to set the DataAreaCollapsed property to True or False.

To know the field associated with your group box check the property of your group box and in peoplecode you can have this syntax 

/*for collapsing group box*/
RecordName.FieldName.DataAreaCollapsed = True;/*for expanding group Box*/
RecordName.FieldName.DataAreaCollapsed = False;

generally this property is used when you have selected Collapse  in group box property and you want to expand the group box on some validation.This code is also useful when you need to collapse the group box when user fills all the fields values present in group box and clicks on save so your page wont look messy with so many fields.

Example of Collapsible Group Boxes:
Spain is expanded while the group boxes for France, Italy, and USA are collapsed:



This is what I learned today,I'll be sharing my learnings with my blog audience,Kindly let us know  your queries in comments  or you can mail us on csdoon@gmail.com