Skip to content

Instantly share code, notes, and snippets.

View waltonzt's full-sized avatar

Zack Walton waltonzt

View GitHub Profile
@waltonzt
waltonzt / delete not tied contact
Last active February 12, 2018 17:13
Delete all contacts that arent tied to PO, SO, RO, RFQ, CQ
List<Contact> cont = new List<Contact>();
Map<String, inscor__Customer_Quote__c> cqMap = new Map<String, inscor__Customer_Quote__c>();
Map<String, inscor__Sales_Order__c> soMap = new Map<String, inscor__Sales_Order__c>();
Map<String, inscor__RFQ__c> rfqMap = new Map<String, inscor__RFQ__c>();
Map<String, inscor__Purchase_Order__c> poMap = new Map<String, inscor__Purchase_Order__c>();
Map<String, inscor__Repair_Order__c> roMap = new Map<String, inscor__Repair_Order__c>();
for (inscor__Customer_Quote__c cq : [SELECT Id, inscor__Contact__c FROM inscor__Customer_Quote__c]) {
cqMap.put(cq.inscor__Contact__c, cq);
}
@waltonzt
waltonzt / set-ro-status
Created February 8, 2018 22:04
Sets the RO header status by looking at the Quanitites on the Lines.
List<inscor__Repair_Order__c> roToUpdate = new List<inscor__Repair_Order__c>();
for (inscor__Repair_Order__c ro : [SELECT Id, inscor__Status__c,
(SELECT Id, Name,inscor__Quantity_Received__c,inscor__Quantity_to_Repair__c,
inscor__Status__c
FROM inscor__Repair_Order_Lines__r)
FROM inscor__Repair_Order__c]) {
Boolean received = true;
Boolean inRepair = true;
Boolean sentTo = true;
for (inscor__Repair_Order_Line__c line : ro.inscor__Repair_Order_Lines__r) {
@waltonzt
waltonzt / delete-acct
Created February 8, 2018 15:38
Deletes all Accounts that are not tied to any SO, RO, PO, RFQ, CQ, and INV
List<Account> acct = new List<Account>();
Map<String, inscor__Customer_Quote__c> cqMap = new Map<String, inscor__Customer_Quote__c>();
Map<String, inscor__Sales_Order__c> soMap = new Map<String, inscor__Sales_Order__c>();
Map<String, inscor__RFQ__c> rfqMap = new Map<String, inscor__RFQ__c>();
Map<String, inscor__Purchase_Order__c> poMap = new Map<String, inscor__Purchase_Order__c>();
Map<String, inscor__Repair_Order__c> roMap = new Map<String, inscor__Repair_Order__c>();
Map<String, inscor__Inventory_Line__c> invMap = new Map<String, inscor__Inventory_Line__c>();
for (inscor__Customer_Quote__c cq : [SELECT Id, inscor__Customer__c FROM inscor__Customer_Quote__c]) {
cqMap.put(cq.inscor__Customer__c, cq);
List<Contact> cont = new List<Contact>();
Map<String, inscor__Customer_Quote__c> cqMap = new Map<String, inscor__Customer_Quote__c>();
for (inscor__Customer_Quote__c cq : [SELECT Id, inscor__Contact__c FROM inscor__Customer_Quote__c]) {
cqMap.put(cq.inscor__Contact__c, cq);
}
for (Contact c : [SELECT Id FROM Contact WHERE inscor__External_Reference_ID__c = null]) {
if (!cqMap.containsKey(c.Id)) {
cont.add(c);

Lightning Components

lightning:card

<div class="slds-card">
</div>

Close Quick Actions

$A.get("e.force:closeQuickAction").fire()
Start - sudo launchctl load /Library/LaunchDaemons/org.jenkins-ci.plist
Stop - sudo launchctl unload /Library/LaunchDaemons/org.jenkins-ci.plist
@waltonzt
waltonzt / vim.md
Created May 26, 2017 03:12 — forked from joelbyler/vim.md
Vim cheat sheet

#Cursor movement

h - move left
j - move down
k - move up
l - move right
ctrl-b - page up
ctrl-f - page down
% - jump to matching brace

w - jump by start of words (punctuation considered words)