--
You received this message because you are subscribed to the Google Groups "iDempiere" group.
To unsubscribe from this group and stop receiving emails from it, send an email to idempiere+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/idempiere/b33d00b6-efb9-42be-9e0d-4ce813c88e1cn%40googlegroups.com.
Hello Kanat,
When working with model classes that already exist in the core, it is best to leave the iDempiere core without modifications and handle everything from a plugin. If all you need is to add get/setters to core model classes, you could take only the generated interface files, then use them within your plugin via POWrapper.
Best regards,
| Saulo Gil | Orbital Software | +54 911 3049 4237 |
To view this discussion on the web visit https://groups.google.com/d/msgid/idempiere/0100017d9a0c653d-d4555d66-8f67-4ca4-8e2f-730d5c742de2-000000%40email.amazonses.com.
Sure, it'd go like this:
MBank bank = (MBank) getPO(event); //
taking Heng Sin's example
your.package.I_C_Bank customBank = POWrapper.create(bank, your.package.I_C_Bank.class);
customBank.setFoo(bar);
// invoke your own setter/getter
bank.save();
Can you please share an example of using Powrapper with me.
On Wed, 8 Dec 2021 at 18:37 Saulo Gil <saul...@orbital.com.ar> wrote:
Hello Kanat,
When working with model classes that already exist in the core, it is best to leave the iDempiere core without modifications and handle everything from a plugin. If all you need is to add get/setters to core model classes, you could take only the generated interface files, then use them within your plugin via POWrapper.
Best regards,
On 8/12/21 02:00, Kanat Mergenbayev wrote:
Hi.
Can I combine Model and Event?
On change fire event and put custom business logic into model.
I found that using model generator I can generate X_C_Bank with all new methods/fields I added in "Bank / Cash" window.
Now on
registerTableEvent(IEventTopics.PO_AFTER_NEW, MBank.Table_Name);
registerTableEvent(IEventTopics.PO_AFTER_CHANGE, MBank.Table_Name);
registerTableEvent(IEventTopics.PO_AFTER_DELETE, MBank.Table_Name);
I want to work with my custom "fields/methods" get/set them.
Is there an example how I can combine event and model?--
You received this message because you are subscribed to the Google Groups "iDempiere" group.
To unsubscribe from this group and stop receiving emails from it, send an email to idempiere+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/idempiere/b33d00b6-efb9-42be-9e0d-4ce813c88e1cn%40googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "iDempiere" group.
To unsubscribe from this group and stop receiving emails from it, send an email to idempiere+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/idempiere/0100017d9a0c653d-d4555d66-8f67-4ca4-8e2f-730d5c742de2-000000%40email.amazonses.com.
--
You received this message because you are subscribed to the Google Groups "iDempiere" group.
To unsubscribe from this group and stop receiving emails from it, send an email to idempiere+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/idempiere/CAKJs_9ueyOCz_Vj%3DWtxrETbNKG6gLL7RF2GVwGSdmyo4pMdyxw%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/idempiere/2cb6795a-5275-407c-b5c1-2f606a8d5536n%40googlegroups.com.
It looks like you could subscribe to events that ocurr before the
record is saved, such as PO_BEFORE_NEW. If that is possible, you
wouldn't need to invoke the save method as the record
would be already in the process of being saved.
To view this discussion on the web visit https://groups.google.com/d/msgid/idempiere/2cb6795a-5275-407c-b5c1-2f606a8d5536n%40googlegroups.com.