Return to Navigation

Using and Creating an Attribute Filter Class

An attribute filter class can be used to control the availability of attributes in a transaction page. You can specify the attribute filter class in the Record Context page.

The Common Attribute Framework creates an instance of this class at runtime and accesses its EntityID property. All the attributes that are mapped with this entity ID in the Record Context page are available in the transaction page. Any attribute that does not have an entity association will also be available.

Attribute Filter classes must implement the interface SCC_COMMON_ATTRIBUTE_FW:Interfaces:iAttributeFilter. Implementing teams can then code the getter method of EntityID property to return a value based on any runtime data like component buffer values or external table values.

Here is an example of an attribute filter class:

import SCC_COMMON_ATTRIBUTE_FW:Interfaces:iAttributeFilter;

class AIAFilter implements 
SCC_COMMON_ATTRIBUTE_FW:Interfaces:iAttributeFilter

   property Record ParentRecord;

   property string EntityID get;   

end-class;

get EntityID

   /+ Returns String +/

   /+ Extends/implements 
SCC_COMMON_ATTRIBUTE_FW:Interfaces:iAttributeFilter.EntityID +/

   rem Local Rowset &rs = GetLevel0()(1).GetRowset(Scroll.SSR_AIR_HDR);

   Local Record &rec = CreateRecord(Record.SSR_ITEM_TYPE);

   rem &rec.SSR_ITEM_TYPE.Value = 
&rs(CurrentRowNumber(&rs.Level)).SSR_AIR_HDR.SSR_ITEM_TYPE.Value;

   &rec.SSR_ITEM_TYPE.Value = &ParentRecord.SSR_ITEM_TYPE.Value;

   &rec.SelectByKey();

   Return &rec.SCC_ENTITY_ID.Value;

end-get;

The property ParentRecord is populated by the framework with the runtime component buffer object of the parent record. This object can then be used to access other records, rows, rowsets, and so on from the component buffer thereby giving access to any field value in the runtime component.