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
| Date today = System.today(); | |
| Integer d = today.day(); | |
| Integer mo = today.month(); | |
| Integer yr = today.year(); | |
| DateTime dt = DateTime.newInstance(yr, mo, d); | |
| // returns 2022-11-22 08:00:00 | |
| Datetime todayWithTime = dt.addHours(12); | |
| system.debug(' todayWithTime: ' + todayWithTime); | |
| // returns 2022-11-22 20:00:00 |
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
| // change the campaign id and status to the correct values | |
| Campaign campaign = [SELECT Id FROM Campaign WHERE Id = 'ENTER THE CAMPAIGN ID' LIMIT 1]; | |
| List<CampaignMemberStatus> newStatusesToInsert = new List<CampaignMemberStatus>(); | |
| List<String> statuses = new List<String>{'Ideal User', 'MQL', 'Assigned', 'Touched', 'Disqualified', 'Clicked', 'Demoed', 'Opportunity', 'Won'}; | |
| for (String status: statuses) { | |
| system.debug(status); | |
| CampaignMemberStatus newStatus = new CampaignMemberStatus (); | |
| newStatus.Label = status; | |
| newStatus.CampaignId = campaign.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
| Sub SalesforceDate() | |
| Application.FindFormat.NumberFormat = "m/d/yyyy" | |
| Application.ReplaceFormat.NumberFormat = "yyyy-mm-dd" | |
| Cells.Replace What:="", Replacement:="", _ | |
| SearchFormat:=True, ReplaceFormat:=True | |
| End Sub |
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
| SELECT | |
| Id, | |
| Label, | |
| dlrs__ChildObject__c, | |
| dlrs__FieldToAggregate__c, | |
| dlrs__ParentObject__c, | |
| dlrs__AggregateResultField__c, | |
| dlrs__Description__c, | |
| dlrs__RelationshipCriteriaFields__c, | |
| dlrs__RelationshipCriteria__c, |
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
| { | |
| //For List | |
| "List_Apex": { | |
| "prefix": "listToUpdate", | |
| "body": [ | |
| "List<${1:object}> ${2:lstName} = new List<${1}>();" | |
| ], | |
| "description":"List of sObjects" | |
| }, | |
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
| #!/bin/bash | |
| # enter product username | |
| echo -e "enter production username: " | |
| read prod_user | |
| # enter product password with security token | |
| echo -e "enter production password followed by security token, no spaces: " | |
| read prod_pass_token |
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
| import pandas as pd | |
| data = pd.read_csv('desktop/data.csv') | |
| ind = pd.read_csv('desktop/index.csv') | |
| data = data.set_index('org') | |
| ind = ind.set_index('org') | |
| data.info() | |
| ind.info() | |
| join = ind.join(data) | |
| join.info() | |
| join.to_csv('desktop/join.csv') |
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
| #!/bin/bash | |
| # get users old user id | |
| echo -e "enter the user id for the old username: " | |
| read user_id | |
| # get users new user id | |
| echo -e "enter the user id for the new username: " | |
| read new_user_id |