ADempiere Callout Implemetation
I have implemented call-out successfully with the help of ADempierians.
I want to contribute and share code
import java.sql.*;
import java.txt.*;
import org.compiere.util.*;
import org.compiere.model.*;
import org.adempiere.model.*;
int m_leathername_ID=A_Tab.getValue("m_leathername_ID");
int M_Quality_ID=A_Tab.getValue("M_Quality_ID");
int M_Colour_ID =A_Tab.getValue("M_Colour_ID");
int M_Grade_ID=A_Tab.getValue("M_Grade_ID");
int C_BPartner_ID=A_Tab.getValue("C_BPartner_ID");
String leathername=DB.getSQLValueString(null, "select Name from m_leathername where m_leathername_ID=?",m_leathername_ID);
String m_leathercode=DB.getSQLValueString(null, "select m_leathercode from m_leathername where m_leathername_ID=?",m_leathername_ID);
String qualityname=DB.getSQLValueString(null, "select Name from M_Quality where M_Quality_ID=?",M_Quality_ID);
String m_qualitycode=DB.getSQLValueString(null, "select m_qualitycode from M_Quality where M_Quality_ID=?",M_Quality_ID);
String colourname=DB.getSQLValueString(null, "select Name from M_Colour where M_Colour_ID=?",M_Colour_ID);
String m_colourcode=DB.getSQLValueString(null, "select m_colourcode from M_Colour where M_Colour_ID=?",M_Colour_ID);
String gradename=DB.getSQLValueString(null, "select Name from M_Grade where M_Grade_ID=?",M_Grade_ID);
String m_gradecode=DB.getSQLValueString(null, "select m_gradecode from M_Grade where M_Grade_ID=?",M_Grade_ID);
String bpcode=DB.getSQLValueString(null, "select substr(Value,5,4) as value from C_BPartner where C_BPartner_ID=?",C_BPartner_ID);
//return leathername+""+m_leathercode+""+qualityname+""+m_qualitycode+""+colorname+""+m_colorcode+""+gradename+""+m_gradecode;
//return leathername+""+m_leathercode+""+qualityname+""+m_qualitycode+""+colorname+""+m_colorcode+""+gradename+""+m_gradecode+""+bpcode;
//if(m_leathername_ID!=null || M_Quality_ID!=null|| M_Colour_ID!=null || M_Grade_ID!=null || C_BPartner_ID!=null)
if(m_leathername_ID!=null || M_Quality_ID!=null|| M_Colour_ID!=null || M_Grade_ID!=null || C_BPartner_ID!=null)
{
A_Tab.setValue("Name",leathername+" "+qualityname+" "+ colourname+" "+gradename);
A_Tab.setValue("Value",bpcode+" "+m_leathercode+" "+m_qualitycode+" "+m_colourcode+" "+m_gradecode);
}
return "";
I want to contribute and share code
import java.sql.*;
import java.txt.*;
import org.compiere.util.*;
import org.compiere.model.*;
import org.adempiere.model.*;
int m_leathername_ID=A_Tab.getValue("m_leathername_ID");
int M_Quality_ID=A_Tab.getValue("M_Quality_ID");
int M_Colour_ID =A_Tab.getValue("M_Colour_ID");
int M_Grade_ID=A_Tab.getValue("M_Grade_ID");
int C_BPartner_ID=A_Tab.getValue("C_BPartner_ID");
String leathername=DB.getSQLValueString(null, "select Name from m_leathername where m_leathername_ID=?",m_leathername_ID);
String m_leathercode=DB.getSQLValueString(null, "select m_leathercode from m_leathername where m_leathername_ID=?",m_leathername_ID);
String qualityname=DB.getSQLValueString(null, "select Name from M_Quality where M_Quality_ID=?",M_Quality_ID);
String m_qualitycode=DB.getSQLValueString(null, "select m_qualitycode from M_Quality where M_Quality_ID=?",M_Quality_ID);
String colourname=DB.getSQLValueString(null, "select Name from M_Colour where M_Colour_ID=?",M_Colour_ID);
String m_colourcode=DB.getSQLValueString(null, "select m_colourcode from M_Colour where M_Colour_ID=?",M_Colour_ID);
String gradename=DB.getSQLValueString(null, "select Name from M_Grade where M_Grade_ID=?",M_Grade_ID);
String m_gradecode=DB.getSQLValueString(null, "select m_gradecode from M_Grade where M_Grade_ID=?",M_Grade_ID);
String bpcode=DB.getSQLValueString(null, "select substr(Value,5,4) as value from C_BPartner where C_BPartner_ID=?",C_BPartner_ID);
//return leathername+""+m_leathercode+""+qualityname+""+m_qualitycode+""+colorname+""+m_colorcode+""+gradename+""+m_gradecode;
//return leathername+""+m_leathercode+""+qualityname+""+m_qualitycode+""+colorname+""+m_colorcode+""+gradename+""+m_gradecode+""+bpcode;
//if(m_leathername_ID!=null || M_Quality_ID!=null|| M_Colour_ID!=null || M_Grade_ID!=null || C_BPartner_ID!=null)
if(m_leathername_ID!=null || M_Quality_ID!=null|| M_Colour_ID!=null || M_Grade_ID!=null || C_BPartner_ID!=null)
{
A_Tab.setValue("Name",leathername+" "+qualityname+" "+ colourname+" "+gradename);
A_Tab.setValue("Value",bpcode+" "+m_leathercode+" "+m_qualitycode+" "+m_colourcode+" "+m_gradecode);
}
return "";
thank you, this was really useful for me.
ReplyDeleteLaci