webERP Forum

Full Version: how to create a custom name object
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi there

I need to dynamically recreate an array in order to correctly alter a session

here is my issue

What I need:
Code:
[SerialItems] => Array
                        (
                            [ABLE_11/18/20] => SerialItem Object
                                (
                                    [BundleRef] => ABLE_11/18/20
                                    [BundleQty] => 16
                                    [ExpiryDate] => 11/18/2020
                                )

                        )


when recreate my array $LnItm->SerialItems[], I get a stdClass Object instead:

Code:
[SerialItems] => Array
                        (
                            [ABLE_11/18/20] => stdClass Object
                                (
                                    [BundleRef] => ABLE_11/18/20
                                    [BundleQty] => 16
                                    [ExpiryDate] => 11/18/2020
                                )

                        )

What do I need to do to change the stdClass Object to SerialItem ?

Thanks!
I found my answer by digging in the code, directly using the function instead of building the array manually.

This allows me to achieve a major improvement by populating the "confirm dispatch invoice" page automatically with the next available lot without the need to enter individually each lot number (it's not uncommon for us to get order with 30 or 40 lines, it saves us a lot of time)
Reference URL's