i got a is there no LogisticsElectronicAddress
but i tried in your logic same it is not working once filled in contact details then i will try close form
came "Must be filled in phone" what did i mistake.
below the code.
[ExtensionOf(formStr(smmLeadTable))]
final class SmmLeadTable_TWI_Extension
{
/// <summary>
///
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
[FormEventHandler(formStr(smmLeadTable), FormEventType::Closing)]
public static void smmLeadTable_OnClosing(xFormRun sender, FormEventArgs e)
{
FormDataSource fds = sender.dataSource('smmLeadTable');
smmLeadTable leadTable = fds.cursor();
LogisticsElectronicAddress logisticsElectronicAddress;
DirPartyTable dirpartytable;
select firstonly LogisticsElectronicAddress where logisticsElectronicAddress.PrivateForParty == leadTable.Party
&& logisticsElectronicAddress.Type == LogisticsElectronicAddressMethodType::Phone;
if (!LogisticsElectronicAddress)
{
throw error("Must be filled in Phone!");
}
}
}