0

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?

0

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.

3
  • 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 you
    – Avesh Naik
    Nov 13 '19 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 data Nov 13 '19 at 15:39
  • Can you give any reference for the code?
    – Avesh Naik
    Nov 14 '19 at 6:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.