因為salesforce沒有outputcheck元件所以使用以下方式達到:
<apex:inputCheckbox value="{!@variable}" disabled="true"/>
2017年3月22日 星期三
2017年3月17日 星期五
How to create Date as input with Calendar in visualforce page
How to create Date as input with Calendar in visualforce page
-------- Vf page-------------
<apex:page controller="inputdate" >
<script>
function DynamicDatePicker(d_id)
{
DatePicker.pickDate(false,d_id.id,false);
}
</script>
<apex:form >
<apex:inputText id="time" value="{!inputdate}" onfocus="DynamicDatePicker(this);" onchange="checkDateFormatt(this.id);" size="20" disabled="false" style="width:150px;"/>
<apex:commandButton action="{!testdate}" value="Save" />
</apex:form>
</apex:page>
--------------------- Apex Controller --------------------
public class inputdate
{
public date inputdate{get;set;}
public void testdate()
{
system.debug('@@@@@@@@@@@@@@'+inputdate);
}
}
參考網址: https://developer.salesforce.com/forums/?id=906F0000000987yIAA
2017年3月14日 星期二
於Visualforce Page中轉換編碼(跳行)
於Visualforce Page中轉換編碼(跳行)
var des = "{!JSENCODE(account.Description)}";
if(des != "") alert(des);
var des = "{!JSENCODE(account.Description)}";
if(des != "") alert(des);
2017年2月24日 星期五
Get role hierarchy in SOQL query
Get role hierarchy in SOQL query
參考網址:https://developer.salesforce.com/forums/?id=906F0000000DCTFIA4
01 | private static Set<ID > getAllSubRoleIds(Set<ID > roleIds) { |
02 |
03 | Set<ID > currentRoleIds = new Set<ID > (); |
04 |
05 | // get all of the roles underneath the passed roles |
06 | for (UserRole userRole :[ select Id from UserRole where ParentRoleId |
07 | IN :roleIds AND ParentRoleID != null ]) { |
08 | currentRoleIds.add(userRole.Id); |
09 | } |
10 |
11 | // go fetch some more rolls! |
12 | if (currentRoleIds.size() > 0 ) { |
13 | currentRoleIds.addAll(getAllSubRoleIds(currentRoleIds)); |
14 | } |
15 |
16 | return currentRoleIds; |
17 | } |
參考網址:https://developer.salesforce.com/forums/?id=906F0000000DCTFIA4
訂閱:
文章 (Atom)