groovy:get採購單拉採購人員帶出聯絡人
Callout
==============================
import java.sql.Timestamp
import java.math.BigDecimal
import java.sql.PreparedStatement
import java.sql.ResultSet
import org.compiere.util.DB
import org.compiere.model.MUser
//@script:groovy:getQuotationForOrder
if (A_Value != null )
{
int id = ((Integer) A_Value).intValue();
String sql ="SELECT \"員工姓名\" FROM \"採購人員\" WHERE \"採購人員_id\"=? ";
PreparedStatement pstmt = DB.prepareStatement(sql, null);
pstmt.setInt(1, id);
ResultSet rs = pstmt.executeQuery();
// 只作 1筆 while (rs.next()) {
if (rs.next()) {
if (rs.getString("員工姓名") != null) A_Tab.setValue("聯絡人",rs.getString("員工姓名"));
}
rs.close();
pstmt.close();
}
result=""
沒有留言:
張貼留言