Running two Process On A Single Button

138 views
Skip to first unread message

Mohemmed Bilal Ilyas

unread,
Nov 13, 2014, 1:47:29 AM11/13/14
to idem...@googlegroups.com
Dear Community ,
                         Kindly Tell Me that I have created two processes 

1)Process_Purchase_Order
2)Process_Sales_Order 

Now I want to attach these two processes behind the DocComplete Button in such a way that if the window is purchase order process 1 will be called and if the window is sale order than process 2 will be called

Hiep Lq

unread,
Nov 13, 2014, 4:11:55 AM11/13/14
to Mohemmed Bilal Ilyas
Make a Process. This process will call two other

Sent from my BlackBerry 10 smartphone.
From: Mohemmed Bilal Ilyas
Sent: Thursday, November 13, 2014 14:47
Subject: [idempiere] Running two Process On A Single Button

--
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/501526ba-e352-4ea1-989b-f376021f893b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Mohemmed Bilal Ilyas

unread,
Nov 13, 2014, 7:32:34 AM11/13/14
to idem...@googlegroups.com
how can i setup hiep such a process . basically these processes contains workflows purchase order workflow and sale order workflow

Anozi Mada

unread,
Nov 14, 2014, 5:47:50 AM11/14/14
to idem...@googlegroups.com
If I understand your requirement correctly, you might want to call your process from EventHandler on C_Order Before/After Complete. Identify the PO as Sales Order or Purchase Order by IsSOTrx (or by document sub type if you want to be more specific) and run the related process.

Regards,
Anozi Mada

Kanat Mergenbayev

unread,
Nov 28, 2021, 8:24:04 AM11/28/21
to iDempiere
Hi is there simple an example how can I run process from MyCustomEventHanlder?

Thanks.

пятница, 14 ноября 2014 г. в 16:47:50 UTC+6, anoz...@gmail.com:

Saulo Gil

unread,
Nov 28, 2021, 9:35:15 AM11/28/21
to idem...@googlegroups.com

Kanat Mergenbayev

unread,
Nov 29, 2021, 12:18:21 AM11/29/21
to idem...@googlegroups.com

Kanat Mergenbayev

unread,
Nov 30, 2021, 11:46:14 PM11/30/21
to iDempiere
Can you please help me figuring out "getTrx()"

stuck with this method/function

protected void doHandleEvent(Event event) {
// TODO Auto-generated method stub
PO po = getPO(event);

if (po instanceof MBank) {
Properties context = Env.getCtx();
MBank bank = (MBank) po;
Integer tableId = bank.get_Table_ID();
Integer recordId = bank.get_ID();
Integer processId = MProcess.getProcess_ID("Single record sync", null);
MProcess process = MProcess.get(context, processId);
ProcessInfo pi = new ProcessInfo (process.getName(), process.getAD_Process_ID(), tableId, recordId);

pi.setAD_Client_ID(Env.getAD_Client_ID(context));
pi.setAD_User_ID(Env.getAD_User_ID(context));
CLogger log = CLogger.getCLogger(BankEventHandler.class);
log.warning("------ sync process started ------");
ServerProcessCtl.process(pi, getTrx());
if (pi.isError()) {
log.warning("------ sync process failed ------");
// fail("Error running Sync process" + (Util.isEmpty(pi.getSummary()) ? "" : " : " +pi.getSummary()));
return;
}


What should I pass to/as getTrx()? Could not find it test example provided above.

понедельник, 29 ноября 2021 г. в 11:18:21 UTC+6, Kanat Mergenbayev:

Heng Sin Low

unread,
Dec 1, 2021, 12:38:27 AM12/1/21
to idem...@googlegroups.com
replace getTrx() with Trx.get(bank.get_TrxName(), false);

Reply all
Reply to author
Forward
0 new messages