
Hi Guys,
I am using the segmented entry control on my custom form which is working fine, Now I want to Auto populate dimensions from the customer default dimension when the user selects the Main account in control.
which method to override? Or how to populate the other dimension from the customer when the main account is Changed.
Hi Kiran,
To achieve this you will need to merge the current record LedgerDimension with the customer DefaultDimension right after the Main Account is modified.
To handle the Main Account modification event you will need to override the onSegmentChanged() method on your segmented entry control.
Here is a sample code:
[Form]
public class MyForm extends FormRun
{
DimensionAttributeRecId mainAccountDimAttr;
public void init()
{
mainAccountDimAttr = DimensionAttribute::getWellKnownDimensionAttribute(DimensionAttributeType::MainAccount);
super();
}
[Control("SegmentedEntry")]
class Record_AccountNum
{
public void onSegmentChanged(DimensionControlSegment _segment)
{
super(_segment);
if (_segment.parmDimensionAttribute().RecId == mainAccountDimAttr)
{
record.LedgerDimension = DimensionDefaultingService::serviceCreateLedgerDimension(record.LedgerDimension, record.custTable().DefaultDimension);
}
}
}
}