Adrian Larson

Aug 8, 2022 18:35
The post body is too long to include both links and descriptions in one, so I'll split it.
Aug 8, 2022 18:34
Subsequent pages:
grid = document.querySelector('dx-section[title="Browse Documentation"] dw-docs-grid').shadowRoot.childNodes[0];
cards = grid.querySelector("dx-grid").childNodes;
console.log(Array.from(cards).reduce((output, card) => output + "\n" + readCard(card), ""));
Aug 8, 2022 18:25
Since Chrome collapses the requisite double space to end a line, had to further massage the output in Python.
Aug 8, 2022 17:58
Tailored version (in progress):

let grid, cards;
grid = document.querySelector('dx-section[title="Browse Documentation"] dw-docs-grid').shadowRoot.childNodes[0];
cards = grid.querySelector("dx-grid").childNodes;
const readCard = (card) => {
const anchor = card.shadowRoot.childNodes[0];
const title = anchor.querySelector("dx-card-title").shadowRoot.textContent;
const description = anchor.text;
const href = anchor.href;
return ` - **[${title}](${href})** \n ${description}`
}
console.log(Array.from(cards).reduce((output, card) => output + "\n" + readCard(card), ""));
Aug 8, 2022 17:15
Fixed up generic version (still not working):

const getShadowDomHtml = (shadowRoot) => {
let shadowHTML = '';
for (let element of shadowRoot.childNodes) {
shadowHTML += element .nodeValue || element.outerHTML;
}
return shadowHTML;
};
const replaceShadowDomsWithHtml = (rootElement) => {
for (let element of rootElement.querySelectorAll('*')) {
if (element.shadowRoot) {
replaceShadowDomsWithHtml(element.shadowRoot);
element.innerHTML += getShadowDomHtml(element.shadowRoot);
}
}
};
replaceShadowDomsWithHtml(document.body);GEN
Aug 8, 2022 17:15
There was one typo (shadowRoot instead of el.shadowRoot), but it's still just wiping out everything for me.
Aug 8, 2022 17:14
I'm trying to use the approach recommended at the bottom of this article
Aug 8, 2022 17:12
I can add that to my scrape if I can get one working.
Aug 8, 2022 17:12
Especially since the markup makes it quite awkward to copy the titles. They went really far out of their way to make this information difficult to scrape.
Aug 8, 2022 17:12
Copying them over to preserve a current snapshot. Will take a bit of time.
 
Mar 5, 2020 17:14
Member vs static is completely irrelevant. Core concern is if you can successfully retrieve stack trace.
Mar 5, 2020 16:36
I could be wrong though. Might depend on how you generate the logs.
Mar 5, 2020 16:31
I think the core premise is flawed. If you can't get the stack trace because you're in managed code, none of the code will work.
Mar 5, 2020 16:29
I think that's just how the Exception.getStackTracString method works in managed code. It's to protect you.
Mar 5, 2020 16:26
So you're just talking about the regex?
Mar 5, 2020 16:24
Location logic?
Mar 5, 2020 16:14
Hello
 

 Open Office Hours

A place where we can informally discuss whatever comes to mind...
Dec 27, 2019 19:39
You guys do anything fun or exciting? See any movies?
Dec 27, 2019 19:27
Happy holidays everyone!
Dec 20, 2019 19:01
Just got my 6th. :)
Dec 6, 2019 20:35
@DerekF I certainly don't have any such experience
Nov 15, 2019 19:03
Sound advice
Nov 1, 2019 19:07
Probably haha
Oct 25, 2019 20:08
Good luck man! Sounds like a worthwhile project
Oct 11, 2019 19:58
Chirp
Oct 4, 2019 21:23
How's everyone doing? Any interesting problems you're working on? Any interesting weekend plans?
Oct 4, 2019 20:30
Here we go again
Sep 20, 2019 22:53
womp
Sep 20, 2019 20:01
How's everybody doing today?
Sep 17, 2019 14:53
:(
Sep 17, 2019 14:53
Not getting much action it seems.
Aug 23, 2019 13:49
Time will tell. :) We are just such a small community there isn't always anyone who has anything to say.
Aug 19, 2019 19:30
Bump
 
Dec 15, 2019 16:14
+1 just for the idea of convincing her to flip herself the bird.
 
Sep 18, 2019 17:51
Can you share how you are passing the token? Seeing your header could be informative here.
 
Aug 8, 2019 17:20
Just a note, your if(Test.isRunningTest()) { Database.executeBatch(audit); } is redundant. You know you are in a test, so this conditional is about as useful as if (true) { ... }.
 
Jul 24, 2019 18:41
Or just set record.OwnerId = parent.Account.OwnerId.
Jul 24, 2019 18:41
Yeah. So you would do:

Case parent = cases.get(record.WhatId);
Id ownerId = parent.Account.OwnerId;
Jul 24, 2019 18:37
if the Task points to the Case, it would be via WhatId
Jul 24, 2019 18:18
What is record there?
Jul 24, 2019 16:34
If you are querying the cases, just add Account.OwnerId to your query, rather than AccountId.
Jul 24, 2019 14:15
Yeah I mean...the entire feature description you've built out is based on that field being populated. Is it actually stored in WhatId?
Jul 24, 2019 13:02
So are you sure Task.AccountId is populated? And are you sure your trigger is active?
Jul 24, 2019 13:02
Did you actually change the trigger context from after insert to before insert?
Jul 24, 2019 13:02
Yep you figured it out. :) Usually, I put this code into a trigger handler so the code does not go in a trigger body. That is also best practice, but I'm trying to keep it to a few quick simple things for you to pick up on.
 
Feb 26, 2019 17:14
And the concept of read only doesn't really have anything to do with validation. You are not writing to anything, per se.
Feb 26, 2019 17:13
Have you tried whipping up a trigger to validate undelete?
Feb 26, 2019 17:12
You can, in some cases, add error in an after trigger.
Feb 26, 2019 17:12
All I am saying, is that your blanket statement is flawed.