webERP Forum
how to create a custom name object - Printable Version

+- webERP Forum (http://www.weberp.org/forum)
+-- Forum: webERP Discussion (http://www.weberp.org/forum/forumdisplay.php?fid=1)
+--- Forum: How To ? (http://www.weberp.org/forum/forumdisplay.php?fid=6)
+--- Thread: how to create a custom name object (/showthread.php?tid=8146)



how to create a custom name object - HDeriauFF - 04-10-2018

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!




RE: how to create a custom name object - HDeriauFF - 04-11-2018

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)