quickest-silver
quickest-silver12mo ago

Can you pull updates from a related field during creation of a new item?

I probably worded that really poorly but let me try to explain better. I have projects and customers, projects can have 1 customer but customers can have many projects. When creating a new project I have made it so the user can select the customer at that time but lets say the customer does not yet exist, I want to create a modal that would allow the user to create the customer and then select that customer but, if they already filled out the whole project create form I would hate for them to have to refresh the page to see the newly created customer. So I guess what I am asking would be can you force insert the newly created customer into the select field that is being used for selecting the customer associated with the project or should I just remove the create button and add a note that the customer needs to be created before attempting to create a project?
2 Replies
kapa.ai
kapa.ai12mo ago
Hi @erekyu. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- Based on the information provided in the extracts, refine does support creating records and updating forms without needing to refresh the page. When creating a new record, you can click on the "Create" button which opens up a form with empty fields. After entering the values and saving, the new record is created. This process can be used to create a new customer record. However, the extracts do not provide specific information on how to insert a newly created customer into a select field in a project creation form without refreshing the page. In general, it's possible to update the state of your application to include the new customer in the select field options. This would require using a state management solution to update the options in the select field after the new customer is created. If you're using Ant Design's Form component, you might be able to leverage its dynamic form item functionality to add the newly created customer to the select field. For more specific guidance, you might want to refer to the refine documentation (https://refine.dev/docs) or blogs (https://refine.dev/blog) for more detailed examples and tutorials. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
kapa.ai
kapa.ai12mo ago
<@66380739771379712> kapa.ai is still learning and improving, please let us know how it did by reacting below