Hi all,
Our customer has another extension which has this overload on a 365 function-'CreateReservEntryFor' by adding one more parameter to it. Previously when we call this function in our code, we only need to pass 11 params. now to support this customer we have to pass 12 params. If we still pass 11 params, there could be error at this customer as ' The user-defined C/AL function 'CreateReservEntryFor' requires 12 parameters. It was called with 11 parameters. '.
Is there any workaround for our customer to make their new added parameter optional? Or is there any solution that we can make our code compatible to deal with both the original function and our customer's overload on this function?
Thanks!
Info:
Original function:
CreateReservEntryFor(ForType: Option, ForSubtype: Integer, ForID: Code[20], ForBatchName: Code[10], ForProdOrderLine: Integer, ForRefNo: Integer, ForQtyPerUOM: Decimal, Quantity: Decimal, QuantityBase: Decimal, ForSerialNo: Code[50], ForLotNo: Code[50])
Our customer's overload function:
CreateReservEntryFor(ForType: Option, ForSubtype: Integer, ForID: Code[20], ForBatchName: Code[10], ForProdOrderLine: Integer, ForRefNo: Integer, ForQtyPerUOM: Decimal, Quantity: Decimal, QuantityBase: Decimal, ForSerialNo: Code[50], ForLotNo: Code[50], NetWeight: Decimal)
Is the customer logging a net weight? If not and to just satisfy the functions parameter requirements pass in a 0.
If this function is on an extension then you could look at creating it yourself and uninstall the original. I'd assume you have the source code given you have referenced old with new.
I assume you know the answers here and just want clarification from others on what they would do. Personally I would pass the net weight from whatever source line table or by getting it from the item card for the item in question.