This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
trigger InvoiceTrigger on Invoice__c (before insert) { | |
if (trigger.isBefore && trigger.isInsert) | |
{ | |
// ---- GENERATE INVOICE NUMBER, AUTO RUNNING NUMBER, RESET EVERY YEAR BASED ON CREATED DATE --- // | |
// ---- INVOICE NUMBER FORMAT : {0000} --// | |
Integer iCharLen = 4; // character length for number | |
Integer iLastNo = 0; // information last running number this year | |
Integer iThisYear = Date.Today().year(); | |
// search latest invoice number |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
trigger InvoiceTrigger2 on Invoice__c (before insert) { | |
if (trigger.isBefore && trigger.isInsert) | |
{ | |
// ---- GENERATE INVOICE NUMBER, AUTO RUNNING NUMBER, RESET EVERY MONTH BASED ON INVOICE DATE --- // | |
// ---- INVOICE NUMBER FORMAT : {YYYY}-{MM}-{000} --// | |
// ---- ASSUME THAT INVOICE DATE CAN BE BACKDATED -- // | |
Integer iCharLen = 3; // character length for number | |
Integer iLastNo = 0; // information last running number this year | |
String strZero = '0'; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
trigger InvoiceTrigger3 on Invoice__c (before insert) { | |
if (trigger.isBefore && trigger.isInsert) | |
{ | |
// ---- GENERATE INVOICE NUMBER, AUTO RUNNING NUMBER, EACH ACCOUNT HAS ITS OWN RUNNING NUMBER --- // | |
// ---- INVOICE NUMBER FORMAT : {ACCOUNTNUMBER}-{YYYY}-{MM}-{000} --// | |
// ---- ASSUME THAT ACCOUNT NUMBER IS MANDATORY -- // | |
// ---- BECAUSE WE HAVE YEAR AND MONTH INFORMATION IN THE NUMBER, EASIER IF WE CREATE A FIELD FOR THE NUMBER [ACC RUNNING NO] --// | |
Integer iCharLen = 3; // character length for number | |
Integer iLastNo = 0; // information last running number this year | |
String strZero = '0'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// transition page to create new page with default Name field | |
public class NewQuotation_Controller | |
{ | |
public NewQuotation_Controller(ApexPages.StandardController controller) | |
{ | |
//CreateNew(); | |
} // constructor | |
// function to process |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<apex:pageBlockTable var="items" value="{!listLead}" > | |
<apex:column headerValue="Lead"> | |
<apex:outputLink title="Lead" value="/{!items.Id}">{!items.name}</apex:outputLink> | |
</apex:column> | |
<apex:column title="Company" value="{!items.Company}" /> | |
<apex:column title="Phone" value="{!items.Phone}" /> | |
<apex:column title="Email" value="{!items.Email}" /> | |
</apex:pageblocktable> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head><title>Simple Google Search API Example</title></head> | |
<body> | |
<h1>Simple Google Search API Example</h1> | |
<?php | |
// asumsi file ini ada di folder example, folder dengan level yang sama dengan src | |
require_once realpath(dirname(__FILE__) . '/../src/Google/autoload.php'); | |
$client = new Google_Client(); | |
$client->setApplicationName("Nama Aplikasi"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace app\models; | |
class UserIdentity extends \yii\base\BaseObject implements \yii\web\IdentityInterface | |
{ | |
public $id; | |
public $username; | |
public $password; | |
public $authKey; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace app\models; | |
use Yii; | |
/** | |
* This is the custom model class for tables | |
* By Yudi K. | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Used to read a delimited file. | |
* https://gist.github.com/ngaller/858086 | |
*/ | |
public class SSSCsvReader { | |
private String delim = ','; | |
// the input data | |
private String[] buffer; | |
public SSSCsvReader(String data){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Utility { | |
// public get picklist options in map (string, string) | |
public static Map<String, String> getMapPicklist(String strObject, String strField) { | |
Map<String, String> options = new Map<String, String>(); | |
Map<String,Schema.SObjectType> gd = Schema.getGlobalDescribe(); | |
Map<String, Schema.SObjectField> field_map = gd.get(strObject).getDescribe().fields.getMap(); | |
List<Schema.PicklistEntry> picklistValues = field_map.get(strField).getDescribe().getPickListValues(); | |
for (Schema.PicklistEntry pv : picklistValues) { | |
// options.add(new SelectOption(pv.getValue(),pv.getLabel())); |
OlderNewer