Académique Documents
Professionnel Documents
Culture Documents
datetime dt = datetime.newinstance(synthese.mois__c,
time.newinstance(0,0,0,0));
string mois = dt.format('MMMM');
Integer year = dt.year();
HTML
<form>
Birthday (month and year):
<input type="month" name="bdaymonth">
</form>
Apex
<p>{! IF( CONTAINS('salesforce.com','force.com'),
'Yep', 'Nope') }</p>
</td>
<td class="pbButton" id="topButtonRow">
<apex:commandbutton action="{!save}" value="Save" />
</td>
</tr>
</tbody>
</table>
</div>
<div class="pbBody">
<div class="pbSubheader brandTertiaryBgr tertiaryPalette">
<span class="pbSubExtra">
<span class="requiredLegend brandTertiaryFgr">
<span class="requiredExampleOuter">
<span class="requiredExample"> </span>
</span>
<span class="requiredMark">*</span>
<span class="requiredText"> = Required Information</span>
</span>
</span><h3>Contact Information<span
class="titleSeparatingColon">:</span></h3>
</div>
<div class="pbSubsection">
<table class="detailList" border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td class="labelCol">
<apex:outputtext value="{!$ObjectType.Contact.fields.Firstname.Label}" /></td>
<td class="dataCol"><apex:inputfield value=" {!contact.firstname}"
/></td>
</tr>
<tr>
<td class="labelCol"><apex:outputtext value="{!
$ObjectType.Contact.fields.Lastname.Label}" /></td>
<td class="dataCol"><apex:inputfield value=" {!contact.Lastname}"
/></td>
</tr>
<tr>
<td class="labelCol"><apex:outputtext value="{!
$ObjectType.Contact.fields.Email.Label}" /></td>
<td class="dataCol"><apex:inputfield value=" {!contact.Email}"
/></td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="pbBottomButtons">
<table border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td class="pbTitle"><img src="/s.gif" alt="" width="1" height="1"
class="minWidth" title="" /> </td>
<td class="pbButtonb" id="bottomButtonRow"></td>
<td class="pbButton" id="topButtonRow">
<apex:commandbutton action="{!save}" value="Save" />
</td>
</tr>
</tbody>
</table>
</div>
<div class="pbFooter secondaryPalette"><div class="bg"></div></div>
</div>
</apex:form>
<apex:detail />
</apex:page>
HTML Links
<!-- <li> <a href="/{! a.id}">{! a.Name} </a> </li>-->
a288E00000002v1QAA
paragraph
<!DOCTYPE html>
<html>
<body>
</body>
</html>
HTML Styling
<body style="background-color:lightgrey">
<h1 style="font-size:300%;color:#ff0067">This is a heading</h1>
<h2>HTML <mark>Marked</mark> Formatting</h2>
Id and class
Use id to address single elements. Use class to address groups of
elements.
action_page.php?firstname=Mickey&lastname=Mouse
GET is best suited to short amounts of data. Size limitations are set in your
browser.
Apex variable
<apex:variable var="i" value="1" />
<table border="1" cellpadding="2" cellspacing="0">
<apex:repeat value="{! detailsynthese}" var="ds">
<td>
<script src="myscript.js">
<head>
<script src="jquery-1.11.3.min.js">
</script>
</head>
jQuery CDN
If you don't want to download and host jQuery yourself, you can include it
from a CDN (Content Delivery Network).
Both Google and Microsoft host jQuery.
To use jQuery from Google or Microsoft, use one of the following:
Google CDN:
<head>
<script
src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
</head>
jQuery Syntax
Basic syntax is: $(selector).action()
This is to prevent any jQuery code from running before the document is
finished loading (is ready).
focus()
The focus() method attaches an event handler function to an HTML form
field.
The function is executed when the form field gets focus:
Example
$("input").focus(function(){
$(this).css("background-color", "#cccccc");
});
000171199
Id batchjobid = Database.executeBatch(new
AP65_BatchGenerateSyntheseMensuelle( startDate, endDate, null), 200);
Header footer in vf
<apex:page renderAs="pdf" Controller="testpdf1">
<head>
<style type="text/css" media="print">
@page
{
size: 8.5in 11in;/* width height */
}
@page
{
@top-center
{
content: element(header);
}
@bottom-left
{
content: element(footer);
}
div.header
{
padding: 10px;
position: running(header);
}
div.footer
{
display: block;
padding: 5px;
position: running(footer);
}
.pagenumber:before
{
content: counter(page);
}
.pagecount:before
{
content: counter(pages);
}
</style>
</head>
<div class="header">
<div align="right">Header</div>
</div>
<div class="footer">
<div>Page <span class="pagenumber"/> of <span class="pagecount"/></div>
</div>
<div class="content">
<p>
<apex:repeat value="{!opp}" var="item">
<tr>
<td class="tableContent">{!item.Name}</td>
</tr>
</apex:repeat>
</p>
</div>
</apex:page>
My code
@page {
margin-top: 95px;
margin-bottom: 75px;
@top-left {
content: element(header);
}
@bottom-right {
content: element(footer);
}
}
.divStyleHeader{
padding: 5px;
position: running(header);
}
.footer {
display: block;
position: running(footer);
}
Sets
A set is an unordered collection of elements that do not contain any
duplicates. Set elements can be of any data typeprimitive types,
collections, sObjects, user-defined types, and built-in Apex types. For
example, the following table represents a set of strings, that uses city names:
'San Francisco'
'New York'
'Paris'
'To
Sets can contain collections that can be nested within one another. For
example, you can have a set of lists of sets of Integers. A set can contain up
to four levels of nested collections inside it, that is, up to five levels overall.
To declare a set, use the Set keyword followed by the primitive data type
name within <> characters. For example:
1
new Set<String>()
JavaScript
{!REQUIRESCRIPT("/soap/ajax/34.0/connection.js")}
var commande = "{!Suivi_de_Commande__c.Commande_OS__c}";
var chantierId= "{!Suivi_de_Commande__c.ChantierLookupId__c}";
{
console.log("yes");
window.open("/apex/VFPAP67_OrdreDeService?id={!
Suivi_de_Commande__c.Id}", '_blank');
}
else
{
alert("{$AP67ErrorMessagePT}");
}
}
}
}
else
alert("{!$label.AP67ErrorMessageOS}");
currency conversion
/*
rA = SumMontantBudgete1;
ras = String.valueOf(rA);
System.debug('# ras is: ' + ras);
List<String> args = new String[]{'0','number','### ###
### ###'};
s1 = String.format(rA.format(), args);
if (ras.endswith('0')){
if(ras.substringAfter('.') == '00'){
af = ras.substringAfter('.');
rsult = s1 + (af != '' ? ',' + af : '');
System.debug('# final result is 00: ' + rsult);
}
else
if (ras.substringAfter('.') == '0'){
System.debug('# string of the decimal is : '
+ String.valueOf(rA));
af = ras.substringAfter('.');
rsult = s1 + (af != '' ? ',' + af : '')+'0';
System.debug('# final result is 0: ' + rsult);
}
else {
rsult = s1 + '0';
System.debug('# final result is xo: ' + rsult);
}
}
else
if ( ((ras.substringAfter('.')).length() == 1) &&
(ras.substringAfter('.') != '0') ) {
rsult = s1 + '0';
System.debug('# final result is x: ' + rsult);
}
else
if (string.isBlank((ras.substringAfter('.')))){
rsult = s1 +',00';
System.debug('# final result is blank: ' +
rsult);
}
else
System.debug('## final result is 0x:'+ s1);
*/
public Chantier__c chantierDummy {get;set;}
chantierDummy = new
Chantier__c(CoutInitialHT__c=SumMontantBudgete);