Your code seems to do something completely else than what you described earlier. And it completely ignores my suggestion of hooking in the modified method of the data source fields. Earlier you wrote that if user inputs value in debit field, credit field should be cleared / emptied. And vice versa.
But now you seem to have some "DebCredProposal" field which you are using.
I suggest that you spend a bit more time trying to clarify your requirement to yourself and to us.
IF your requirement is this: "in the Ledger journal credit and debit is there a Credit and Debit both of value one value 'cleared'. same action we need in my custom form." then you should hook in the modify methods of your Debit/Credit fields in the form data source.
modified method of debit field:
public void modified()
{
super();
if (myTable.DebitField)
{
myTable.CreditField = 0;
}
}
modified method of credit field:
public void modified()
{
super();
if (myTable.CreditField)
{
myTable.DebitField = 0;
}
}