Giter VIP home page Giter VIP logo

trailheadapps / apex-recipes Goto Github PK

View Code? Open in Web Editor NEW
896.0 896.0 412.0 3.08 MB

A library of concise, meaningful examples of Apex code for common use cases following best practices.

Home Page: https://developer.salesforce.com

License: Creative Commons Zero v1.0 Universal

JavaScript 12.01% Shell 0.30% Apex 79.82% HTML 6.69% CSS 0.52% Batchfile 0.17% DataWeave 0.49%
apex async cache integration invocable salesforce trigger

apex-recipes's People

Contributors

albarivas avatar chouth avatar codefriar avatar dependabot[bot] avatar exiahuang avatar msrivastav13 avatar pchittum avatar pozil avatar svc-scm avatar trailheadapps-bot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

apex-recipes's Issues

Error retrieving data - (Regex too complicated)

Summary

Short summary of what is going on or to provide context.
image

Additional information

`50.0 APEX_CODE,FINEST;APEX_PROFILING,INFO;CALLOUT,INFO;DB,INFO;NBA,INFO;SYSTEM,DEBUG;VALIDATION,INFO;VISUALFORCE,INFO;WAVE,INFO;WORKFLOW,INFO
06:40:46.0 (191358)|USER_INFO|[EXTERNAL]|0052y000001TLcZ|[email protected]|(GMT-08:00) Pacific Standard Time (America/Los_Angeles)|GMT-08:00
06:40:46.0 (240841)|EXECUTION_STARTED
06:40:46.0 (246604)|CODE_UNIT_STARTED|[EXTERNAL]|apex://RecipeTreeViewController/ACTION$generateTreeData
06:40:46.0 (933339)|CODE_UNIT_STARTED|[EXTERNAL]|01p2y000001aEkr|RecipeTreeViewController.generateTreeData()
06:40:46.0 (1020339)|VARIABLE_SCOPE_BEGIN|[14]|RecipeTreeViewController.APEXRECIPESIDENTIFICATIONTAG|String|false|true
06:40:46.0 (1060067)|VARIABLE_SCOPE_BEGIN|[8]|RecipeTreeViewController.groupToListOfNames|Map<String,List>|true|true
06:40:46.0 (1213393)|HEAP_ALLOCATE|[79]|Bytes:3
06:40:46.0 (1268071)|HEAP_ALLOCATE|[84]|Bytes:152
06:40:46.0 (1286636)|HEAP_ALLOCATE|[399]|Bytes:408
06:40:46.0 (1304682)|HEAP_ALLOCATE|[412]|Bytes:408
06:40:46.0 (1320315)|HEAP_ALLOCATE|[520]|Bytes:48
06:40:46.0 (1348901)|HEAP_ALLOCATE|[139]|Bytes:6
06:40:46.0 (1373248)|HEAP_ALLOCATE|[EXTERNAL]|Bytes:14
06:40:46.0 (1381950)|HEAP_ALLOCATE|[EXTERNAL]|Bytes:6
06:40:46.0 (1387188)|HEAP_ALLOCATE|[EXTERNAL]|Bytes:8
06:40:46.0 (1444839)|VARIABLE_ASSIGNMENT|[EXTERNAL]|RecipeTreeViewController.APEXRECIPESIDENTIFICATIONTAG|"* @group"
06:40:46.0 (1464414)|METHOD_ENTRY|[7]|01p2y000001aEkr|RecipeTreeViewController.RecipeTreeViewController()
06:40:46.0 (1474224)|STATEMENT_EXECUTE|[7]
06:40:46.0 (1481525)|STATEMENT_EXECUTE|[7]
06:40:46.0 (1543331)|HEAP_ALLOCATE|[52]|Bytes:5
06:40:46.0 (1571462)|HEAP_ALLOCATE|[58]|Bytes:5
06:40:46.0 (1582924)|HEAP_ALLOCATE|[66]|Bytes:7
06:40:46.0 (1618331)|SYSTEM_MODE_ENTER|false
06:40:46.0 (1638107)|HEAP_ALLOCATE|[EXTERNAL]|Bytes:5
06:40:46.0 (1645811)|STATEMENT_EXECUTE|[20]
06:40:46.0 (1653064)|SYSTEM_MODE_EXIT|false
06:40:46.0 (1665054)|METHOD_EXIT|[7]|RecipeTreeViewController
06:40:46.0 (1674516)|SYSTEM_MODE_ENTER|false
06:40:46.0 (1690171)|HEAP_ALLOCATE|[59]|Bytes:5
06:40:46.0 (1697664)|STATEMENT_EXECUTE|[58]
06:40:46.0 (1700658)|STATEMENT_EXECUTE|[59]
06:40:46.0 (1717625)|HEAP_ALLOCATE|[59]|Bytes:4
06:40:46.0 (1816160)|VARIABLE_SCOPE_BEGIN|[59]|treeData|List<RecipeTreeViewController.RecipeTreeData>|true|false
06:40:46.0 (1851059)|HEAP_ALLOCATE|[EXTERNAL]|Bytes:4
06:40:46.0 (1872483)|VARIABLE_ASSIGNMENT|[59]|treeData|[]|0x44b4ea88
06:40:46.0 (1881670)|STATEMENT_EXECUTE|[60]
06:40:46.0 (1961135)|HEAP_ALLOCATE|[60]|Bytes:2
06:40:46.0 (1984511)|HEAP_ALLOCATE|[60]|Bytes:20
06:40:46.0 (1997077)|CONSTRUCTOR_ENTRY|[60]|01p2y000001aEkr|()|RecipeTreeViewController.RecipeTreeData
06:40:46.0 (2024882)|VARIABLE_SCOPE_BEGIN|[20]|this|RecipeTreeViewController.RecipeTreeData|true|false
06:40:46.0 (2074545)|VARIABLE_ASSIGNMENT|[20]|this|{}|0x24ad1939
06:40:46.0 (2089382)|HEAP_ALLOCATE|[26]|Bytes:6
06:40:46.0 (3970864)|STATEMENT_EXECUTE|[20]
06:40:46.0 (3979537)|STATEMENT_EXECUTE|[22]
06:40:46.0 (3984340)|STATEMENT_EXECUTE|[24]
06:40:46.0 (3988029)|STATEMENT_EXECUTE|[26]
06:40:46.0 (4004778)|HEAP_ALLOCATE|[26]|Bytes:5
06:40:46.0 (4032390)|VARIABLE_ASSIGNMENT|[26]|this.expanded|false|0x24ad1939
06:40:46.0 (4045077)|STATEMENT_EXECUTE|[28]
06:40:46.0 (4055683)|CONSTRUCTOR_EXIT|[60]|01p2y000001aEkr|()|RecipeTreeViewController.RecipeTreeData
06:40:46.0 (4070624)|VARIABLE_SCOPE_BEGIN|[60]|recipes|RecipeTreeViewController.RecipeTreeData|true|false
06:40:46.0 (4110438)|VARIABLE_ASSIGNMENT|[60]|recipes|{"expanded":false}|0x24ad1939
06:40:46.0 (4120087)|STATEMENT_EXECUTE|[61]
06:40:46.0 (4127285)|HEAP_ALLOCATE|[61]|Bytes:7
06:40:46.0 (4142786)|VARIABLE_ASSIGNMENT|[61]|this.label|"Recipes"|0x24ad1939
06:40:46.0 (4153704)|STATEMENT_EXECUTE|[62]
06:40:46.0 (4168617)|VARIABLE_ASSIGNMENT|[62]|this.name|"Recipes"|0x24ad1939
06:40:46.0 (4181100)|STATEMENT_EXECUTE|[63]
06:40:46.0 (4190077)|HEAP_ALLOCATE|[63]|Bytes:5
06:40:46.0 (4202203)|VARIABLE_ASSIGNMENT|[63]|this.expanded|true|0x24ad1939
06:40:46.0 (4216386)|STATEMENT_EXECUTE|[64]
06:40:46.0 (4237764)|HEAP_ALLOCATE|[64]|Bytes:4
06:40:46.0 (4304487)|HEAP_ALLOCATE|[EXTERNAL]|Bytes:4
06:40:46.0 (4321187)|VARIABLE_ASSIGNMENT|[64]|this.items|[]|0x24ad1939
06:40:46.0 (4332548)|STATEMENT_EXECUTE|[65]
06:40:46.0 (4338459)|HEAP_ALLOCATE|[65]|Bytes:20
06:40:46.0 (4350556)|CONSTRUCTOR_ENTRY|[65]|01p2y000001aEkr|()|RecipeTreeViewController.RecipeTreeData
06:40:46.0 (4372776)|VARIABLE_SCOPE_BEGIN|[20]|this|RecipeTreeViewController.RecipeTreeData|true|false
06:40:46.0 (4398880)|VARIABLE_ASSIGNMENT|[20]|this|{}|0x1f7e6d5e
06:40:46.0 (4424341)|STATEMENT_EXECUTE|[20]
06:40:46.0 (4427277)|STATEMENT_EXECUTE|[22]
06:40:46.0 (4429944)|STATEMENT_EXECUTE|[24]
06:40:46.0 (4432559)|STATEMENT_EXECUTE|[26]
06:40:46.0 (4440378)|HEAP_ALLOCATE|[26]|Bytes:5
06:40:46.0 (4449841)|VARIABLE_ASSIGNMENT|[26]|this.expanded|false|0x1f7e6d5e
06:40:46.0 (4460383)|STATEMENT_EXECUTE|[28]
06:40:46.0 (4465611)|CONSTRUCTOR_EXIT|[65]|01p2y000001aEkr|()|RecipeTreeViewController.RecipeTreeData
06:40:46.0 (4477419)|VARIABLE_SCOPE_BEGIN|[65]|sharedCode|RecipeTreeViewController.RecipeTreeData|true|false
06:40:46.0 (4501149)|VARIABLE_ASSIGNMENT|[65]|sharedCode|{"expanded":false}|0x1f7e6d5e
06:40:46.0 (4511658)|STATEMENT_EXECUTE|[66]
06:40:46.0 (4528628)|METHOD_ENTRY|[66]|01p2y000001aEkr|RecipeTreeViewController.generateMapOfGroupToListOfNames()
06:40:46.0 (4563611)|HEAP_ALLOCATE|[111]|Bytes:5
06:40:46.0 (4571937)|STATEMENT_EXECUTE|[110]
06:40:46.0 (4574900)|STATEMENT_EXECUTE|[111]
06:40:46.0 (4594799)|HEAP_ALLOCATE|[111]|Bytes:4
06:40:46.0 (4616720)|VARIABLE_SCOPE_BEGIN|[111]|returnMap|Map<String,List>|true|false
06:40:46.0 (4642109)|VARIABLE_ASSIGNMENT|[111]|returnMap|{}|0x7a0cdd4
06:40:46.0 (4653199)|STATEMENT_EXECUTE|[112]
06:40:46.0 (4657487)|HEAP_ALLOCATE|[112]|Bytes:59
06:40:46.0 (4673863)|HEAP_ALLOCATE|[112]|Bytes:4
06:40:46.0 (4684231)|HEAP_ALLOCATE|[112]|Bytes:7
06:40:46.0 (5134744)|SOSL_EXECUTE_BEGIN|[112]|FIND :tmpVar1 IN ALL FIELDS RETURNING apexclass(Name, Body)
06:40:46.0 (135769179)|HEAP_ALLOCATE|[112]|Bytes:4
06:40:46.0 (135786098)|HEAP_ALLOCATE|[112]|Bytes:4
06:40:46.0 (135794288)|HEAP_ALLOCATE|[112]|Bytes:4
06:40:46.0 (135800812)|HEAP_ALLOCATE|[112]|Bytes:4
06:40:46.0 (135804851)|HEAP_ALLOCATE|[112]|Bytes:4
06:40:46.0 (135811117)|HEAP_ALLOCATE|[112]|Bytes:4
06:40:46.0 (135817177)|HEAP_ALLOCATE|[112]|Bytes:4
06:40:46.0 (135821209)|HEAP_ALLOCATE|[112]|Bytes:4
06:40:46.0 (135827346)|HEAP_ALLOCATE|[112]|Bytes:4
06:40:46.0 (135833941)|HEAP_ALLOCATE|[112]|Bytes:4
06:40:46.0 (135840734)|HEAP_ALLOCATE|[112]|Bytes:4
06:40:46.0 (135844820)|HEAP_ALLOCATE|[112]|Bytes:4
06:40:46.0 (135851260)|HEAP_ALLOCATE|[112]|Bytes:4
06:40:46.0 (135857208)|HEAP_ALLOCATE|[112]|Bytes:4
06:40:46.0 (135863440)|HEAP_ALLOCATE|[112]|Bytes:4
06:40:46.0 (135867412)|HEAP_ALLOCATE|[112]|Bytes:4
06:40:46.0 (135874172)|HEAP_ALLOCATE|[112]|Bytes:4
06:40:46.0 (135880053)|HEAP_ALLOCATE|[112]|Bytes:4
06:40:46.0 (135884099)|HEAP_ALLOCATE|[112]|Bytes:4
06:40:46.0 (135890280)|HEAP_ALLOCATE|[112]|Bytes:4
06:40:46.0 (135896346)|HEAP_ALLOCATE|[112]|Bytes:4
06:40:46.0 (135902684)|HEAP_ALLOCATE|[112]|Bytes:4
06:40:46.0 (135906514)|HEAP_ALLOCATE|[112]|Bytes:4
06:40:46.0 (135912814)|HEAP_ALLOCATE|[112]|Bytes:4
06:40:46.0 (135918824)|HEAP_ALLOCATE|[112]|Bytes:4
06:40:46.0 (135922679)|HEAP_ALLOCATE|[112]|Bytes:4
06:40:46.0 (135928814)|HEAP_ALLOCATE|[112]|Bytes:4
06:40:46.0 (135934687)|HEAP_ALLOCATE|[112]|Bytes:4
06:40:46.0 (135938631)|HEAP_ALLOCATE|[112]|Bytes:4
06:40:46.0 (135944485)|HEAP_ALLOCATE|[112]|Bytes:4
06:40:46.0 (135950684)|HEAP_ALLOCATE|[112]|Bytes:4
06:40:46.0 (135956665)|HEAP_ALLOCATE|[112]|Bytes:4
06:40:46.0 (135962646)|HEAP_ALLOCATE|[112]|Bytes:4
06:40:46.0 (135966526)|HEAP_ALLOCATE|[112]|Bytes:4
06:40:46.0 (135972669)|HEAP_ALLOCATE|[112]|Bytes:4
06:40:46.0 (135978728)|HEAP_ALLOCATE|[112]|Bytes:4
06:40:46.0 (135982614)|HEAP_ALLOCATE|[112]|Bytes:4
06:40:46.0 (135993974)|HEAP_ALLOCATE|[112]|Bytes:8
06:40:46.0 (136022383)|SOSL_EXECUTE_END|[112]|Rows:36
06:40:46.0 (136107691)|HEAP_ALLOCATE|[112]|Bytes:8
06:40:46.0 (136136546)|VARIABLE_SCOPE_BEGIN|[112]|searchResults|List<List>|true|false
06:40:46.0 (136187065)|VARIABLE_ASSIGNMENT|[112]|searchResults|["List of size 36 too large to display"]|0x635c0aac
06:40:46.0 (136202923)|STATEMENT_EXECUTE|[117]
06:40:46.0 (136297365)|HEAP_ALLOCATE|[117]|Bytes:148
06:40:46.0 (136346793)|VARIABLE_SCOPE_BEGIN|[117]|classes|List|true|false
06:40:46.0 (136369664)|VARIABLE_ASSIGNMENT|[117]|classes|"List of size 36 too large to display"|0x26cd0d5a
06:40:46.0 (136641499)|HEAP_ALLOCATE|[119]|Bytes:5
06:40:46.0 (136695626)|HEAP_ALLOCATE|[119]|Bytes:16
06:40:46.0 (136710160)|VARIABLE_SCOPE_BEGIN|[119]|klass|ApexClass|true|false
06:40:46.0 (136751999)|VARIABLE_ASSIGNMENT|[119]|klass|{"Name":"ApexClassUtilities","Body":"/\n * @description (2444 more) ...","Id":"01p2y000001aEk2AAE"}|0x200cb542
06:40:46.0 (136764591)|STATEMENT_EXECUTE|[119]
06:40:46.0 (136767495)|STATEMENT_EXECUTE|[120]
06:40:46.0 (151990252)|HEAP_ALLOCATE|[120]|Bytes:5
06:40:46.0 (152014819)|HEAP_ALLOCATE|[120]|Bytes:17
06:40:46.0 (152041751)|METHOD_ENTRY|[8]|01p2y000001aEk2|ApexClassUtilities.ApexClassUtilities()
06:40:46.0 (152053467)|STATEMENT_EXECUTE|[8]
06:40:46.0 (152060876)|STATEMENT_EXECUTE|[8]
06:40:46.0 (152081168)|HEAP_ALLOCATE|[120]|Bytes:5
06:40:46.0 (152099200)|METHOD_EXIT|[8]|ApexClassUtilities
06:40:46.0 (152140308)|METHOD_ENTRY|[120]|01p2y000001aEk2|ApexClassUtilities.getGroupFromClassBody(ApexClass)
06:40:46.0 (152182058)|VARIABLE_SCOPE_BEGIN|[19]|klass|ApexClass|true|false
06:40:46.0 (152235935)|VARIABLE_ASSIGNMENT|[19]|klass|{"Name":"ApexClassUtilities","Body":"/
\n * @description (2444 more) ...","Id":"01p2y000001aEk2AAE"}|0x200cb542
06:40:46.0 (152254464)|HEAP_ALLOCATE|[21]|Bytes:5
06:40:46.0 (152263386)|STATEMENT_EXECUTE|[19]
06:40:46.0 (152266369)|STATEMENT_EXECUTE|[20]
06:40:46.0 (152271573)|HEAP_ALLOCATE|[21]|Bytes:13
06:40:46.0 (152337577)|HEAP_ALLOCATE|[20]|Bytes:24
06:40:46.0 (152350597)|SYSTEM_METHOD_ENTRY|[1]|Pattern.Pattern()
06:40:46.0 (152357844)|STATEMENT_EXECUTE|[1]
06:40:46.0 (152364872)|SYSTEM_METHOD_EXIT|[1]|Pattern
06:40:46.0 (152379741)|METHOD_ENTRY|[20]||System.Pattern.compile(String)
06:40:46.0 (152556802)|METHOD_EXIT|[20]||System.Pattern.compile(String)
06:40:46.0 (152568173)|VARIABLE_SCOPE_BEGIN|[20]|patternForFindingGroupTagInHeader|System.Pattern|true|false
06:40:46.0 (152615101)|VARIABLE_ASSIGNMENT|[20]|patternForFindingGroupTagInHeader|{"delegate":"0x7df81df5"}|0x41555909
06:40:46.0 (152626988)|STATEMENT_EXECUTE|[23]
06:40:46.0 (152686432)|METHOD_ENTRY|[23]||System.Pattern.matcher(String)
06:40:46.0 (152920000)|METHOD_EXIT|[23]||System.Pattern.matcher(String)
06:40:46.0 (152930551)|VARIABLE_SCOPE_BEGIN|[23]|matcher|System.Matcher|true|false
06:40:46.0 (152964593)|VARIABLE_ASSIGNMENT|[23]|matcher|{"delegate":"0x51adc176"}|0x7eefee8
06:40:46.0 (152975274)|STATEMENT_EXECUTE|[24]
06:40:46.0 (152991386)|METHOD_ENTRY|[24]||System.Matcher.find()
06:40:46.0 (154838781)|METHOD_EXIT|[24]||System.Matcher.find()
06:40:46.0 (154865873)|STATEMENT_EXECUTE|[25]
06:40:46.0 (154884201)|VARIABLE_SCOPE_BEGIN|[25]|groupName|String|false|false
06:40:46.0 (154909451)|VARIABLE_ASSIGNMENT|[25]|groupName|""
06:40:46.0 (154919843)|STATEMENT_EXECUTE|[26]
06:40:46.0 (154923109)|STATEMENT_EXECUTE|[26]
06:40:46.0 (154925786)|STATEMENT_EXECUTE|[27]
06:40:46.0 (154941798)|METHOD_ENTRY|[27]||System.Matcher.group(Integer)
06:40:46.0 (155053144)|METHOD_EXIT|[27]||System.Matcher.group(Integer)
06:40:46.0 (155068867)|VARIABLE_ASSIGNMENT|[27]|groupName|"Shared Code"
06:40:46.0 (155077651)|STATEMENT_EXECUTE|[35]
06:40:46.0 (155086540)|METHOD_EXIT|[120]|01p2y000001aEk2|ApexClassUtilities.getGroupFromClassBody(ApexClass)
06:40:46.0 (155095421)|VARIABLE_SCOPE_BEGIN|[120]|groupName|String|false|false
06:40:46.0 (155113973)|VARIABLE_ASSIGNMENT|[120]|groupName|"Shared Code"
06:40:46.0 (155184713)|HEAP_ALLOCATE|[121]|Bytes:4
06:40:46.0 (155215122)|STATEMENT_EXECUTE|[123]
06:40:46.0 (155220346)|STATEMENT_EXECUTE|[124]
06:40:46.0 (155240586)|HEAP_ALLOCATE|[124]|Bytes:4
06:40:46.0 (155342581)|HEAP_ALLOCATE|[EXTERNAL]|Bytes:8
06:40:46.0 (155352156)|HEAP_ALLOCATE|[EXTERNAL]|Bytes:-4
06:40:46.0 (155382577)|HEAP_ALLOCATE|[119]|Bytes:5
06:40:46.0 (155404312)|HEAP_ALLOCATE|[119]|Bytes:16
06:40:46.0 (155417321)|VARIABLE_SCOPE_BEGIN|[119]|klass|ApexClass|true|false
06:40:46.0 (155454803)|VARIABLE_ASSIGNMENT|[119]|klass|{"Name":"RecipeTreeViewContro (4 more) ...","Body":"/\n * @description (4870 more) ...","Id":"01p2y000001aEkrAAE"}|0x17c00562
06:40:46.0 (155467940)|STATEMENT_EXECUTE|[119]
06:40:46.0 (155470792)|STATEMENT_EXECUTE|[120]
06:40:46.0 (155480019)|METHOD_ENTRY|[120]|01p2y000001aEk2|ApexClassUtilities.getGroupFromClassBody(ApexClass)
06:40:46.0 (155489105)|VARIABLE_SCOPE_BEGIN|[19]|klass|ApexClass|true|false
06:40:46.0 (155513015)|VARIABLE_ASSIGNMENT|[19]|klass|{"Name":"RecipeTreeViewContro (4 more) ...","Body":"/
\n * @description (4870 more) ...","Id":"01p2y000001aEkrAAE"}|0x17c00562
06:40:46.0 (155529243)|HEAP_ALLOCATE|[21]|Bytes:5
06:40:46.0 (155536356)|STATEMENT_EXECUTE|[19]
06:40:46.0 (155539261)|STATEMENT_EXECUTE|[20]
06:40:46.0 (155546658)|METHOD_ENTRY|[20]||System.Pattern.compile(String)
06:40:46.0 (155629526)|METHOD_EXIT|[20]||System.Pattern.compile(String)
06:40:46.0 (155637718)|VARIABLE_SCOPE_BEGIN|[20]|patternForFindingGroupTagInHeader|System.Pattern|true|false
06:40:46.0 (155669386)|VARIABLE_ASSIGNMENT|[20]|patternForFindingGroupTagInHeader|{"delegate":"0x7df81df5"}|0xae86875
06:40:46.0 (155678384)|STATEMENT_EXECUTE|[23]
06:40:46.0 (155693389)|METHOD_ENTRY|[23]||System.Pattern.matcher(String)
06:40:46.0 (155784182)|METHOD_EXIT|[23]||System.Pattern.matcher(String)
06:40:46.0 (155798201)|VARIABLE_SCOPE_BEGIN|[23]|matcher|System.Matcher|true|false
06:40:46.0 (155840397)|VARIABLE_ASSIGNMENT|[23]|matcher|{"delegate":"0x660a71d8"}|0x37a3a833
06:40:46.0 (155850379)|STATEMENT_EXECUTE|[24]
06:40:46.0 (155858861)|METHOD_ENTRY|[24]||System.Matcher.find()
06:40:46.0 (156119324)|METHOD_EXIT|[24]||System.Matcher.find()
06:40:46.0 (156125181)|STATEMENT_EXECUTE|[25]
06:40:46.0 (156132213)|VARIABLE_SCOPE_BEGIN|[25]|groupName|String|false|false
06:40:46.0 (156147613)|VARIABLE_ASSIGNMENT|[25]|groupName|""
06:40:46.0 (156154081)|STATEMENT_EXECUTE|[26]
06:40:46.0 (156156618)|STATEMENT_EXECUTE|[26]
06:40:46.0 (156159009)|STATEMENT_EXECUTE|[27]
06:40:46.0 (156166442)|METHOD_ENTRY|[27]||System.Matcher.group(Integer)
06:40:46.0 (156200081)|METHOD_EXIT|[27]||System.Matcher.group(Integer)
06:40:46.0 (156209945)|VARIABLE_ASSIGNMENT|[27]|groupName|"Shared Code"
06:40:46.0 (156217063)|STATEMENT_EXECUTE|[35]
06:40:46.0 (156223346)|METHOD_EXIT|[120]|01p2y000001aEk2|ApexClassUtilities.getGroupFromClassBody(ApexClass)
06:40:46.0 (156233195)|VARIABLE_SCOPE_BEGIN|[120]|groupName|String|false|false
06:40:46.0 (156247311)|VARIABLE_ASSIGNMENT|[120]|groupName|"Shared Code"
06:40:46.0 (156276024)|HEAP_ALLOCATE|[121]|Bytes:19
06:40:46.0 (156296554)|STATEMENT_EXECUTE|[121]
06:40:46.0 (156299239)|STATEMENT_EXECUTE|[122]
06:40:46.0 (156368401)|HEAP_ALLOCATE|[EXTERNAL]|Bytes:4
06:40:46.0 (156388172)|HEAP_ALLOCATE|[119]|Bytes:5
06:40:46.0 (156404143)|HEAP_ALLOCATE|[119]|Bytes:16
06:40:46.0 (156413747)|VARIABLE_SCOPE_BEGIN|[119]|klass|ApexClass|true|false
06:40:46.0 (156442463)|VARIABLE_ASSIGNMENT|[119]|klass|{"Name":"ConnectApiHelper","Body":"/\r\nCopyright (c) 20 (20782 more) ...","Id":"01p2y000001aEmdAAE"}|0x2cc44a6a
06:40:46.0 (156452778)|STATEMENT_EXECUTE|[119]
06:40:46.0 (156455237)|STATEMENT_EXECUTE|[120]
06:40:46.0 (156460408)|METHOD_ENTRY|[120]|01p2y000001aEk2|ApexClassUtilities.getGroupFromClassBody(ApexClass)
06:40:46.0 (156470118)|VARIABLE_SCOPE_BEGIN|[19]|klass|ApexClass|true|false
06:40:46.0 (156490290)|VARIABLE_ASSIGNMENT|[19]|klass|{"Name":"ConnectApiHelper","Body":"/
\r\nCopyright (c) 20 (20782 more) ...","Id":"01p2y000001aEmdAAE"}|0x2cc44a6a
06:40:46.0 (156504319)|HEAP_ALLOCATE|[21]|Bytes:5
06:40:46.0 (156509051)|STATEMENT_EXECUTE|[19]
06:40:46.0 (156511459)|STATEMENT_EXECUTE|[20]
06:40:46.0 (156518506)|METHOD_ENTRY|[20]||System.Pattern.compile(String)
06:40:46.0 (156575354)|METHOD_EXIT|[20]||System.Pattern.compile(String)
06:40:46.0 (156580483)|VARIABLE_SCOPE_BEGIN|[20]|patternForFindingGroupTagInHeader|System.Pattern|true|false
06:40:46.0 (156605031)|VARIABLE_ASSIGNMENT|[20]|patternForFindingGroupTagInHeader|{"delegate":"0x7df81df5"}|0x2c8155b3
06:40:46.0 (156622289)|STATEMENT_EXECUTE|[23]
06:40:46.0 (156648650)|METHOD_ENTRY|[23]||System.Pattern.matcher(String)
06:40:46.0 (156717622)|METHOD_EXIT|[23]||System.Pattern.matcher(String)
06:40:46.0 (156723244)|VARIABLE_SCOPE_BEGIN|[23]|matcher|System.Matcher|true|false
06:40:46.0 (156746630)|VARIABLE_ASSIGNMENT|[23]|matcher|{"delegate":"0x108be1e4"}|0x40e99fe9
06:40:46.0 (156756890)|STATEMENT_EXECUTE|[24]
06:40:46.0 (156761554)|METHOD_ENTRY|[24]||System.Matcher.find()
06:40:46.0 (176195575)|METHOD_EXIT|[24]||System.Matcher.find()
06:40:46.0 (176220490)|METHOD_EXIT|[120]|01p2y000001aEk2|ApexClassUtilities.getGroupFromClassBody(ApexClass)
06:40:46.0 (176233442)|METHOD_EXIT|[66]|01p2y000001aEkr|RecipeTreeViewController.generateMapOfGroupToListOfNames()
06:40:46.0 (176356980)|FATAL_ERROR|System.LimitException: Regex too complicated

Class.System.Matcher.find: line 26, column 1
Class.ApexClassUtilities.getGroupFromClassBody: line 24, column 1
Class.RecipeTreeViewController.generateMapOfGroupToListOfNames: line 120, column 1
Class.RecipeTreeViewController.generateTreeData: line 66, column 1
06:40:46.0 (176374412)|FATAL_ERROR|System.LimitException: Regex too complicated

Class.System.Matcher.find: line 26, column 1
Class.ApexClassUtilities.getGroupFromClassBody: line 24, column 1
Class.RecipeTreeViewController.generateMapOfGroupToListOfNames: line 120, column 1
Class.RecipeTreeViewController.generateTreeData: line 66, column 1
06:40:46.176 (176385547)|CUMULATIVE_LIMIT_USAGE
06:40:46.176 (176385547)|LIMIT_USAGE_FOR_NS|(default)|
Number of SOQL queries: 0 out of 100
Number of query rows: 0 out of 50000
Number of SOSL queries: 1 out of 20
Number of DML statements: 0 out of 0
Number of Publish Immediate DML: 0 out of 150
Number of DML rows: 0 out of 10000
Maximum CPU time: 0 out of 10000
Maximum heap size: 0 out of 6000000
Number of callouts: 0 out of 100
Number of Email Invocations: 0 out of 10
Number of future calls: 0 out of 50
Number of queueable jobs added to the queue: 0 out of 50
Number of Mobile Apex push calls: 0 out of 10

06:40:46.176 (176385547)|CUMULATIVE_LIMIT_USAGE_END

06:40:46.0 (176451607)|CODE_UNIT_FINISHED|RecipeTreeViewController.generateTreeData()
06:40:46.0 (176701543)|CODE_UNIT_FINISHED|apex://RecipeTreeViewController/ACTION$generateTreeData
06:40:46.0 (176711124)|EXECUTION_FINISHED
`

TriggerHandlers shouldn't implicitily use the trigger context variables.

In your trigger handler examples you implicitly use the context variables of Trigger.new and Trigger.old. These should be passed in via the constructor instead.

This will promote a better recipe to developers since it will encourage them to pass in the data making their classes easier to test and make them usable outside of the trigger context.

AccountTrigger/AccountTriggerHelper "best practice pattern" seriously flawed

What is missing from the application? Please describe.

Looking at the two classes mentioned in the title, it is clear to me that this pattern is sub-optimal.

By not passing the required values from the trigger to the helper method (run in this case), this requires the helper to directly access the Trigger.old/new and other values which prevents the testing of the helper's code outside the context of a DML operation. Given that unit tests that do not execute any DML are by far and a way faster and actually more cleanly focused on what is being unit tested, I cannot agree that this is a "best practice pattern".

Describe the solution you'd like

The trigger should pass all necessary Trigger values to the helper, such as Trigger.old, Trigger.new (or the equivalent maps) and perhaps the phase and type of event if the helper needs them. That way the helper simply acts on data it receives, and can be unit tested outside the trigger context, without any DML operations being required.

It should also be possible to mock out the handler's processing in the context of the trigger itself, so as to:

  1. Verify that the trigger invokes the handler (not the handler's behaviour) in the correct scenarios during actual DML operations (thereby verifying that the trigger is well written) and
  2. Avoid the actual processing from occurring except in a select few, more "integration level" tests that test the helper's real processing in the context of a real DML operation (thereby verifying that the correct processing is performed in a reduced number of scenarios).

We have accomplished the mockability by using a dependency injection pattern around the StubProvider along with some simple, re-usable StubProviders that perform method invocation counting etc. Such a mocking framework really should be included in the Apex Recipes library.

Homepage has an error in retrieving data if there are already apex classes in the org

Summary

Hi there,
After I installed the app, the homepage has an error in retrieving data if there are already apex classes in the org. I did some investigation and found that getGroupFromClassBody method uses a regular expression to match the group name. However, the groupName for the existing apex class name was assigned as ' :'.
I fix the code by adding if (groupName.trim()==':') {return 'Local Apex Classes';} before line 35. But I'm not sure if this is a good way of fixing this issue. Please let me know your thoughts on this. The screenshots were attached below.

image
image

Regards,
Patrick

Salesforce Org Type

Trailhead Playground

Steps To Reproduce

No response

Current Behavior

No response

Expected Behavior

No response

Relevant Log Output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

RecipeTreeViewController not picking up new handlers

Add to MetadataTriggerHandler, MDTAccountTriggerHandler, MDTSecondAccountTriggerHandler

  • @group Trigger Recipes
  • @see TriggerHandler, AccountServiceLayer
    (also MDTSecondAccountTriggerHandler is not in trigger recipes folder)

~Thanks for the awesome recipes and codelives.

Summary

Short summary of what is going on or to provide context.

Steps To Reproduce:

  1. This is step 1.
  2. This is step 2. All steps should start with '1.'

Expected result

Describe what should have happened.

Actual result

Describe what actually happened instead.

Additional information

Feel free to attach a screenshot or code snippets.

new bug in apex project

Summary

new bug in apex project

Salesforce Org Type

Developer Edition Org

Steps To Reproduce

new bug in apex project

Current Behavior

new bug in apex project

Expected Behavior

new bug in apex project

Relevant Log Output

new bug in apex project

Code of Conduct

  • I agree to follow this project's Code of Conduct

Incorrect metadata query in getMetadataTriggers method of MetadataTriggerService

Summary

In the custom metadata query in getMetadataTriggers method of MetadataTriggerService class there's currently an issue with the query incorrectly retrieving custom object API names. The issue lies in line 28.

SELECT Class__c
            FROM Metadata_Driven_Trigger__mdt
            WHERE
->             Object__c = :this.objType
                AND Enabled__c = TRUE ...

Should be changed to

SELECT Class__c
            FROM Metadata_Driven_Trigger__mdt
            WHERE
->            Object__r.QualifiedApiName = :this.objType
                AND Enabled__c = TRUE ...

Addressing Object__c field, which is of type Metadata Relationship(Entity Definition), will only correctly retrieve Trigger Object's API name when using standard objects. When using custom objects, it will return the ID of CustomEntityDefinition.

this.objType will always be the API name of the object, which can be retrieved by selecting the QualifiedApiName instead.

Salesforce Org Type

Developer Edition Org

Steps To Reproduce

No response

Current Behavior

No response

Expected Behavior

No response

Relevant Log Output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

Logging Framework - Publish Immediate PE Limit not used

The logging framework built in the recipes is still using the DML limit vs a separate limit for the Publish Immediate (can be verified through Limits.getPublishImmediateDML() and getDMLStatements()).

The issue seems to be related to the event method returning generic SObject. Instead of returning the direct Platform Event.

public SObject toEvent() {
        return new Log__e(
            Log_Message__c = this.message,
            Request_Id__c = this.requestId,
            Quiddity__c = this.quiddity?.name(),
            Severity__c = this.severity?.name()
        );
    }

Instead of returning SObject, if this method returned Log__e. A separate limit for Publish Immediate DML limit is used. This seems to be a limitation and a workaround. Hope this helps anyone who is working on a logging framework.

public Log__e toEvent() {
        return new Log__e(
            Log_Message__c = this.message,
            Request_Id__c = this.requestId,
            Quiddity__c = this.quiddity?.name(),
            Severity__c = this.severity?.name()
        );
    }

Fundamentally the trigger framework is flawed

The trigger handler framework is fundamentally flawed.

The most major flaw, is it should be possible to UNIT test trigger code without depending on whether the trigger itself is active. Afterall, it is a unit test, not an end-to-end test.

The next flaw is the overloading of beforeInsert, beforeUpdate, ... methods, means code MUST be replicated, and leads for overly complex code.

Consider for example, I want three triggers. One that validates data populated on an object. One that sends an e-mail with those values after validation. And one that changes a status to avoid repeated processing.

Since it all very tightly related logic, it is reasonable I put it all in the same trigger handler. Now the same logic would run before insert and before update. So I would have methods:

void beforeInsert() { validate(); email();, statusUpdate(); }
void beforeUpdate() { validate(); email(); statusUpdate(); }

So I'm needlessly replicated code. It also does not allow you an easy way to say deactivate the email(); method without pushing an code update. Worse the design encourages me to put afterInsert and afterUpdate in the same trigger. But 99.9% of time code logic needs to be in the before trigger or the after trigger but not both.

Now I have written a trigger framework that addresses these and other issues. I'm going to see if I can get permission to open source it. But I think even though I don't like one method per event, it is a common design pattern. So I can see some developers would still prefer to use this frame work. Some of these definencies are realtively easy to solve.

For example, I have a TriggerArguments class that I use in my trigger handlers. That abstracts away direct access to the Trigger class and allows test methods to set the arguments without invoking the DML. Thus, true trigger tests. If I were to submit merge requests to augment these recepies to try and fix these design flaws, without changing the fundamental design, would you be willing to consider them?

Package ApexRecipes Install Failed

Summary

Package ApexRecipes Install Failed

Steps To Reproduce:

I've tried to install the unlocked package 'Apex Recipes' (for admins) with this link: 'https://test.salesforce.com/packaging/installPackage.apexp?p0=04t3g000000kiDJAAY' on one of our sandboxes.

My Domain is registered and deployed

Expected result

Package installation with errors.

Actual result

Organization: Colliers International Deutschland GmbH (00D0E0000002LcN)
User: Christian Schwabe (0050O000009pHg3)
Package: ApexRecipes (04t3g000000kiDJ)
Error Number: 752431791-1832068 (1903002296)
Problem:

Permission Read Account depends on permission(s): Read Contact
Provides_Edit_Access_to_Accounts_Except_ShippingStreet: Permission Read Account depends on permission(s): Read Contact

Permission Read Account depends on permission(s): Read Contact
Provides_Read_Only_Access_to_Account_and_All_Fields: Permission Read Account depends on permission(s): Read Contact

Permission Read Account depends on permission(s): Read Contact
Proving_With_Security_Enforced_Works: Permission Read Account depends on permission(s): Read Contact

Additional information

Feel free to attach a screenshot or code snippets.

Error loading recipes in lwc component

image

Stack:

SYSTEM_METHOD_ENTRY|[1]|Pattern.Pattern()
SYSTEM_METHOD_EXIT|[1]|Pattern
METHOD_ENTRY|[21]||System.Pattern.compile(String)
METHOD_EXIT|[21]||System.Pattern.compile(String)
METHOD_ENTRY|[24]||System.Pattern.matcher(String)
METHOD_EXIT|[24]||System.Pattern.matcher(String)
METHOD_ENTRY|[25]||System.Matcher.find()
METHOD_EXIT|[25]||System.Matcher.find()
METHOD_EXIT|[120]|01pf400000MUm5y|ApexClassUtilities.getGroupFromClassBody(ApexClass)
METHOD_EXIT|[66]|01pf400000MUm6l|RecipeTreeViewController.generateMapOfGroupToListOfNames()
FATAL_ERROR|System.LimitException: Regex too complicated

Class.System.Matcher.find: line 26, column 1
Class.ApexClassUtilities.getGroupFromClassBody: line 25, column 1
Class.RecipeTreeViewController.generateMapOfGroupToListOfNames: line 120, column 1
Class.RecipeTreeViewController.generateTreeData: line 66, column 1
FATAL_ERROR|System.LimitException: Regex too complicated

ApexClass:
Name=fflib_MatcherDefinitionsTest, Body=/**

Cannot deploy to a Trailhead Playground

Summary

I'm trying to use a Trailhead Playground to explore the recipes. It fails to deploy due to platform cache restrictions

Steps To Reproduce:

  1. Create a new TH Playground
  2. Authorize it from the repo folder
  3. Try running sfdx force:source:deploy -p force-app

Expected result

Source successfully deployed

Actual result

Terminal output:
SOURCE PROGRESS | ████████████████████████████████████████ | 145/146 Components
TYPE PROJECT PATH PROBLEM
───── ────────────────────────────────────────────────────────────────────── ───────────────────────────────────────────────────────
Error force-app/main/default/cachePartitions/default.cachePartition-meta.xml Total allocated capacity [3] exceeds the org limit [0].
ERROR running force:source:deploy: Deploy failed.
image

Expand LogMessage.cls to include the DateTime when the LogMessage was created.

What is missing from the application? Please describe.
The LogMessage class does not currently capture when the message was created. When the resulting LogEvent__c records are created from the platform event it won't include when the log message was created. The CreatedDate on the sObject will be when the platform event was processed.

Describe the solution you'd like
And properties and fields to track the DateTime that the log message was created.

Describe alternatives you've considered
You could put the details into the log message, but it makes more sense to have a dedicated field that can be queried in SOQL.

Data.com fields required in Sandbox.

Summary

Short summary of what is going on or to provide context.

Steps To Reproduce:

  1. Browsed to link in instructions for Installing with unlocked package:
    https://login.salesforce.com/packaging/installPackage.apexp?p0=04t3g000000kdzQAAQ
  2. Changed login.salesforce.com to test.salesforce.com.
  3. Authenticated successfully to my org.
  4. Attempted to install for all users.

Expected result

Package installed correctly into Sandbox

Actual result

Install failed when installing package. Received the errors:

  1. (Apex_Recipes) In field: field - no CustomField named Account.DandbCompanyId found
    Apex_Recipes: In field: field - no CustomField named Account.DandbCompanyId found

  2. (Provides_Read_Only_Access_to_Account_and_All_Fields) In field: field - no CustomField named Account.CleanStatus found
    Provides_Read_Only_Access_to_Account_and_All_Fields: In field: field - no CustomField named Account.CleanStatus found

Additional information

It appears these are fields added by data.com. We don't use it, and don't have them in our orgs. However, it seems these two field references are only in the permission set. It's probably not necessary to have them in there. If you remove the reference, it'd probably install fine.

Email Recipe Updates

Summary

The Email Recipe shows creating an EmailMessage with a status of 0. When people are looking for guidance on how to create EmailMessages, this will lead them in a confusing direction, as any EmailMessages that are created with this status will appear in the "Upcoming and Overdue" portion of the Activity Timeline instead of in the Activity History based on the day/time of the email. Setting the status to 3 resolves that behavior. The documentation isn't very clear about this, so I think demonstrating it in the recipe would help a lot of people.

In addition, I think it would be helpful if the recipe shows the IsClientManaged field, as this is what would allow adding files to the Email in a way that will surface the attachment Icon in the Activity timeline.

Suggested Solution

When inserting the EmailMessage, set the Status field to 3 instead of 0

When inserting the EmailMessage, add the IsClientManaged field, setting it to true

Alternative Solutions

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

Package ApexRecipes Install Failed

Summary

Package ApexRecipes Install Failed

Steps To Reproduce:

1)Log in to your org

2)f you are setting up a Developer Edition: go to Setup, under My Domain, register a My Domain.

3)Please be sure that the domain is both registered and deployed and that your user has logged into the new domain.
4)Go to Setup, under Platform Cache, and click the "Request Trial Capacity" button. Request a Platform Cache Trial

5)Click this link to install the Apex Recipes unlocked package in your org.

6)Select Install for All Users

Expected result

Package installed

Actual result

Your request to install package "ApexRecipes Winter '21 release" was unsuccessful. None of the data or setup information in your salesforce.com organization was affected.

If your install continues to fail, contact Salesforce CRM Support through your normal channels and provide the following information.

Organization: HarpiaCloud (00Df4000002cmIj)
User: Jose Costa (005f4000000cRaq)
Package: ApexRecipes (04t3g000000ki8s)
Error Number: 1645147636-198382 (1630339717)

Problem:

  1. Permission Read Account depends on permission(s): Read Contact
    Provides_Edit_Access_to_Accounts_Except_ShippingStreet: Permission Read Account depends on permission(s): Read Contact

  2. Permission Read Account depends on permission(s): Read Contact
    Provides_Read_Only_Access_to_Account_and_All_Fields: Permission Read Account depends on permission(s): Read Contact

  3. Permission Read Account depends on permission(s): Read Contact
    Proving_With_Security_Enforced_Works: Permission Read Account depends on permission(s): Read Contact

Additional information

Feel free to attach a screenshot or code snippets.

Data tree import fails with The requested resource does not exist in namespaced DE org

Summary

Attempting sfdx force:data:tree:import -p .\data\data-plan2.json returns

ERROR running force:data:tree:import: The requested resource does not exist

in org where namespace was selected.

Salesforce Org Type

Developer Edition Org

Steps To Reproduce

Follow steps to install repo in DE org where a namespace (e.g. mynamespace) was selected. Ref: https://github.com/trailheadapps/apex-recipes#installing-the-app-using-a-developer-edition-org-or-a-trailhead-playground-via-the-salesforce-cli

Current Behavior

Step 6 will fail when importing data-plan2.js:

sfdx force:data:tree:import -p .\data\data-plan2.json

ERROR running force:data:tree:import: The requested resource does not exist

Expected Behavior

Instructions should mention additional steps to adapt tree for this scenario:

  1. Change sObject names in data-plan2.json:

From:

    "sobject": "Junction_Demo_1__c",

...
"sobject": "Junction_Demo_2__c",
...
"sobject": "Junction__c",

to

    "sobject": "mynamespace__Junction_Demo_1__c",

...
"sobject": "mynamespace__Junction_Demo_2__c",
...
"sobject": "mynamespace__Junction__c",

  1. Change parent1__c and parent2__c references in Junction.json:

From:

        "parent1__c": "@JunctionDemoRef1",
        "parent2__c": "@JunctionDemoTwoRef1"

to:

        "mynamespace__parent1__c": "@JunctionDemoRef1",
        "mynamespace__parent2__c": "@JunctionDemoTwoRef1"
  1. Change sObject type in Junction Demo 1.json:

From:

            "type": "Junction_Demo_1__c",

to

            "type": "mynamespace__Junction_Demo_1__c",
  1. Change sObject type in Junction Demo 2.json:

From:

            "type": "Junction_Demo_2__c",

to

            "type": "mynamespace__Junction_Demo_2__c",

Relevant Log Output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

Document Viewer is not reloading

Summary

When opened first time, Documentation tab on Apex Recipes page works properly. It loads the related .md file from resources. But it doesn't reload if you select another class. It keeps showing the document of the class that was previously selected.

Salesforce Org Type

Trailhead Playground

Steps To Reproduce

  1. Get a new Trailhead Playground.
  2. Deploy this project to the org following installation guide provided in README.
  3. Open the org and go to Apex Recipes app.
  4. From tree-view select any class. (e.g., AtFutureRecipes)
  5. Click the Documentation tab. It works as expected.
    Screenshot 2023-01-13 at 12 28 37 PM
  6. Now select another class from the tree-view. (e.g., BatchApexRecipes)
  7. Documentation contents do not reload and keep showing the previous class.
    Screenshot 2023-01-13 at 12 31 57 PM

Current Behavior

No response

Expected Behavior

No response

Relevant Log Output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

Regex too complicated error in developer edition

Summary

Regex too complicated error in developer edition

regex-too-comlicated

Salesforce Org Type

Developer Edition Org

Steps To Reproduce

No response

Current Behavior

No response

Expected Behavior

No response

Relevant Log Output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata Driven Trigger not working for custom objects.

Summary

I am trying to implement Metadata Driven Trigger but found out that custom objects are stored as Id not name in custom settings.
image

It is a problem because getMetadataTriggers() has WHERE Object__c = :this.objType which is object name.

This test case is failing (object is created in setup and metadata records are added)

    static void testMetadataRecordsExists() {

        MetadataTriggerService mts = new MetadataTriggerService(
            'Metadata_Trigger_Example__c'
        );
        Test.startTest();
        List<Metadata_Driven_Trigger__mdt> triggers = mts.getMetadataTriggers();
        Test.stopTest();

        System.assert(
            triggers.size() > 0,
            'Expected to find metadata records'
        );
    }

Steps To Reproduce:

  1. Create custom object
  2. Use it in test case
  3. Test case is failing as no metadata entries were found as they have Id not object name

Expected result

Metadata entry is found.

Actual result

Metadata entry is not found.

Clicking "Make a suggestion on Github" button on the DMLRecipes Class Results in a 404 error

Summary

Clicking on the "Make a suggestion on Github" button results in a 404 page on Github.

Steps To Reproduce:

  1. Clone the Apex-Recipes repro (I did that today)
  2. Follow the directions to install on a scratch org
  3. Open the Org and navigate to the Apex Recipes app
  4. Navigate to a Recipe (I didn't try them all but the first several recipes give the same result)
  5. Click on the "Make a suggestion on Github" button

Expected result

I should have been put in edit mode for the file of the Apex recipe of the page in Salesforce.

Actual result

New browser tab opened up to https://github.com/trailheadapps/apex-recipes/edit/master/force-app/main/default/classes/Data%20Recipes/DMLRecipes.cls

resulted in the github 404 page.

Additional information

Could this be a permissions issue? Perhaps this only works if I have forked the repo. However, that step was not mentioned in the Installation portion of the root repo README.md file. While that's probably an assumed step, not everyone will understand why this error came up.

System.ListException: List index out of bounds: 0

Summary

Some kind of missing exception handling. To be honest I have no suggested solution for this. Perhaps I do something wrong with your shared code.

Steps To Reproduce:

When you try this block of code you get an System.ListException on Class.CollectionUtils.stringMapFromCollectionByKey: line 67, column 1

List<Account> listOfAccount = new List<Account>();
//listOfAccount.add(new Account(Id = '0010E000010qaeaQAA'));
Map<String, Account> mapOfAccountById = (Map<String, Account>) CollectionUtils.stringMapFromCollectionByKey('Id', listOfAccount);

When you try this block of code everything works fine:

List<Account> listOfAccount = new List<Account>();
listOfAccount.add(new Account(Id = '0010E000010qaeaQAA'));
Map<String, Account> mapOfAccountById = (Map<String, Account>) CollectionUtils.stringMapFromCollectionByKey('Id', listOfAccount);

Expected result

Return an empty map without exception.

Actual result

System.ListException occurred.

Additional information

This error occurred to me during soql queries with no results.

Wrong example related to method definition

Summary

Wrong example in CollectionUtils for

Steps To Reproduce:

Open tab Apex Recipes, click on CollectionUtils and scroll down to method mapFromCollectionWithCollectionValues(String key,List incomingList) → List>

image

Expected result

Example and method definition should match.

Actual result

Example and method definition does not match

Additional information

N/A

Error retrieving data Regex too complicated

Summary

Getting Error on screen load "Error retrieving data Regex too complicated"

Steps To Reproduce:

  1. Follow the installation steps mentioned in the readme

Expected result

Should see the apex recipe app

Actual result

I am recieving an error on screen load that the Regex is too complicated.
Class : ApexClassUtilities
Method : getGroupFromClassBody
is failing with the exception FATAL_ERROR Class.ApexClassUtilities.getGroupFromClassBody: line 24, column 1

Additional information

Capture
Capture

Reusable StripInaccessible Utility Class

The StripInaccessibleRecipes class is a really great way of understanding how things work.
Along with that, it would be really great to have a reusable StripInaccessble class that contains all DML operations.
Since, the operations will stay the same irrespective of the use case, it would make more sense to have such a class.
That way, the developer has one less thing to worry about.

For example,
StripInaccessible.create(accountList); StripInaccessible.edit(accountList); StripInaccessible.remove(accountList);

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.