Customization jar related issue

Help is preferred to those who publish their work as Open Source and not as private branches rejecting collaboration. Such projects are not maintainable and shall be deleted.
Forum rules
This forum is personally pruned to avoid redundant posts. Related topics are grouped together. IF YOU HAVE REGISTERED, you need to send email to red1(a)red1.org with your username in the subject title to get me to activate you.

Customization jar related issue

Postby vivekjustthink » Wed Oct 24, 2012 11:29 pm

Hi,

I have a simple issue, but unresolved. Please do take a look at below.

I have added this statement in MOrder.java

Code: Select all
FDialog.info(1, null, "GRN is already made for this Purchase order.")

and exported the MOrder.class file and added this to customization jar. But customization jar showed a dependency to this org.adempiere.webui.apps.AEnv class. so i exported the class file of AEnv and added to customization jar. Now it shows this error

Code: Select all
java.lang.NoClassDefFoundError: org/zkoss/zk/ui/Component

i.e it requires component class. this will be a big cycle and i think some library is missing. Everything is fine when running from code. Could you help me to resolve this please?

Thank You for your time and help..

regards
vivek
vivekjustthink
 
Posts: 21
Joined: Thu Oct 04, 2012 5:32 pm

Re: Customization jar related issue

Postby globalqss » Wed Oct 24, 2012 11:46 pm

FDialog is a view class - and MOrder is a model class - you must avoid using that.

Most of the times what you need is to return the string and the dialog will be shown, on the case of beforeSave you can use log.saveError (check other classes for examples).

Regards,

Carlos Ruiz
globalqss
Senior
 
Posts: 599
Joined: Thu Dec 29, 2005 4:15 am
Location: Bogotá, Colombia

Re: Customization jar related issue

Postby vivekjustthink » Thu Oct 25, 2012 12:35 pm

Hi carlos,

ya u are right. since that model validator didn't work for me i did the below in function reActivateIt() in class MOrder.java

Code: Select all
//Reactivate po only if grn not made
      String sql = "select m_inout_id from adempiere.m_inout where c_order_id in (select c_order_id from adempiere.c_order where c_order_id=?)";
      int grn = DB.getSQLValue(get_TrxName(), sql, get_ID());
      if(grn != -1){
         FDialog.info(1, null, "GRN is already made for this Purchase order.");
         out.append(Msg.getMsg(Env.getCtx(), "GRN is already made for this Purchase order."));
         m_processMsg=null;
         return false;
      }

if i use log.saveError it will print only in console. and in above case returning false become mandatory to prevent the class from re-activating PO. So in this case for message i can't use another return statement. And also it's mandatory to intimate the user about the error. Please suggest me a way-out to intimate the user in gui mode or any other way to do the above task. Thank You!!

regards
vivek
vivekjustthink
 
Posts: 21
Joined: Thu Oct 04, 2012 5:32 pm

Re: Customization jar related issue

Postby globalqss » Fri Oct 26, 2012 12:33 am

Hi Vivek - on MOrder try setting the value of variable m_processMsg.

Regards,

Carlos Ruiz
globalqss
Senior
 
Posts: 599
Joined: Thu Dec 29, 2005 4:15 am
Location: Bogotá, Colombia

Re: Customization jar related issue

Postby vivekjustthink » Fri Oct 26, 2012 12:49 pm

Hi carlos,

Thank you so much, the problem is resolved by setting the text to m_processMsg. But isn't there any way to pop up a warning window from that model class.

regards
vivek
vivekjustthink
 
Posts: 21
Joined: Thu Oct 04, 2012 5:32 pm

Re: Customization jar related issue

Postby globalqss » Sat Oct 27, 2012 12:17 am

Hi Vivek, popup warning windows is achieved using Callouts.
globalqss
Senior
 
Posts: 599
Joined: Thu Dec 29, 2005 4:15 am
Location: Bogotá, Colombia


Return to HELP ME!!!

Who is online

Users browsing this forum: No registered users and 2 guests

cron