Hi
I already have a validation code for the following where before submit, it checks whether the checkbox is clicked or not.
Similar way, I need to add in the same validate rule - if (ret && DFF_GiftsTable.DFF_RetainSurrender == DFF_RetainSurrender::Retain)
like to check if attachment exists or not. If not then validation message.
I dont have much idea on the code to check whether the document exists or not
public boolean validateWrite()
{
boolean ret;
ret = super();
if (ret && GiftsTable.RetainSurrender == RetainSurrender::Retain)
{
if (!GiftsTable.ValuationCertificate && !GiftsTable.ChequePayableToCollector && !GiftsTable.RequestInvoice)
{
ret = checkFailed("Please complete Section 2");
}
}
else if (ret && GiftsTable.RetainSurrender == RetainSurrender::Surrender)
{
if (!GiftsTable.DonateToCharity && !GiftsTable.Insert)
{
ret = checkFailed("Please complete Section 2");
}
}
return ret;
}
Thanks