[ExtensionOf(tableStr(CustInvoicejour))]
final class DTReturnOrderPackingSlipCustInvoiceTrans_Extension
{
public void insert()
{
CustInvoiceJour custInvoiceJour;
SalesLine salesLine;
SalesParmLine salesParmLine;
InventTransOrigin inventTransOrigin;
next insert();
select firstonly salesLine
join salesParmLine
where salesParmLine.SalesLineRecId == salesLine.RecId
join inventTransOrigin
where inventTransOrigin.InventTransId == salesParmLine.InventTransId
&& salesParmLine.parmId == this.ParmId
if(salesLine.DTReturnOrderPackingSlip)
{
if(custInvoiceJour)
{
ttsbegin;
custInvoiceJour.selectforUpdate(true);
if(custInvoiceJour.DTReturnOrderPackingSlip)
custInvoiceJour.DTReturnOrderPackingSlip = salesLine.DTReturnOrderPackingSlip;
custInvoiceJour.Update();
ttscommit;
}
}
info(strFmt('%1salesid ', this.SalesId));
}
}
select firstonly custPackingSlipJour
where custPackingSlipJour.SalesId == this.SalesId
&& custPackingSlipJour.PackingSlipId == this.PackingSlipId
&& custPackingSlipJour.DeliveryDate == this.DeliveryDate;
[ExtensionOf(tableStr(CustPackingSlipTrans))]
final class DTReturnOrderPackingSlipCustPackingSlipTrans_Extension
{
public void initFromSalesLine(SalesLine _salesLine,
boolean _isExtensionIntrastatEnabled )
{
CustPackingSlipJour custPackingSlipJour;
next initFromSalesLine(_salesLine,
_isExtensionIntrastatEnabled );
if(_salesLine.DTReturnOrderPackingSlip)
{
// i need to pass the value from sales line to get the record in custPackingSlipJour
select firstonly custPackingSlipJour
where custPackingSlipJour.SalesId == this.SalesId
&& custPackingSlipJour.PackingSlipId == this.PackingSlipId
&& custPackingSlipJour.DeliveryDate == this.DeliveryDate;
// here custPackingSlipJour is null in debugger so i am not getting inside if
if(custPackingSlipJour)
{
ttsbegin;
custPackingSlipJour.selectforUpdate(true);
custPackingSlipJour.DTReturnOrderPackingSlip = _salesLine.DTReturnOrderPackingSlip;
custPackingSlipJour.Update();
ttscommit;
}
}
}
}
select salesLine.InventTransId,salesLine.DTRETURNORDERPACKINGSLIP,custPackingSlipJour.PackingSlipId,* from custPackingSlipJour
join CustPackingSlipTrans
on CustPackingSlipTrans.SalesId = custPackingSlipJour.SalesId
and CustPackingSlipTrans.PackingSlipId = custPackingSlipJour.PackingSlipId
and CustPackingSlipTrans.DeliveryDate = custPackingSlipJour.DeliveryDate
join SALESLINE
on custPackingSlipTrans.SalesId = salesLine.SalesId
and custPackingSlipTrans.InventTransId = salesLine.InventTransId
where salesLine.SalesId = '10188466'
and salesLine.InventTransId = '04080278'
but this is not getting values from sales lines.
select firstonly custPackingSlipJour
where custPackingSlipJour.SalesId == this.SalesId
&& custPackingSlipJour.PackingSlipId == this.PackingSlipId
&& custPackingSlipJour.DeliveryDate == this.DeliveryDate
join custPackingSlipTrans
where custPackingSlipTrans.OrigSalesId == _salesLine.SalesId
&& custPackingSlipTrans.InventTransId == _salesLine.InventTransId;
select firstonly custPackingSlipJour
where custPackingSlipJour.SalesId == this.SalesId
&& custPackingSlipJour.PackingSlipId == this.PackingSlipId
&& custPackingSlipJour.DeliveryDate == this.DeliveryDate;
if(custPackingSlipJour)
select firstonly custPackingSlipJour
where custPackingSlipJour.SalesId == this.SalesId
&& custPackingSlipJour.PackingSlipId == this.PackingSlipId
&& custPackingSlipJour.DeliveryDate == this.DeliveryDate;
i need to pass the value of sales line i am getting in to select query but not getting how to do it .
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... 291,253 Super User 2024 Season 2
Martin Dráb 230,188 Most Valuable Professional
nmaenpaa 101,156