Hi both,
Thanks.
I want to understand what is needed to make a correct COC.
So, the intention is whenever the form displayed, the standard form will do this :
1. Turn ON the Deferred check box, all the accounts setup in Accounts section will be filled in.
2, Turn OFF the Deferred check box, standard "forget" to clear the Revenue Recognition account number.
Which number two that I would like to "fix" it.
So, by referring to the blog, I'm creating this COC:
[ExtensionOf(formStr(SubBillDeferralTransactionDeferral))]
final class MY_SubBillDeferralTransactionDeferralForm_Extension
{
/// <summary>
///
/// </summary>
public void run()
{
Object formControlObject;
FormControl formControl;
FormStringControl formStringControl;
FormReferenceGroupControl referenceGroupControl;
int i;
next run();
referenceGroupControl = this.design().controlName(formControlStr(SubBillDeferralTransactionDeferral, SubBillDeferralDeferred));
for (i = 1; i <= referenceGroupControl.controlCount(); i++)
{
formControl = referenceGroupControl.controlNum(i);
formStringControl = formControl as FormStringControl;
if (formStringControl != null)
{
formStringControl.registerOverrideMethod(methodStr(FormStringControl, modified), identifierStr(resetReferenceGroupModified), element);
}
}
}
public boolean resetReferenceGroupModified(FormStringControl _control)
{
if (_control.text() == '')
{
if (!SubBillDeferralTransactionLineDeferral.SubBillDeferralDeferred)
{
SubBillDeferralTransactionLineDeferral.SubBillDeferralRecognitionAccount = 0;
}
}
return true;
}
}
This is my understanding:
1. Variable referenceGroupControl is the variable that holds the Deferred check box account
2. The rest inside this extension run() method, will be the same. And what I think for this statement is to "catch" the modified action.
3. The addition function resetReferenceGroupModified, is served as the modifier of the value, so I'm added condition when "Deferred control" is not check (by using exclamation), then the other field for SubBillDeferralRecognitionAccount would need to be zero.
May I know is this correct ?
But then again I face error "element is not declared" like below:
May I know what is the error means ?
Thanks in advance.