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

RecordDetail - Enhancement - Ability to pass a Parent or Lookup Record Id when creating a new record #491

Open
SDJCorp opened this issue Sep 16, 2020 · 3 comments

Comments

@SDJCorp
Copy link
Contributor

SDJCorp commented Sep 16, 2020

Was trying to use the Record Detail Component to add a new child object to an Opportunity but when I add it, the Opportunity field isn't populated.

The work around was to create the record first, with the required fields defaulted, and the opportunity ID filled in, then call the Record Detail Component with the newly created child record ID for the user to complete, but that could lead to issues when the user cancels out of the screen... so...

It would be much easier to just pass in the API name and record ID of the parent/lookup field that you want to use.

Also, for junction objects, maybe have 2 sets of field names and IDs?

@JodieM
Copy link

JodieM commented Nov 28, 2020

Yes, I would love this. Plus the ability to set default values. Then it would be amost perfect.

@adwhite75
Copy link
Collaborator

adwhite75 commented Dec 28, 2020

@SDJCorp / @JodieM could you provide some screenshots/mockups of how you'd expect this might work/look? Would the example here be that you are creating something like an OpportunityLineItem and you need to relate it to the parent Opportunity? Does the Opportunity not show when you include it as a field in the flow field inputs?

@JodieM
Copy link

JodieM commented Jan 1, 2021

I have a child record of Account, named Development (Development__c)

I want to use this excellent component to do a "Quick Create"... eg I don't want to see ALL Fields on the Development object because the Development (project) runs for many years and there is a lot of data to capture over the years. When the record is first created there are just a few key fields that need to be created.

I create this record from another record (eg Case - not real, but let's go with it). Case has a lookup to Account already.

So in my Flow I pass the Record ID of the Case into the Flow, then Get Records on Case, to return the AccountID and store that in a variable {!varAccountId}.

I then want to show a screen showing this Record Detail Component to show just the fields required to be entered at this stage, but prefilling the Account Name.

So when setting up the Component I need to enter the variable of the related record to pass in the ID, and I need to know which field that variable goes to.

See mockup image.
Mockup

However, this could even be much smarter... look at Dan Howell's Navigate Button and how that does the Create New Record link... that works really well. That would allow multiple fields to be related. Dan's approach could be used instead of the simple Record Field List entry and allow all values to be pre-filled. (Eg my Development has lookups to 3 Accounts and 4 Contacts for various reasons).

Here is how Navigate Button is set up.
New Record Settings:
NewRecord

TextTemplate with name, value pairs
TextTemplate

I can do this exact scenario with Navigate Button and Navigate Button is good in that it shows the real record in Edit mode, but as I noted I would like to have a "Quick Create" style of thing where only the necessary fields are added.

Note also that this could potentially be accomplished with Dynamic Forms, but even in Spring '21 Dynamic Forms are not ready for prime time and are also not available on Standard Objects. Your component works with Standard Objects too.

@JodieM JodieM removed their assignment Jan 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants