HI, guys
i wrote a events OnvalidatingWrite when i fill the applicant form new record we want to fill the Contact information mandatory
but, this code when i save applicant form after getting the error throw but, i before close form it is closing what to be done?
[FormDataSourceEventHandler(formDataSourceStr(HcmApplicant, HcmApplicant), FormDataSourceEventType::ValidatingWrite)]
public static void HcmApplicant_OnValidatingWrite(FormDataSource sender, FormDataSourceEventArgs e)
{
var datasource = sender as FormDataSource;
var args = e as FormDataSourceCancelEventArgs;
var Applicants = datasource.cursor() as HcmApplicant;
HcmApplicant applicant;
DirPerson person;
DirPersonName personName;
LogisticsElectronicAddress electronicAddress;
DirPartyTable dirPartyTable;
select firstOnly applicant
join Person
where Person.RecId== applicant.Person
&& applicant.ApplicantId == applicant.ApplicantId
join personName
where personName.Person == person.RecId
join dirPartyTable
where dirPartyTable.RecId == person.RecId
join electronicAddress
where electronicAddress.PrivateForParty == dirPartyTable.RecId;
if (!electronicAddress.Location)
{
boolean doCancel = checkFailed("Must be filled Contact details.");
args.cancel();
}
}
regards,
Riyas ahmed F