Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Cannot locate Apex Type for ID" #71

Open
2 tasks done
katrina-lawrence-salesfix opened this issue Oct 17, 2022 · 6 comments
Open
2 tasks done

"Cannot locate Apex Type for ID" #71

katrina-lawrence-salesfix opened this issue Oct 17, 2022 · 6 comments
Labels
bug Something isn't working

Comments

@katrina-lawrence-salesfix
Copy link

katrina-lawrence-salesfix commented Oct 17, 2022

Apex Error

Steps to re-create

  1. Create a new action plan from the Action Plans tab
  2. Add a task to the action plan
  3. Associate a record with the action plan
  4. Attempt to Save
  5. An error will display "Cannot locate Apex Type for ID"

Expected behavour: action plan saves successfully

Workaround: always attach an action plan by first navigating to a record and Creating an action plan from the related list. OR attach the record as your first step when creating an action plan (before adding any tasks)

Screenshots
image
image

Environment (please complete the following information):

  • OS: Windows

  • Browser chrome

  • Action Plans Version 4.2.1

  • Salesforce UI

  • Lightning Experience

  • Org Edition

  • Unlimited

@katrina-lawrence-salesfix katrina-lawrence-salesfix added the bug Something isn't working label Oct 17, 2022
@anthonygiuliano
Copy link

You should be able to find a record in the "Related Object" section using that lookup field. I'm experiencing the same error, and notice that it only gets thrown when that lookup is empty, like you said.

Something doesn't sit right about how this gets thrown though. As a required field, I would expect something less jarring, the way my browser complains about missing required fields everwhere else on the internet. Instead of failing only after the controller isn't able to getSObjectType.

I glanced through the markup on the page and the component that looks like it's responsible for this input field, and it looks like it should be getting the required attribute in the rendered html. Does anyone have any clues or insight that could help me understand what I'm seeing in this behavior?

@anthonygiuliano
Copy link

You should be able to find a record in the "Related Object" section using that lookup field. I'm experiencing the same error, and notice that it only gets thrown when that lookup is empty, like you said.

Something doesn't sit right about how this gets thrown though. As a required field, I would expect something less jarring, the way my browser complains about missing required fields everwhere else on the internet. Instead of failing only after the controller isn't able to getSObjectType.

I glanced through the markup on the page and the component that looks like it's responsible for this input field, and it looks like it should be getting the required attribute in the rendered html. Does anyone have any clues or insight that could help me understand what I'm seeing in this behavior?

I noticed that the form element is getting a novalidate attribute. I assume this is preventing the behavior I'm expecting re field requiredness.

@katrina-lawrence-qbcc
Copy link

Hi @anthonygiuliano there seems to be some weird refresh behaviour every time you add a new line in the tasks. I raised another bug where if you set a time on the task, then add another task below it the time resets back to default. Perhaps thats the hint -> when Add New Task is pressed, something is being triggered and that is expecting a value in the field.

@dschach
Copy link
Contributor

dschach commented Mar 10, 2023

Hi all. The reminder should be fixed in the next release. The novalidate attribute was included to allow people to delete a line when editing the tasks without throwing an error if all fields weren't filled in. It's proving difficult to enforce everything.

Perhaps we can do a special custom validation that the related record field be filled, using Javascript, but that feels a little janky. Thoughts?

@anthonygiuliano
Copy link

What if removeTask didn't refresh the whole page? Could it just remove the object from the list in memory and rerender that part of the page?

Or, what if the related record were optional? Worst case someone accidentally creates an action plan without one and the resulting tasks are created without a WhatId. Does that present challenges elsewhere that I haven't seen or thought about?

@dschach
Copy link
Contributor

dschach commented Mar 16, 2023

So I don't have good news. Validating that box is next to impossible, it seems. I'm going to have to put this on hold until I can rewrite this app in LWC. Very sorry - it's really hard to catch that error from the component and surface it to the page. I can't even find where the error is fired because it doesn't show up in the Apex logs! Odd!

In better news, a new release will be coming out next week!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants