Skip to content

Instantly share code, notes, and snippets.

Avatar

Zack Walton waltonzt

View GitHub Profile
@waltonzt
waltonzt / delete not tied contact
Last active Feb 12, 2018
Delete all contacts that arent tied to PO, SO, RO, RFQ, CQ
View delete not tied contact
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 Feb 8, 2018
Sets the RO header status by looking at the Quanitites on the Lines.
View set-ro-status
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 Feb 8, 2018
Deletes all Accounts that are not tied to any SO, RO, PO, RFQ, CQ, and INV
View delete-acct
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);
View del-cont
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);
View lightning.md

Lightning Components

lightning:card

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

Close Quick Actions

$A.get("e.force:closeQuickAction").fire()
View Jenkins Start and Stop OS X
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 — forked from joelbyler/vim.md
Vim cheat sheet
View vim.md

#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)
You can’t perform that action at this time.