changeCompany(_IMEIDelinkingTable.DataArea)
{
select *
from DMSSerialNumTrans
where DMSSerialNumTrans.SerialNum == _serialNum //serialNumScan.SerialNum
&& DMSSerialNumTrans.Company == curext()
&& DMSSerialNumTrans.IMEITransactionType == DmsSerialTransactionType::Purchase;
select *
from VendInvoiceTrans
where VendInvoiceTrans.InventTransId == DMSSerialNumTrans.InventTransId;
dms_IMEIDelinkingLine.PurchId = VendInvoiceTrans.OrigPurchId;
}
*/
select crossCompany InventTransId
from DMSSerialNumTrans
where DMSSerialNumTrans.SerialNum == _serialNum//serialNumScan.SerialNum
&& DMSSerialNumTrans.Company == _IMEIDelinkingTable.DataArea//curext()
&& DMSSerialNumTrans.IMEITransactionType == DmsSerialTransactionType::Purchase
join OrigPurchId
from VendInvoiceTrans
where VendInvoiceTrans.InventTransId == DMSSerialNumTrans.InventTransId
&& VendInvoiceTrans.dataAreaId == _IMEIDelinkingTable.DataArea;
/*select OrigPurchId
from VendInvoiceTrans
where VendInvoiceTrans.InventTransId == DMSSerialNumTrans.InventTransId;*/
dms_IMEIDelinkingLine.PurchId = VendInvoiceTrans.OrigPurchId;
it is better to use cross company than using change company
No comments:
Post a Comment