private void setWorkerSalesResponsible(LogisticsElectronicAddressLocator _email, SalesQuotationTable _salesQuotationTable) { HcmWorker hcmWorker; LogisticsElectronicAddress logisticsElectronicAddress; Logisticslocation logisticslocation; DirPartyLocation dirPartyLocation; DirPerson dirPerson; DirPersonUser dirPersonUser; userInfo userInfo; select userInfo where userInfo.networkAlias == _email join RecId from dirPersonUser where dirPersonUser.User == userInfo.id join RecId from hcmWorker where hcmWorker.Person == dirPersonUser.PersonParty; if(userInfo) { _salesQuotationTable.WorkerSalesResponsible = hcmWorker.RecId; } else { select firstonly RecId from logisticsElectronicAddress where logisticsElectronicAddress.Locator == _email && logisticsElectronicAddress.Type == LogisticsElectronicAddressMethodType::Email join RecId from logisticslocation where logisticslocation.RecId == logisticsElectronicAddress.Location join RecId from dirPartyLocation where dirPartyLocation.Location == logisticslocation.RecId join RecId from dirPerson where dirPerson.RecId == dirPartyLocation.Party join RecId from hcmWorker where hcmworker.Person == dirPerson.RecId; if(hcmWorker) { _salesQuotationTable.WorkerSalesResponsible = hcmWorker.RecId; } } }
Select validTimestate(systemDateGet()) worker from hcmEmplyment
join hcmWorker
where hcmEmplyment.Worker == hcmWorker.RecId
join dirPersonUser
where hcmWorker.Person == dirPersonUser.PersonParty
join userInfo
where dirPersonUser.User == userInfo.id
&& userInfo.networkAlias == _email
private void setWorkerSalesResponsible(LogisticsElectronicAddressLocator _email, SalesQuotationTable _salesQuotationTable) {
HcmWorker hcmWorker;
LogisticsElectronicAddress logisticsElectronicAddress;
Logisticslocation logisticslocation;
DirPartyLocation dirPartyLocation;
DirPerson dirPerson;
DirPersonUser dirPersonUser;
userInfo userInfo;
select userInfo where userInfo.networkAlias == _email
join
RecId from dirPersonUser where
dirPersonUser.User == userInfo.id
join
RecId from hcmWorker where hcmWorker.Person == dirPersonUser.PersonParty;
if (userInfo) {
_salesQuotationTable.WorkerSalesResponsible = hcmWorker.RecId;
}
else
{
select firstonly RecId from logisticsElectronicAddress where logisticsElectronicAddress.Locator == _email
&& logisticsElectronicAddress.Type == LogisticsElectronicAddressMethodType::Email
join RecId from logisticslocation where logisticslocation.RecId == logisticsElectronicAddress.Location
join RecId from dirPartyLocation where dirPartyLocation.Location == logisticslocation.RecId
join RecId from dirPerson where dirPerson.RecId == dirPartyLocation.Party join RecId from hcmWorker
where hcmworker.Person == dirPerson.RecId;
if (hcmWorker)
{
_salesQuotationTable.WorkerSalesResponsible = hcmWorker.RecId;
}
}
}
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 290,900 Super User 2024 Season 2
Martin Dráb 229,275 Most Valuable Professional
nmaenpaa 101,156