Could IC offer a context menu to jump to any Id that I highlight?

Issue #1867 resolved
Aidan Harding created an issue

If I select a literal Id in code( 😱 ), in logs, anywhere… Could IC offer an option to open that Id in the project connection?

It could be helpful in various places e.g. when tests interact with records that are not isolated. One special case comes to mind… Flow errors.

When I get a Flow error in an Apex debug log, it looks like this:

11:56:39.734 (6341112867)|WF_FLOW_ACTION_ERROR|09L7Z000000L322|3004E0000001Y0s|Error executing flow: Opportunity, FlowDefId: 3004E0000001Y0s, FlowVersionId: 3017Z000000oeAG

If IC could link to record ids, and read the key prefix to construct the right URL prefix it would be great. So, in this case, I could highlight 3017Z000000oeAG, and be taken straight to https://instance.lightning.force.com/builder_platform_interaction/flowBuilder.app?flowId=3017Z000000oeAG

Comments (10)

  1. Scott Wells repo owner

    Interesting. When I first read this I thought you were specifically wanting it for hard-coded IDs in source, but yeah, being able to link to objects by ID from logs makes sense. I've already added this capability in SOQL query results, and I already support pattern-based matching in logs for linking to local file/line/column information, so shouldn't be difficult at all to add it for logs as well. I'll take a look shortly.

  2. Aidan Harding reporter

    Thanks, Scott!

    I mainly meant for logs, but I did also mean for source. I don’t write hard-coded ids in source, but I work with orgs that have them sometimes.

    I love this feature in the SOQL results panel. It’s really useful! It is one of those small quality of life things that makes IC such a pleasure to work with.

  3. Scott Wells repo owner

    Gotcha. Yeah, it wouldn't be difficult for source code either, though it makes me feel dirty to provide a feature that supports such an anti-pattern. Let me get it implemented for logs first, then I'll decide whether or not to carve off a small piece of my soul and implement it in source code as well. I think I could balance such a change by also adding a code inspection to flag hard-coded IDs with a warning...

  4. Scott Wells repo owner

    Committed the changes to support this in all console views today. Detected IDs in console views are hyperlinked. When clicked, if the proper connection can be determined unambiguously, the object associated with that ID is displayed in the org associated with that connection; if there's no way to determine the proper connection, e.g., a log pasted into Analyze > Stack Trace or Thread Dump, a connection selector is displayed. Obviously if the user chooses a connection for which the ID is not valid, a dead end page will be be displayed by Salesforce.

    I'm still chewing on whether/how to support this for string literals...

  5. Scott Wells repo owner

    Delivered in 2.1.7.5, at least for console views. At least right now I don't think I'm going to implement it for string literals due to that being a distinct anti-pattern.

  6. Aidan Harding reporter

    Great work Scott!

    I’m not sure if you would prefer this as a separate issue or not, but I’ve found that this has interacted with the up/down stack trace buttons in the test run logs.

    Now, those buttons are going to links for ids (and opening the link).

  7. Scott Wells repo owner

    Let's open a separate issue. I'm not sure whether I'll be able to do anything about that as I think that those actions navigate between hyperlinks. If there's a way to filter which should be included in those previous/next actions I'll implement that. Otherwise perhaps the best I can do is allow the user to decide whether IDs should be hyperlinked or not.

  8. Scott Wells repo owner

    Quick update...no need to file another issue. I'm pretty sure I just fixed it. Testing now, but there's a first-class provision for whether a link should be included in occurrence navigation or not. I'm now excluding these links.

  9. Log in to comment