Automatic Document Number

589 views
Skip to first unread message

Rheine Adithia

unread,
Nov 13, 2017, 2:40:04 AM11/13/17
to iDempiere
Hello guys,
Currently im developing a form that generates Invoice using a custom form with eclipse.
my question is, is there any stored procedure or classes that handles the document number.

My Invoice owns a unique prefix and suffix. And it uses current month and current year in the prefix..
but seeing how it stored in the Data base, i can't just use "select prefix, suffix from" SQL to call the prefix and suffix.
is there anyway to call the next document No. so it generated the month and year needed in the prefix?

thanks for the attention 
Best Regard, 
Rheine Adithia

Anozi Mada

unread,
Nov 13, 2017, 3:16:49 AM11/13/17
to iDempiere
You can setup Document Sequence and link it to the Document Type and then just let iDempiere handle the next document no for you. You don't need to specifically set the document no in your code.

ref:
http://wiki.idempiere.org/en/Document_Sequence_(Window_ID-112)
http://wiki.idempiere.org/en/NF1.0_Document_Sequence_Improved

Regards,
Anozi Mada

Rheine Adithia

unread,
Nov 13, 2017, 3:52:59 AM11/13/17
to iDempiere
Thanks for the quick reply Anozi Mada,

Document Sequence can be implemented inside the WebUI, but how do i implement it on the back end (using eclipse code)
because my form function is to insert Order head using hard code SQL. But i'm stuck at the document numbering, 
the example prefix format that i need to generate :
PO/@AD_Org_ID<AD_Org.Value>@/@DateOrdered<yy>@/@DateOrdered<MM>@/

if i create a new Purchase Order using the idempiere WebUI then the doc no is going to be :
PO/TEST/17/11/800001

is there any way that i can do this automatically in the code? or do i need to use java function and hardcode the entire format

Anozi Mada

unread,
Nov 13, 2017, 4:04:31 AM11/13/17
to iDempiere
Why not just use the java model (i.e MOrder.java) instead of inserting it directly via sql? Inserting directly via sql will bypass a lot of logic from the code (including document sequence).

Rheine Adithia

unread,
Nov 13, 2017, 4:23:35 AM11/13/17
to iDempiere
Because i didn't know that there are other method of inserting a data into the table.
Is there any reference or tutorial on how can i develop an insertion using java model that you reference in your reply?
or any class from iDempiere that i can use to learn the concept.

Best Regards,
Rheine Adithia

Anozi Mada

unread,
Nov 13, 2017, 4:55:25 AM11/13/17
to iDempiere
Try look at OrderPOCreate.java method createPOForVendor for example. It create a new order record (specified by using 0 as ID in constructor, if you fill it with valid ID it will read from the database), populate the fields using the setter then finally calling method saveEx to insert/update the database. That's just the basic concept, you can further learn by reading the other classes, process classes in package org.compiere.process maybe a good starting point.

Rheine Adithia

unread,
Nov 13, 2017, 5:25:46 AM11/13/17
to iDempiere
ok i'll try to learn that from the reference you gave me,
thank you so much

Best Regard, 
Rheine Adithia

Rheine Adithia

unread,
Nov 14, 2017, 3:39:08 AM11/14/17
to iDempiere
Hello Anozi,
i've tried to use MOrder class to create a new order line, but i haven't succeeded in using it..
this is the block of code that declare the MOrder class 
MOrder po = new MOrder(Env.getCtx(), 0, trx.getTrxName());
 po
.setClientOrg(m_AD_Client_ID, 1000001);
 po
.setIsSOTrx(false);
 po
.setC_DocTypeTarget_ID();
 po
.setPriorityRule("5");
 po
.setM_Warehouse_ID(Integer.valueOf(warehouseID));
 po
.setC_Project_ID((Integer) m_Project_ID);
 po
.setDateOrdered(Timestamp.valueOf(m_DateReq.toString()));
 po
.setDateAcct(Timestamp.valueOf(m_DateReq.toString()));
 po
.setC_DocType_ID(Integer.valueOf(m_TDocType.getID()));
 
 
MBPartner vendor = new MBPartner(getCtx(), (Integer) m_C_BPartner_ID, get_TrxName());
 po
.setBPartner(vendor);
 po
.saveEx();



but it gave me : 
Nov 14, 2017 3:38:31 PM org.compiere.model.MPaymentTerm applyOrder
SEVERE: No valid order - MOrder[0-null,IsSOTrx=false,C_DocType_ID=1000063, GrandTotal=0.0]

where is the fault on my code??

Best Regard,
Rheine Adithia

Anozi Mada

unread,
Nov 14, 2017, 3:52:02 AM11/14/17
to iDempiere
Please attach the whole java code and the error log here.

Rheine Adithia

unread,
Nov 14, 2017, 4:14:02 AM11/14/17
to iDempiere
this is the 3 main class for the whole Process.
POfromReq is the UI 
POfromReqGen is the GenForm
OrderPOGenerate is the form that im trying MOrder class on.

the error regarding to the insertion of the MOrder class is only this log :
Nov 14, 2017 3:38:31 PM org.compiere.model.MPaymentTerm applyOrder
SEVERE
: No valid order - MOrder[0-null,IsSOTrx=false,C_DocType_ID=1000063, GrandTotal=0.0]

the rest is only the usual system log.
thanks for the help

Best Regard, 
Rheine Adithia
POfromReq.java
POfromReqGen.java
OrderPOGenerate.java

Anozi Mada

unread,
Nov 14, 2017, 4:36:45 AM11/14/17
to iDempiere
Please just attach the whole log. It contains the information in what class and what line your code fail, especially couple lines after your posted error log.

Dirk Niemeyer

unread,
Nov 14, 2017, 4:42:11 AM11/14/17
to idem...@googlegroups.com
Hello Rheine,

did you have a look at newOrder in RequisitionPOCreate.java from
org.adempiere.base.process?

Regards,
Dirk Niemeyer

Rheine Adithia

unread,
Nov 14, 2017, 9:21:08 PM11/14/17
to iDempiere
is this the log that you mention?? There is no info on the location of the error in the class, it just gave me a sentences that telling me there are no order applied.. 

SLF4J: Class path contains multiple SLF4J bindings.
SLF4J
: Found binding in [bundleresource://182.fwk559670971:1/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J
: Found binding in [bundleresource://182.fwk559670971:2/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J
: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J
: Actual binding is of type [org.slf4j.impl.JDK14LoggerFactory]
Nov 15, 2017 9:02:47 AM org.eclipse.jetty.util.log.Log initialized
INFO
: Logging initialized @3368ms
Nov 15, 2017 9:02:47 AM org.eclipse.jetty.osgi.boot.internal.serverfactory.DefaultJettyAtJettyHomeHelper startJettyAtJettyHome
INFO
: Configuring the default jetty server with [file:/C:/idempiere/myexperiment/jettyhome/etc/jetty.xml, file:/C:/idempiere/myexperiment/jettyhome/etc/jetty-deployer.xml, file:/C:/idempiere/myexperiment/jettyhome/etc/jetty-ssl.xml, file:/C:/idempiere/myexperiment/jettyhome/etc/jetty-ssl-context.xml, file:/C:/idempiere/myexperiment/jettyhome/etc/jetty-http.xml, file:/C:/idempiere/myexperiment/jettyhome/etc/jetty-alpn.xml, file:/C:/idempiere/myexperiment/jettyhome/etc/jetty-http2.xml, file:/C:/idempiere/myexperiment/jettyhome/etc/jetty-https.xml]
Nov 15, 2017 9:02:47 AM org.eclipse.jetty.osgi.boot.internal.serverfactory.DefaultJettyAtJettyHomeHelper startJettyAtJettyHome
INFO
: JETTY.HOME=C:\idempiere\myexperiment\jettyhome
Nov 15, 2017 9:02:47 AM org.eclipse.jetty.osgi.boot.internal.serverfactory.DefaultJettyAtJettyHomeHelper startJettyAtJettyHome
INFO
: JETTY.BASE=C:\idempiere\myexperiment\jettyhome
Nov 15, 2017 9:02:47 AM org.eclipse.jetty.server.Server doStart
INFO
: jetty-9.3.10.v20160621
Nov 15, 2017 9:02:47 AM org.eclipse.jetty.util.ssl.SslContextFactory doStart
INFO
: x509=X509@41b5da5d(idempiere,h=[],w=[]) for SslContextFactory@6a27820f(file:///C:/idempiere/myexperiment/jettyhome/etc/keystore,file:///C:/idempiere/myexperiment/jettyhome/etc/keystore)
Nov 15, 2017 9:02:48 AM org.eclipse.jetty.server.AbstractConnector doStart
INFO
: Started ServerConnector@71e5f853{SSL,[ssl, alpn, h2, h2-17, h2-16, h2-15, h2-14, http/1.1]}{localhost:8444}
Nov 15, 2017 9:02:48 AM org.eclipse.jetty.server.AbstractConnector doStart
INFO
: Started ServerConnector@1886f737{HTTP/1.1,[http/1.1, h2c, h2c-17, h2c-16, h2c-15, h2c-14]}{localhost:8080}
Nov 15, 2017 9:02:48 AM org.eclipse.jetty.server.Server doStart
INFO
: Started @4349ms
Nov 15, 2017 9:02:48 AM org.eclipse.jetty.osgi.boot.internal.serverfactory.DefaultJettyAtJettyHomeHelper startJettyAtJettyHome
INFO
: Default jetty server configured
Nov 15, 2017 9:02:59 AM org.eclipse.jetty.server.handler.ContextHandler doStart
INFO
: Started o.e.j.w.WebAppContext@7d5f9dd2{/JasperReportFiles,file:///C:/idempiere/myexperiment/org.adempiere.report.jasper.webapp/,AVAILABLE}{file:/C:/idempiere/myexperiment/org.adempiere.report.jasper.webapp/}
Nov 15, 2017 9:03:08 AM org.compiere.web.AdempiereMonitorFilter init
INFO
:
09:03:08.655 Adempiere.startup: iDempiere(r) Release 4.1_2016-10-31 -Smart Suite ERP, CRM and SCM- (c) 1999-2016 iDempiere(r); Implementation: iDempiere - Supported by iDempiere community [15]
09:03:08.659 Ini.loadProperties: C:\idempiere\myexperiment\idempiere.properties #28 [15]
09:03:09.270 DB.isBuildOK: Build DB=${env.ADEMPIERE_VERSION} 20080428-1232 [15]
09:03:09.270 DB.isBuildOK: Build Cl=4.1.0.qualifier [15]
09:03:09.288-----------> DB.isBuildOK: Build Version Error


The program assumes build version 4.1.0.qualifier, but database has build version ${env.ADEMPIERE_VERSION} 20080428-1232.
This is likely to cause hard to fix errors.
Please contact administrator. [15]
09:03:09.400 Language.getLanguage: Adding Language=en, Country=US, Locale=en_US [15]
09:03:09.402 Language.getLanguage: Adding Language=en, Country=US, Locale=en_US [15]
09:03:09.462 WebEnv.initWeb: Servlet Context Init Parameters: iDempiere Root
org
.eclipse.jetty.servlet.SessionCookie=ROOT_SESSIONID
ServerRoot=1 [15]
09:03:09.472-----------> EMail.setFrom: you @ company.org: javax.mail.internet.AddressException: Local address contains control or whitespace in string ``you @ company.org'' [15]
09:03:09.475-----------> EMail.addTo: you @ company.org: javax.mail.internet.AddressException: Local address contains control or whitespace in string ``you @ company.org'' [15]
09:03:09.475-----------> EMail.isValid: From is invalid=null [15]
09:03:09.476-----------> EMail.isValid: From is invalid=null [15]
09:03:09.476-----------> MClient.sendEMail: Could NOT Send Email: Server started: iDempiere (User-PC:192.168.1.49) to you @ company.org: Invalid Data (System) [15]
09:03:09.476 WebEnv.initWeb: Servlet Init Parameter: idempiereMonitor [15]
09:03:09.476 AdempiereMonitor.init:  [15]
09:03:20.712           LoggedSessionListener.contextInitialized: context initialized [15]
09:03:20.777-----------> ClassLocator.getDependentXMLResources: Replicate resource: ckez
Overwrite bundleresource://169.fwk559670971:1/metainfo/zk/config.xml
with bundleresource://169.fwk559670971:7/metainfo/zk/config.xml [15]
09:03:21.170-----------> ClassLocator.getDependentXMLResources: Replicate resource: calendar
Overwrite bundleresource://169.fwk559670971/metainfo/zk/lang-addon.xml
with bundleresource://169.fwk559670971:6/metainfo/zk/lang-addon.xml [15]
09:03:21.173-----------> ClassLocator.getDependentXMLResources: Replicate resource: ckez
Overwrite bundleresource://169.fwk559670971:1/metainfo/zk/lang-addon.xml
with bundleresource://169.fwk559670971:7/metainfo/zk/lang-addon.xml [15]
09:03:21.177-----------> ClassLocator.getDependentXMLResources: Replicate resource: gmapsz
Overwrite bundleresource://169.fwk559670971:2/metainfo/zk/lang-addon.xml
with bundleresource://169.fwk559670971:8/metainfo/zk/lang-addon.xml [15]
09:03:21.180-----------> ClassLocator.getDependentXMLResources: Replicate resource: timeline
Overwrite bundleresource://169.fwk559670971:3/metainfo/zk/lang-addon.xml
with bundleresource://169.fwk559670971:9/metainfo/zk/lang-addon.xml [15]
09:03:21.183-----------> ClassLocator.getDependentXMLResources: Replicate resource: timeplot
Overwrite bundleresource://169.fwk559670971:4/metainfo/zk/lang-addon.xml
with bundleresource://169.fwk559670971:10/metainfo/zk/lang-addon.xml [15]
09:03:21.288-----------> DefaultAnnotationProcessor.fallbackToManualAnnotatedClasses: Unable to detect annotations. Application may fail to deploy. [15]
Nov 15, 2017 9:03:32 AM com.hazelcast.util.ServiceLoader
WARNING
: Service loader could not load 'META-INF/services/com.hazelcast.instance.NodeExtension' It may be empty or does not exist.
Nov 15, 2017 9:03:32 AM com.hazelcast.util.ServiceLoader
WARNING
: Service loader could not load 'META-INF/services/com.hazelcast.PortableHook' It may be empty or does not exist.
Nov 15, 2017 9:03:32 AM com.hazelcast.util.ServiceLoader
WARNING
: Service loader could not load 'META-INF/services/com.hazelcast.DataSerializerHook' It may be empty or does not exist.
Nov 15, 2017 9:03:32 AM com.hazelcast.util.ServiceLoader
WARNING
: Service loader could not load 'META-INF/services/com.hazelcast.SerializerHook' It may be empty or does not exist.
Nov 15, 2017 9:03:32 AM com.hazelcast.instance.Node
WARNING
: [192.168.1.49]:5701 [adempiere.csm-local-dump/localhost] [3.5.3] No join method is enabled! Starting standalone.
osgi
>
POG_89950855
-dcc6-4482-9e71-24eeaa38c561
warehouseID
= 1000002
dateReq
= 2017-11-13 00:00:00.0
priceID
= 1000001
orgID
= 1000001
m_Req_ID
= 1000001
m_AD_Org_ID
= 0
m_C_BPartner_ID
= 1000022
m_DateReq
= 2017-11-04 00:00:00.0
m_Project_ID
= 1000004
Nov 15, 2017 9:06:02 AM org.compiere.model.MPaymentTerm applyOrder
SEVERE
: No valid order - MOrder[0-null,IsSOTrx=false,C_DocType_ID=1000063, GrandTotal=0.0]
Nov 15, 2017 9:06:02 AM org.adempiere.base.DefaultProcessFactory newProcessInstance
WARNING
: org.ultimo.process.POfromReq
java
.lang.ClassNotFoundException: org.ultimo.process.POfromReq cannot be found by org.adempiere.base_4.1.0.qualifier
 at org
.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:432)
 at org
.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:345)
 at org
.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:337)
 at org
.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:160)
 at java
.lang.ClassLoader.loadClass(Unknown Source)
 at org
.adempiere.base.DefaultProcessFactory.newProcessInstance(DefaultProcessFactory.java:64)
 at org
.adempiere.base.Core.getProcess(Core.java:133)
 at org
.adempiere.util.ProcessUtil.startJavaProcess(ProcessUtil.java:159)
 at org
.compiere.apps.AbstractProcessCtl.startProcess(AbstractProcessCtl.java:466)
 at org
.compiere.apps.AbstractProcessCtl.run(AbstractProcessCtl.java:234)
 at org
.adempiere.webui.apps.form.WGenForm.runProcess(WGenForm.java:347)
 at sun
.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun
.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
 at sun
.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
 at java
.lang.reflect.Method.invoke(Unknown Source)
 at org
.zkoss.zk.ui.AbstractComponent.service(AbstractComponent.java:3012)
 at org
.zkoss.zk.ui.AbstractComponent.service(AbstractComponent.java:2942)
 at org
.zkoss.zk.ui.impl.EventProcessor.process(EventProcessor.java:136)
 at org
.zkoss.zk.ui.impl.UiEngineImpl.processEvent(UiEngineImpl.java:1826)
 at org
.zkoss.zk.ui.impl.UiEngineImpl.process(UiEngineImpl.java:1611)
 at org
.zkoss.zk.ui.impl.UiEngineImpl.execUpdate(UiEngineImpl.java:1321)
 at org
.zkoss.zk.au.http.DHtmlUpdateServlet.process(DHtmlUpdateServlet.java:611)
 at org
.zkoss.zk.au.http.DHtmlUpdateServlet.doGet(DHtmlUpdateServlet.java:485)
 at org
.zkoss.zk.au.http.DHtmlUpdateServlet.doPost(DHtmlUpdateServlet.java:494)
 at javax
.servlet.http.HttpServlet.service(HttpServlet.java:707)
 at javax
.servlet.http.HttpServlet.service(HttpServlet.java:790)
 at org
.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:837)
 at org
.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:583)
 at org
.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
 at org
.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548)
 at org
.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:226)
 at org
.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1180)
 at org
.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:511)
 at org
.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)
 at org
.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1112)
 at org
.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
 at org
.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:213)
 at org
.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:119)
 at org
.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:134)
 at org
.eclipse.jetty.server.Server.handle(Server.java:524)
 at org
.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:319)
 at org
.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:253)
 at org
.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:273)
 at org
.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:95)
 at org
.eclipse.jetty.io.SelectChannelEndPoint$2.run(SelectChannelEndPoint.java:93)
 at org
.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.executeProduceConsume(ExecuteProduceConsume.java:303)
 at org
.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceConsume(ExecuteProduceConsume.java:148)
 at org
.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:136)
 at org
.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:671)
 at org
.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:589)
 at java
.lang.Thread.run(Unknown Source)


that's the whole log, the WARNING log is caused by the Process is not recognized by the idempiere, but i don't think it effect the insertion (?)

Rheine Adithia

unread,
Nov 14, 2017, 10:07:42 PM11/14/17
to iDempiere
hello mr.Dirk Niemeyer

after seeing your post i go straight on learning the RequisitionPOCreate,
but after seeing the newOrder class, it has the same function as the class that mr.Anozi Mada mentioned.

the whole concept is just to create an MOrder class and then set the field to the parameter that was already been preset by the method in the RequisitionPOCreate.
after doing that, use the method MOrder.saveEx() to save the MOrder that was made.

But it still gave me the same error as i attached in the post above. 
it gave me a log that there is no valid Order :

Nov 15, 2017 10:06:47 AM org.compiere.model.MPaymentTerm applyOrder
SEVERE: No valid order - MOrder[0-null,IsSOTrx=false,C_DocType_ID=1000063, GrandTotal=0.0]

Can you help me where my mistake in the whole process is??

Best Regard, 
Rheine Adithia

Orlando Curieles

unread,
Nov 14, 2017, 10:11:00 PM11/14/17
to iDempiere
Hi, You need set the po.setC_DocTypeTarget_ID(1000063);

Try and tellme.
 
 Regards. 
Message has been deleted

Orlando Curieles

unread,
Nov 14, 2017, 10:21:56 PM11/14/17
to iDempiere
 Set the po.setM_PriceList_ID(pM_Price_List_ID); # The Price List is mandatory on Purchase Order
 
 You need fill all the mandatory fields

 

El martes, 14 de noviembre de 2017, 22:07:42 (UTC-5), Rheine Adithia escribió:

Rheine Adithia

unread,
Nov 14, 2017, 10:38:47 PM11/14/17
to iDempiere
Hello Mr.Orlando

and thanks for the reply!
it works! i successfully inserted an order into the database.
but, the log from eclipse still gave this severe warning :

Nov 15, 2017 10:34:22 AM org.compiere.model.MPaymentTerm applyOrder
SEVERE: No valid order - MOrder[0-null,IsSOTrx=false,C_DocType_ID=1000063, GrandTotal=0.0]

do you have any idea on what might raise this severe warning?
so i think the general idea for inserting the line is the same with inserting MOrder right..

Thanks for the help!
Best Regards,
Rheine Adithia

Orlando Curieles

unread,
Nov 14, 2017, 10:45:41 PM11/14/17
to iDempiere
 Ok so good, please check this code ( The hard code is only for test purposes)  but you can check the mandatory logic.
 
 MBPartner partner = new MBPartner(getCtx(), 1001119, get_TrxName());
 MOrder porder = new MOrder(getCtx(), 0, get_TrxName());
 porder.setAD_Org_ID(1000001);
 porder.setBPartner(partner);
 porder.setIsSOTrx(false);
 porder.setM_PriceList_ID(1000000);
 porder.setC_DocType_ID(1000016);
 porder.setC_DocTypeTarget_ID(1000016);
 porder.setM_Warehouse_ID(1000001);
 porder.setSalesRep_ID(1000019);
 porder.setC_BPartner_Location_ID(partner.getPrimaryC_BPartner_Location_ID());
 porder.saveEx();

Rheine Adithia

unread,
Nov 14, 2017, 11:07:35 PM11/14/17
to iDempiere
i tested the script that you give me with the hardcoded parameter. And still it gave me this error:

Nov 15, 2017 11:04:53 AM org.compiere.model.MPaymentTerm applyOrder
SEVERE: No valid order - MOrder[0-null,IsSOTrx=false,C_DocType_ID=1000063, GrandTotal=0.0]

Rheine Adithia

unread,
Nov 14, 2017, 11:08:26 PM11/14/17
to iDempiere
but the data get inserted like the ones that is given the parameter from the special form

Orlando Curieles

unread,
Nov 14, 2017, 11:11:10 PM11/14/17
to idem...@googlegroups.com
What is your C_DocType_ID=1000063 ??

 Is a purchase order doctype ?

This hardcoded parameters are for my test database, you need set your own parameters to test but all the fields on my script is mandatory :-)

Regards 

--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/idempiere/fc5a864d-bbfa-4ad5-9fc9-00f3e1addcf8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Rheine Adithia

unread,
Nov 14, 2017, 11:14:50 PM11/14/17
to iDempiere
yes i already tested with my own database parameter, and it still shows the same error log
this is the block code that i use to test
MBPartner partner = new MBPartner(getCtx(), 1000022, get_TrxName());

 
 
MOrder porder = new MOrder(getCtx(), 0, get_TrxName());
 porder
.setAD_Org_ID(1000001);
 porder
.setBPartner(partner);
 porder
.setIsSOTrx(false);

 porder
.setM_PriceList_ID(1000001);
 porder
.setC_DocType_ID(1000063);
 porder
.setC_DocTypeTarget_ID(1000063);
 porder
.setM_Warehouse_ID(1000002);
 porder
.setSalesRep_ID(100);
 porder
.setC_BPartner_Location_ID(partner.getPrimaryC_BPartner_Location_ID());
 porder
.saveEx();

and DocType_ID = 1000063 is the default Purchase Order document type in iDempiere for my Client.

To unsubscribe from this group and stop receiving emails from it, send an email to idempiere+...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages