HELLO All,
KINDLY PLEASE REPLAY ME,
How to Restrict if the main record contains the related records, if main record contains one record, then related record also one record must exist, if main record exists two records, then related record also must contain two records.
I have added Workflow, If the above validation will work then only, we can be able to do submit otherwise It wants to show error ( Please Fill details like)
I wrote below code, it is validating only first record, not validating for second record.
//while select KTTypeLines
// where KTTypeLines.Dependent == KTDetails.Dependent
// && KTTypeLines.DependentRecId == KTDetails.DependentRecId
// && KTTypeLines.HeaderClaimRefID == KTDetails.HeaderClaimRefID
// && KTTypeLines.EmployeeNumber == KTDetails.EmployeeNumber
//{
// select KTDetails
// where KTDetails.HeaderClaimRefID == ltClaimHeader.ClaimReferenceID
// && KTDetails.EmployeeNumber == ltClaimHeader.EmployeeNumber;
// if(KTDetails.RecId == KTTypeLines.RecId )
// {
// data.submit(args);
// }
// else
// {
// throw error("KT details and KT lines are required");
// }
//}