RE: Custom number sequence based on Sales ID
I am able to extend this class using COC. Two classes need to be extended PurchAutoCreate_Sales and PurchAutoCreate. The first/derived class calls the second/base class using super() to generate the PO number.
I am providing more insight into my logic:
First-class extension:
[ExtensionOf(classstr(PurchAutoCreate_Sales))]
final class PurchAutoCreate_Sales_Extension
{
public void setPurchTable()
{
myPurchId = salesTable.salesid;
if (tradeLineDlvType == TradeLineDlvType::DropShip)
{
myDeliveryType = TradeLineDlvType::DropShip;
}
next setPurchTable();
}
}
Base class extension:
[ExtensionOf(classstr(PurchAutoCreate))]
Final class PurchAutoCreate_Extension
{
public PurchId myPurchId;
public TradeLineDlvType myDeliveryType;
protected NumberSeq retrievePurchaseOrderNumberSequence()
{
next retrievePurchaseOrderNumberSequence();
return this.ReturnValue();
}
public NumberSeq ReturnValue()
{
PurchId purchId;
TradeLineDlvType deliveryType;
NumberSeq abc;
NumberSequenceTable numtable;
PurchAutoCreate_Sales PurchAutoCreate_Sales;
purchId = myPurchId;
deliveryType = myDeliveryType;
if (deliveryType == TradeLineDlvType::DropShip)
{
abc = NumberSeq:: //Dont know which method should be used here
abc.used();
}
else
{
abc = this.retrievePurchaseOrderNumberSequence();
}
return abc;
}
}
The base Class method which generates the PO number (out of the box):
public void setPurchTable()
{
NumberSeq num;
PurchId tmpPurchId;
//
PurchTable_W purchTable_W;
//
if (!vendTable)
{
throw error("@SYS23020");
}
purchTable.clear();
purchTable.initValue(this.purchType());
num = this.retrievePurchaseOrderNumberSequence();
tmpPurchId = num.num();
The tmpPurchId in the base class is str. If I am not using the Number Sequence platform then how can I assign/return string value (my customized number) to the tmpPurchId?