This file contains hidden or 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no;" /> | |
<meta http-equiv="Content-type" content="text/html; charset=utf-8"> | |
<!-- include jquery mobile --> | |
<link rel="stylesheet" href="jquery/jquery.mobile-1.0b2.min.css" /> | |
<script src="jquery/jquery-1.6.2.min.js"></script> | |
<script src="jquery/jquery.mobile-1.0b2.min.js"></script> |
This file contains hidden or 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
Merchandise Name | Price | Quantity | |
---|---|---|---|
17 Inch Monitor | 99 | 200 | |
21 Inch Monitor | 129 | 200 | |
25 Inch Monitor | 179 | 200 |
This file contains hidden or 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 HandleOrderUpdate on Invoice__c (after update) { | |
// Create a map of IDs to all of the *old* versions of sObjects | |
// updated by the call that fires the trigger. | |
Map<ID, Invoice__c> oldMap = | |
new Map<ID, Invoice__c>(Trigger.old); | |
// Create an empty list of Ids | |
List<Id> invoiceIds = new List<Id>(); |
This file contains hidden or 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 Integration { | |
// The ExternalOrder class holds a string and integer | |
// received from the external fulfillment system. | |
public class ExternalOrder { | |
public String id {get; set;} | |
public Integer order_number {get; set;} | |
} | |
This file contains hidden or 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:page standardStylesheets="false" showHeader="false" sidebar="false" standardController="Merchandise__c" extensions="MobileInventoryExtension" recordSetVar="products"> | |
<!-- stylesheets and scripts, from CDN (use local files in production) --> | |
<apex:stylesheet value="https://ajax.aspnetcdn.com/ajax/jquery.mobile/1.1.0/jquery.mobile-1.1.0.min.css" /> | |
<apex:includeScript value="https://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.7.2.min.js"/> | |
<apex:includeScript value="https://ajax.aspnetcdn.com/ajax/jquery.mobile/1.1.0/jquery.mobile-1.1.0.min.js"/> | |
<head> | |
<title>Mobile Inventory</title> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" /> | |
<script> |
This file contains hidden or 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 MobileInventoryExtension { | |
// Constructors. Needed to use as an extension. | |
public MobileInventoryExtension(ApexPages.StandardController c) {} | |
public MobileInventoryExtension(ApexPages.StandardSetController c) {} | |
// Remote Action function lets JavaScript call Apex directly | |
// method to update a given Merchandise record passed in from a Visualforce page JavaScript function | |
@RemoteAction | |
public static String updateMerchandiseItem(String productId, Integer newInventory) { |
This file contains hidden or 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:page standardStylesheets="false" showHeader="false" sidebar="false" standardController="Merchandise__c" recordSetVar="products"> | |
<!-- stylesheets and scripts, from CDN (use local files in production) --> | |
<apex:stylesheet value="https://ajax.aspnetcdn.com/ajax/jquery.mobile/1.1.0/jquery.mobile-1.1.0.min.css" /> | |
<apex:includeScript value="https://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.7.2.min.js"/> | |
<apex:includeScript value="https://ajax.aspnetcdn.com/ajax/jquery.mobile/1.1.0/jquery.mobile-1.1.0.min.js"/> | |
<body> | |
<!-- Main page, to display list of Merchandise once app starts --> | |
<div data-role="page" data-theme="b" id="mainpage"> |
This file contains hidden or 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:page standardStylesheets="false" showHeader="false" sidebar="false" standardController="Merchandise__c" recordSetVar="products"> | |
<!-- stylesheets and scripts, from CDN (use local files in production) --> | |
<apex:stylesheet value="https://ajax.aspnetcdn.com/ajax/jquery.mobile/1.1.0/jquery.mobile-1.1.0.min.css" /> | |
<apex:includeScript value="https://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.7.2.min.js"/> | |
<apex:includeScript value="https://ajax.aspnetcdn.com/ajax/jquery.mobile/1.1.0/jquery.mobile-1.1.0.min.js"/> | |
<body> | |
<!-- Main page, to display list of Merchandise once app starts --> | |
<div data-role="page" data-theme="b" id="mainpage"> |
This file contains hidden or 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:page standardStylesheets="false" showHeader="false" sidebar="false"> | |
<!-- stylesheets and scripts, from CDN (use local files in production) --> | |
<apex:stylesheet value="https://ajax.aspnetcdn.com/ajax/jquery.mobile/1.1.0/jquery.mobile-1.1.0.min.css" /> | |
<apex:includeScript value="https://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.7.2.min.js"/> | |
<apex:includeScript value="https://ajax.aspnetcdn.com/ajax/jquery.mobile/1.1.0/jquery.mobile-1.1.0.min.js"/> | |
<h1>Mobile Inventory</h1> | |
</apex:page> |
This file contains hidden or 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
@isTest | |
private class TestDeleteRestrictInvoice { | |
// Invoice generator, with or without a Line Item | |
static Invoice__c createNewInvoice(Boolean withLineItem) { | |
// Create test Invoice and insert it into the database | |
Invoice__c invoice = new Invoice__c(); | |
insert invoice; | |
// Create test Line Item and insert it into the database, if withLineItem == true |