You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# We need to find from the start of USER_DEBUG to the next non-debug line.
1254
-
# Notice "b" is put on a line by itself, making it tricky to include in output
1255
-
1256
-
sfdx force:apex:execute -u "${1}" -f /dev/stdin<<<"$apexCommand"|# Execute the expression inside a system.debug(). execute expects a file, so use <<< trick to make it seem like a file
1257
-
pcregrep -M 'USER_DEBUG(.|\n)+?([\d]{2}:[\d]{2}:[\d]{2})'|# find debug line, and try to search up to the next apex ouptut line, starting with dd:dd:dd
1258
-
sed '$d'|# remove the last line, which is the first non-debug line
1259
-
sed 's/.*\|//'# find everything after the last pipe, which will be the debugged output
1260
-
}
1261
-
1262
-
# Execute an apex expression against an environment
1263
-
stmt() {
1264
-
if [[ -z"$1" ]] || [[ -z"$2" ]];then
1265
-
echo"Execute a statement or list of statements"
1266
-
echo"Pass quiet or q as the last paremeter to supress notification messages"
# We need to find from the start of USER_DEBUG to the next non-debug line.
1288
-
# Notice "b" is put on a line by itself, making it tricky to include in output
1289
-
1290
-
sfdx force:apex:execute -u "${1}" -f /dev/stdin<<<"$apexCommand"# Execute the statement inside a system.debug(). execute expects a file, so use <<< trick to make it seem like a file
1291
-
}
1292
-
1293
-
alias lsorg='open https://grhc.lightning.force.com/lightning/setup/DataManagementCreateTestInstance/home'
# Execute an apex expression against an environment
34
+
exp() {
35
+
if [[ -z"$1" ]] || [[ -z"$2" ]];then
36
+
echo
37
+
echo"${BOLD}NAME:${COLOR_RESET} exp"
38
+
echo
39
+
echo"${BOLD}DESCRIPTION:${COLOR_RESET} Execute an expression, and print the output. Takes the apex expression you pass in and wraps it in a System.debug() call.${COLOR_RESET}"
# We need to find from the start of USER_DEBUG to the next non-debug line.
65
+
# Notice "b" is put on a line by itself, making it tricky to include in output
66
+
67
+
sfdx force:apex:execute -u "${1}" -f /dev/stdin<<<"$apexCommand"|# Execute the expression inside a system.debug(). execute expects a file, so use <<< trick to make it seem like a file
68
+
pcregrep -M 'USER_DEBUG(.|\n)+?([\d]{2}:[\d]{2}:[\d]{2})'|# find debug line, and try to search up to the next apex ouptut line, starting with dd:dd:dd
69
+
sed '$d'|# remove the last line, which is the first non-debug line
70
+
sed 's/.*\|//'# find everything after the last pipe, which will be the debugged output
71
+
}
72
+
73
+
# Execute an apex expression against an environment
74
+
stmt() {
75
+
if [[ -z"$1" ]] || [[ -z"$2" ]];then
76
+
echo
77
+
echo"${BOLD}NAME:${COLOR_RESET} stmt"
78
+
echo
79
+
echo"${BOLD}DESCRIPTION:${COLOR_RESET} Execute a statement or list of statements.${COLOR_RESET}"
# We need to find from the start of USER_DEBUG to the next non-debug line.
105
+
# Notice "b" is put on a line by itself, making it tricky to include in output
106
+
107
+
sfdx force:apex:execute -u "${1}" -f /dev/stdin<<<"$apexCommand"# Execute the statement inside a system.debug(). execute expects a file, so use <<< trick to make it seem like a file
108
+
}
109
+
110
+
alias orgls='open https://grhc.lightning.force.com/lightning/setup/DataManagementCreateTestInstance/home'
111
+
112
+
functionorgid() {
113
+
exp "$1"'UserInfo.getOrganizationId()'
114
+
}
115
+
116
+
functioncustbyjarvisid() {
117
+
local comd
118
+
if [[ -n"$2" ]];then
119
+
comd="[SELECT Id, Name FROM Account WHERE Customer_Account_ID__c = $2]"
120
+
fi
121
+
exp "$1""$comd"
122
+
}
123
+
124
+
functionwhodat() {
125
+
exp "$1""[SELECT username FROM User WHERE Id = '$2']"
126
+
}
127
+
128
+
alias dstatus='open https://grhc--uat.lightning.force.com/lightning/setup/DeployStatus/home'
129
+
alias tflags='open https://grhc--andrewdev.lightning.force.com/lightning/setup/ApexDebugLogs/home'
0 commit comments