-
Notifications
You must be signed in to change notification settings - Fork 14
Description
Describe the bug
Error: "SObject row was retrieved via SOQL without querying the requested field: LabsActionPlans_ActionPlanc.Booking_c." is displayed when user clicks Edit on the Action Plan record (where new custom field is added in the fieldset)
To Reproduce
Steps to reproduce the behavior:
- Go to a custom object (e.g. Booking__c) and create a new record.
- This auto-generates an action plan record via flow, and at the same time will associate it with the newly created action plan.
- Go to the Action Plan created > then click "Edit."
- Error: "SObject row was retrieved via SOQL without querying the requested field: LabsActionPlans_ActionPlanc.Booking_c." is shown.
Expected behavior
User should be able to edit the Action Plan record and view the new custom field added in the layout.
Environment (please complete the following information):
-
OS: Windows
-
Browser Microsoft Edge, Chrome
-
Action Plans Version 4.3
-
Salesforce UI
-
Lightning Experience
-
Org Edition
-
Developer
Additional context
We want to further enhance Action Plan by associating a custom object (e.x. Booking__c) to Action Plan and vice versa to let users navigate to the related Booking record when they're on the Action Plan page.
We did the following solution and added it to the Action Plan FieldSet, but it resulted in errors:
- Created a lookup field, Booking__c, in the Action Plan object and added it to the flow to be populated after the Action Plan is created.
RESULT:Error: FIELD_CUSTOM_VALIDATION_EXCEPTION: You must relate an Action Plan to a single object. - Created 3 fields in the Action Plan object: 2 text fields that store the ID & Name of the Booking record, then a formula field (hyperlink) that mimics the lookup field in number 1 above. Add the formula field in the Action Plan FieldSet and populate the 2 text fields via flow, then let the 3rd field (formula) create a hyperlink from there.
RESULT: Viewing the Action Plan record is fine, but once the user EDITS it, an error is displayed:SObject row was retrieved via SOQL without querying the requested field: LabsActionPlans_ActionPlanc.Booking_c.
Questions:
- I would like to ask, is this approach we're trying to achieve feasible?
- Are we even allowed to add a custom field in the Action Plan object & page layout that is not a lookup?
- Do you have any suggestion(s) that's different from our approach but delivers the same goal?