2015年12月24日 星期四

將Html Table匯出成Excel file


使用以下JavaScript

<script type="text/javascript">
function ExportToExcel(mytblId){
       var htmltable= document.getElementById('my-table-id');
       var html = htmltable.outerHTML;
       window.open('data:application/vnd.ms-excel,' + encodeURIComponent(html));
    }
</script>

參考網址:http://stackoverflow.com/questions/22317951/export-html-table-data-to-excel-using-javascript-jquery-is-not-working-properl

2015年12月15日 星期二

Date Functions in SOQL

This table lists all the date functions supported by SOQL.
Date FunctionDescriptionExamples
CALENDAR_MONTH()Returns a number representing the calendar month of a date field.
  • 1 for January
  • 12 for December
CALENDAR_QUARTER()Returns a number representing the calendar quarter of a date field.
  • 1 for January 1 through March 31
  • 2 for April 1 through June 30
  • 3 for July 1 through September 30
  • 4 for October 1 through December 31
CALENDAR_YEAR()Returns a number representing the calendar year of a date field.2009
DAY_IN_MONTH()Returns a number representing the day in the month of a date field.20 for February 20
DAY_IN_WEEK()Returns a number representing the day of the week for a date field.
  • 1 for Sunday
  • 7 for Saturday
DAY_IN_YEAR()Returns a number representing the day in the year for a date field.32 for February 1
DAY_ONLY()Returns a date representing the day portion of adateTime field.2009-09-22 for September 22, 2009
You can only useDAY_ONLY() with dateTime fields.
FISCAL_MONTH()Returns a number representing the fiscal month of a date field. This differs from CALENDAR_MONTH() if your organization uses a fiscal year that does not match the Gregorian calendar.
Note
This function is not supported if your organization has custom fiscal years enabled. See "About Fiscal Years" in the Salesforce Help.
If your fiscal year starts in March:
  • 1 for March
  • 12 for February
See “Set the Fiscal Year” in theSalesforce online help.
FISCAL_QUARTER()Returns a number representing the fiscal quarter of a date field. This differs from CALENDAR_QUARTER() if your organization uses a fiscal year that does not match the Gregorian calendar.
Note
This function is not supported if your organization has custom fiscal years enabled. See "About Fiscal Years" in the Salesforce Help.
If your fiscal year starts in July:
  • 1 for July 15
  • 4 for June 6
FISCAL_YEAR()Returns a number representing the fiscal year of a date field. This differs from CALENDAR_YEAR() if your organization uses a fiscal year that does not match the Gregorian calendar.
Note
This function is not supported if your organization has custom fiscal years enabled. See "About Fiscal Years" in the Salesforce Help.
2009
HOUR_IN_DAY()Returns a number representing the hour in the day for a dateTime field.18 for a time of 18:23:10
You can only useHOUR_IN_DAY() withdateTime fields.
WEEK_IN_MONTH()Returns a number representing the week in the month for a date field.2 for April 10
The first week is from the first through the seventh day of the month.
WEEK_IN_YEAR()Returns a number representing the week in the year for a date field.1 for January 3
The first week is from January 1 through January 7.


2015年12月11日 星期五

Formatting Time in APEX

Formatting Time in APEX

Here’s a table of format characters and what piece of the Date/Time object they display:
LetterDate or Time PieceExamples
GEraG = AD
yYearyy = 09, yyyy = 2009
MMonthMM = 08, MMM = Aug, MMMMM = August
wWeek in yearw = 35
WWeek in monthW = 3
DDay in yearD = 235
dDay in monthdd = 27
FDay of week in monthF = 2
EDay in weekE = Thu, EEEEE = Thursday
aAM/PMa = AM or PM
HHour in day (0-23)HH = 23
kHour in day (1-24)kk = 24
KHour in am/pm (0-11)KK=11
hHour in am/pm (1-12)hh = 12
mMinutes in hourmm = 30
sSecond in minutess = 55
SMillisecond in secondSSS = 888
zTime zonez = EDT, zzzzz = Eastern Daylight Time
ZTime zone offsetZ = -0400
So all that leaves to show is an example:
DateTime d = datetime.now();
timeStr = d.format(‘MMMMM dd, yyyy hh:mm:ss a’);

參考連結:https://paulforce.wordpress.com/2009/08/27/formatting-time-in-apex/

Formula 補充: https://help.salesforce.com/HTViewHelpDoc?id=formula_examples_dates.htm

2015年12月8日 星期二

Creating your very own Salesforce WAVE application

Creating your very own Salesforce WAVE application

在Apple Device上安裝Wave Analytics卻無法連線至develop org 可照以下作法開通
此網頁有基礎教學

參考網頁連結: Creating your very own Salesforce WAVE application