Hi,
I'm creating a job in order to fix some date values from a field called DueDate in the table CustTrans. Those values are now saved correctly when they go through this process:
if (! CustPaymSched::exist(salesParmTable.TableId,salesParmTable.RecId))
{
custVendPaymSched = CustVendPaymSched::construct(SysModule::Cust,salesParmTable);
if (specQty.selection() == SalesUpdate::All && CustPaymSched::exist(salesParmTable.salesTable().TableId, salesParmTable.salesTable().RecId))
{
custVendPaymSched.copyCustVendPaymSched(CustPaymSched::find(salesParmTable.salesTable().TableId, salesParmTable.salesTable().RecId));
}
else
{
custVendPaymSched.copyPaymSched(PaymSched::find(salesParmTable.salesTable().PaymentSched));
salesParmTable.createPaymentSched();
}
}
Because I need to correct the previous ones, I'm testing a single record and I want to pass them through the same process like this:
static void CorregirFechaVencimiento(Args _args)
{
CustTrans custTrans;
CustVendPaymSched custVendPaymSched;
SalesParmTable salesParmTable;
ttsbegin;
select forupdate custTrans where custTrans.RecId == 5637617829;
if (custTrans)
{
if (! CustPaymSched::exist(salesParmTable.TableId,salesParmTable.RecId))
{
custVendPaymSched = CustVendPaymSched::construct(SysModule::Cust,salesParmTable);
if (specQty.selection() == SalesUpdate::All && CustPaymSched::exist(salesParmTable.salesTable().TableId, salesParmTable.salesTable().RecId))
{
custVendPaymSched.copyCustVendPaymSched(CustPaymSched::find(salesParmTable.salesTable().TableId, salesParmTable.salesTable().RecId));
}
else
{
custVendPaymSched.copyPaymSched(PaymSched::find(salesParmTable.salesTable().PaymentSched));
salesParmTable.createPaymentSched();
}
}
custTrans.update();
}
ttscommit;
}But I'm getting the error: The specQty variable has not been declared.
I'm trying to naviagte to the definition but I get the message: Cannot navigate to the definition. I also checked the original code where that process was located (it was inside a form called SalesEditLines) and I don't see anywhere the variable declared, neither in the classDeclaration and I don't know why it doesn't give the error there.
I don't know if this has something to do with this, but I found specQty as a method in a class SalesFormLetter but obviously that is the method and not a variable and it doesn't have the method used in the process named selection()
Thanks in advance.