วันศุกร์ที่ 3 สิงหาคม พ.ศ. 2561

วิธีการแก้ Unknown Validation Message ใน Eclipse

วันนี้ได้รับงานให้แก้ไขโปรเจคเก่า เลยนำ source code import เข้ามาให้ eclipse 

หลังจากนั้นลองสั่ง clean project พบว่าเจอ validation error

แต่พอลองเข้าไปอ่านว่า error นั้นเกิดจากส่วนไหน... ถึงขั้นงง เพราะ IDE บอกว่า
Unknown Validation Message 


วิธีแก้ไข
  1. เปิด Project properties

วันศุกร์ที่ 23 กุมภาพันธ์ พ.ศ. 2561

วิธีการหา Profile path ของ Google Chrome

Google Chrome มี feature ให้เราสามารถสร้าง Profile ในการใช้งานได้
ซึ่งก็หมายถึง เราสามารถใช้ Google Chrome ด้วยหลาย accounts ในเครื่องเดียวกันได้นั่นเอง

สำหรับการเพิ่ม Profile สามารถอ่านได้จาก https://support.google.com/chrome

หลังจากที่มีการใช้งานหลาย Profiles ในเครื่องเดียวกันแล้ว ก็ต้องมีที่เก็บข้อมูลของแต่ล่ะ Profile แต่ล่ะ Profile แยกกัน

ในบทความนี้จะแสดงวิธีการหา location path ของ Google Chrome profiles\

โดยค่าเริ่มต้นแล้วตำแหน่งที่เก็บ profile ของ Google Chrome จะขึ้นอยู่กับ Platform ที่ใช้ เช่น

วันจันทร์ที่ 12 กุมภาพันธ์ พ.ศ. 2561

How to disable kernel updates in Ubuntu via command line


This article gives the steps how to upgrade all the apt-get packages without updating the kernel on Ubuntu via command line.

Disable Kernel Update
sudo apt-mark hold linux-image-generic linux-headers-generic 

Updates Apt-Get Local DB
sudo apt-get update
Install Upgrades
sudo apt-get upgrade -y

How to re-enable Kernel Updates

วันอังคารที่ 14 มีนาคม พ.ศ. 2560

Salesforce วิธีเช็คว่า String เท่ากับ ช่องว่าง, null บน Apex Class

[Apex class]

การตรวจสอบค่าใน Apex class controller

กำหนดให้รับค่า id มาเก็บไว้ในตัวแปรประเภท String(id)
String id;
id = System.currentPageReference().getParameters().get('id');  
ถ้าต้องการตรวจสอบค่าของ id ว่ามีค่าหรือไม่ เพื่อจัดการตัวแปร ใน Controller
if(id==''){
System.debug('Mode: create');
}elsle{
System.debug('Mode: edit');
}
จาก code ด้านบน เมื่อ id มีค่าเป็น "null" 
โปรแกรมจะไม่เข้าการทำงานในส่วนของ if แต่จะทำงานในส่วนของ else แทน

ดังนั้น วิธีการเช็ค empty('') value == '' ไม่สามารถใช้กับค่า null ได้นั่นเอง

ถ้าต้องการตรวจสอบค่า ทั้ง ช่องว่าง empty('') และ ค่า null เราสามารถใช้ function มาตราฐานที่ให้มาได้เลยครับ

วันพุธที่ 2 พฤศจิกายน พ.ศ. 2559

[OA Framework] findIndexedChildRecursive, findChildRecursive ใช้ต่างกันอย่างไร

findIndexedChildRecursive หรือ
public OAWebBean findIndexedChildRecursive(String name)
ใช้สำหรับค้นหา component ด้วย index จาก child/grandchild ด้วยการระบุชื่อ
findChildRecursive หรือ
public OAWebBean findChildRecursive(String name)
ใช้สำหรับค้นหา component ทั้ง Index และ Name จาก child/grandchild ด้วยการระบุชื่อ
ทั้งสอง method จะคืนค่า null หากไม่พบ component ตรงกับชื่อที่ต้องการค้นหา
ปล. หากเราไม่แน่ใจว่าชื่อที่เราต้องการค้นหาเป็น Index หรือ Name ของ component ขอแนะนำให้ใช้ findChildRecursive ในการค้นหาครับ เพราะจะค้นหาทั้ง index และ name