Hi Experts,
I need to run a job to stop the customer account for all transactions if there is no Email details specified in the contact information (at least one email account no need to look for primary or not). I was trying with below code but it doesn't work.
static void BlockCustomerAccount_Contact(Args _args)
{
CustTable custtable;
LogisticsElectronicAddress logisticselectronicaddress;
DirPartyLocation dirPartyLocation;
LogisticsLocation logisticsLocation;
ttsbegin;
while select forupdate CustTable
join dirPartyLocation where custtable.Party == dirPartyLocation.Party
join LogisticsLocation where LogisticsLocation.RecId == DirPartyLocation.Location
join logisticsElectronicAddress where logisticsElectronicAddress.Location == logisticsLocation.RecId
&& logisticsElectronicAddress.Type != LogisticsElectronicAddressMethodType::Email
&& custtable.Blocked != CustVendorBlocked::All
{
custtable.Blocked = CustVendorBlocked::All;
custtable.doUpdate();
Info(strFmt("%1 - Blocked ", custtable.AccountNum));
}
ttscommit;
}
*This post is locked for comments