Id OrgId = UserInfo.getOrganizationId();
Loading...
Apex Controller:
public class TestApexDetail {
public Id AccountId {get;set;}
public TestApexDetail() {
Account objAC = [SELECT Id From Account LIMIT 1];
AccountId = objAC.Id;
}
}
Visualforce Page:
<apex:page controller="TestApexDetail">
<apex:form>
<apex:detail subject="{!AccountId}" relatedlist="false"></apex:detail>
</apex:form>
</apex:page>
Output:
Loading...
trigger RestrictAttachmentTrigger on Attachment (before insert, before update) {
for(Attachment attach : trigger.new) {
if(attach.Body.size() > 3145728) {
attach.addError('File size cannot be greater than 3 MB');
}
}
}
Loading...
String sessionId = UserInfo.getOrganizationId()+''+UserInfo.getSessionId().SubString(15);
Loading...
format()
will remove the time stamp from Date.
Here is an example:
Date dt = System.Today();
Date newdt = dt.format();
Loading...