New debtor, assign a group when created
When a new debtor is created, I want to add a particular group.
So far my code reads:
but dbGroup is null. I know I'm missing something but what? I got the ID "00614AA4EC754C7AA2D1" from looking in the CN_Groups table and just getting the groupID I want to add.
Version 7.2.1 SR5.
So far my code reads:
- Code: Select all
public void Setup(JiwaFinancials.Jiwa.JiwaApplication.IJiwaForm JiwaForm, JiwaFinancials.Jiwa.JiwaApplication.Plugin.Plugin Plugin)
{
if (JiwaForm is JiwaFinancials.Jiwa.JiwaDebtorsUI.frmDebtor)
{
JiwaFinancials.Jiwa.JiwaDebtorsUI.frmDebtor debtorForm = (JiwaFinancials.Jiwa.JiwaDebtorsUI.frmDebtor)JiwaForm;
debtorForm.Debtor.CreateEnd += DebtorNewGroup;
}
}
private void DebtorNewGroup(object sender, System.EventArgs e)
{
System.Diagnostics.Debugger.Launch();
JiwaFinancials.Jiwa.JiwaDebtors.Debtor debtor = (JiwaFinancials.Jiwa.JiwaDebtors.Debtor)sender;
JiwaFinancials.Jiwa.JiwaDebtors.Group dbGroup = new JiwaFinancials.Jiwa.JiwaDebtors.Group();
dbGroup.Group.ReadRecord("00614AA4EC754C7AA2D1");
debtor.Groups.Add(dbGroup);
}
but dbGroup is null. I know I'm missing something but what? I got the ID "00614AA4EC754C7AA2D1" from looking in the CN_Groups table and just getting the groupID I want to add.
Version 7.2.1 SR5.