Wednesday, 28 February 2018

Error cannot change item number because location is inventory

This is a case where you were not able to change item number of this asset from change item number.

This error comes when we use select action "change Item Number" on asset application and assets location is inventory.

To resolve this error you need to transfer this item to non inventory location using inventory usage application only.

Also you need to select asset number or given full quantity if you want to move all asset attached with same item number and complete this record then asset location will be changed to your mentioned location inventory usage line.

Then you will be able to change item no. on asset application.

Sunday, 25 February 2018

How to check methods we can import in eclipse

Open class in which  you want  to import methods.

Rt. click select source option ---> Override / Implement Methods -->select method you want to override from parent or parent's parent class.

Saturday, 17 February 2018

Company is not valid when adjusting inventory balance

This error could come when user's site is not matching item's vendor site.

SQL developer error code vendor error 17002

Go to services and start  required oracle services

How to generate stup files from WSDL

TO generate wsdl files from stub use following procedure
Go to bin directory in cmd prompt
C:\Program Files\Java\jdk1.8.0_161\bin

Enter command

WSIMPORT <Your wsdl Path?WSDL>

If you recieve error for space in program space files

use this command

Go to D:

"C:\Program Files\Java\jdk1.8.0_161\bin" -Keep <Your wsdl Path?WSDL>

To define path where you want your files to be placed

use

wdimport "C:\Program Files\Java\jdk1.8.0_161\bin" -Keep -s D:\MyProject <Your wsdl Path?WSDL>

Thursday, 15 February 2018

Skip Copy Field Method

This method is used to skip certain attributes on duplication.

@Override
protected boolean skipCopyField(MboValueInfo arg0) throws RemoteException,
MXException {
// TODO Auto-generated method stub
boolean b=super.skipCopyField(arg0);
String attributeName=arg0.getAttributeName();
for (int i = 0; i < dup.length; i++) {
if(dup[i].equalsIgnoreCase(attributeName))
return true;
}

return b;


}

MboSet.SetValueNull(AttributeName,accessmodifiers) used to set current mbo's value to null

SetValueNull(Attributename) and setValueNull(Attributename,accessmodifiers) this is method is used to set current mbo's value to null it is a misconception that it will set all values of mboset to Null.

Sunday, 11 February 2018

Creating button to make workorder to WSCH status

You need to extend statefull bean class for this

Sample class would be

package custom.webclient.beans.workorder;

import java.rmi.RemoteException;

import psdi.mbo.MboSetRemote;
import psdi.mbo.StatefulMboRemote;
import psdi.util.MXApplicationException;
import psdi.util.MXException;
import psdi.webclient.system.beans.DataBean;

public class CustStatefulAppBean extends StatefulAppBean {

public int WSCH() throws RemoteException, MXException {

DataBean db = app.getAppBean();
StatefulMboRemote mbo = (StatefulMboRemote) db.getMbo();
targetStatusOption = "WPCOND";
statusChangeButtonSigoption = "WPCOND";
mbo.setTargetStatusOption("WPCOND");
mbo.setStatusChangeButtonSigoption("WPCOND");
STATUSSUB();
clientSession.loadDialog("status");

return 1;
}

          public int STATUSSUB() throws MXException, RemoteException {
     DataBean appBean = app.getAppBean();
   StatefulMboRemote statefullRemote = (StatefulMboRemote)appBean.getMbo();
   if (app.onListTab())
             {
      statefullRemote.setOnListTab(true);
             }
             else
             {
     statefullRemote.setOnListTab(false);
       MboSetRemote statuslist = statefullRemote.getValidStatusList();
 if (statuslist.getMbo(0) == null)
      {
          statefullRemote.setTargetStatusOption(null);
      targetStatusOption = null;
        throw new MXApplicationException("system", "StatusChangeNotAllowed");
               }
             }
     return 2;
           }



}

Rewritting in Customization


Quite often peple write redundant code

Example

MboSetRemote invoiceLineSet=invoice.getMboSet("invoiceline");
if(invoiceLine.isEmpty()){
MboRemote invoiceLineMbo=invoiceLineSet.moveFirst();
while (invoiceLineMbo!=null) {
Long constransId=invoiceLineMbo.getLong("CONSTRANSID");
if(constransId>0)
{
StringBuilder sb=new StringBuilder();
sb.append(String.ValueOf(constransId));

}

}



Here this line if(invoiceLine.isEmpty()){ is not nacessary because we are not taking string value of out of mboset or calling any moethod  from it

sb.append(String.ValueOf(constransId)); this is also not required because sb.append method can handle Long values.