I have a created a custom magento 2 ui component form on Admin side. I have given create a button in customer detail page. Now what i expect is when i click on the button, it will go to my custom form and populate (New not editing) some customer details (firstname, email etc). The other detail will be blank.
Any Help?
1 Answer 1
It can be done by creating your own UiComponent form with custom module and need to customise customer detail page also to add your button.
Redirect from that button to your custom form with your custom form if null and customer id both. then you can fetch customer data by customer id and fill your firstname/lastname etc. data
but make sure your form primary key should not be customer id else you will get all your field filled. if your fields name matched with customer attribute names.
- 
 I have added the button also redirecting it successfully along with the customer id, but how can i fetch customer detail on that form. Is it using dataprovider? if yes which function, Any reference for the code will help. Thank youAvesh Naik– Avesh Naik2019年11月13日 13:24:36 +00:00Commented Nov 13, 2019 at 13:24
 - 
 yes you should fetch customer data into data provider only, no need to create separate data provider for this, you have to use same data-provider and inside the form data you should add your customer dataRonak Chauhan– Ronak Chauhan2019年11月13日 15:39:52 +00:00Commented Nov 13, 2019 at 15:39
 - 
 Can you give any reference for the code?Avesh Naik– Avesh Naik2019年11月14日 06:16:40 +00:00Commented Nov 14, 2019 at 6:16