How To Fetch all customer name in multi select in custom admin formmain.CRITICAL: Plugin class doesn't...

Easy code troubleshooting in wordpress

How to acknowledge an embarrassing job interview, now that I work directly with the interviewer?

What am I? I am in theaters and computer programs

What can I substitute for soda pop in a sweet pork recipe?

Replacement ford fiesta radiator has extra hose

How to mitigate "bandwagon attacking" from players?

Second-rate spelling

How to count occurrences of Friday 13th

What are these green text/line displays shown during the livestream of Crew Dragon's approach to dock with the ISS?

How to speed up a process

It took me a lot of time to make this, pls like. (YouTube Comments #1)

What if I store 10TB on azure servers and then keep the vm powered off?

Use comma instead of & in table

If nine coins are tossed, what is the probability that the number of heads is even?

Can I become debt free or should I file for bankruptcy? How do I manage my debt and finances?

Magento 2: Override XML file from vendor folder to app folder doesn't work/update

Series pass transistor, LM7812

What is a term for a function that when called repeatedly, has the same effect as calling once?

Difference between 小吃 and 零食

What type of postprocessing gives the effect of people standing out

Did 5.25" floppies undergo a change in magnetic coating?

How to deny access to SQL Server to certain login over SSMS, but allow over .Net SqlClient Data Provider

Must a tritone substitution use a dominant seventh chord?

Compare four integers, return word based on maximum



How To Fetch all customer name in multi select in custom admin form


main.CRITICAL: Plugin class doesn't existMagento 2 : Problem while adding custom button order view page?Magento 2 Add new field to Magento_User admin formI have created an extension to show Customer Company Name in Order grid. But when creating new order, order is not showing in order gridForm is not displayed on panel admin Magento 2Magento offline custom Payment method with drop down listMagento 2 : Error when Add WYSIWYG Editor to Block FormMagento 2 Create dynamic array From different Model Collection to use in multi select in gridI have created one field using product form field for my price i want save my field value at product creation time from backend magento2Magento 2.3 Can't view module's front end page output?













0















I Want To fetch all customer name in multi select in my form using customer collection



Following is my form file



<?php

namespace MagnetoAppNotificationBlockAdminhtmlFormEditTab;

use MagentoBackendBlockWidgetFormGeneric;
use MagentoBackendBlockWidgetTabTabInterface;
use MagentoBackendBlockTemplateContext;
use MagentoFrameworkRegistry;
use MagentoFrameworkDataFormFactory;
use MagentoCmsModelWysiwygConfig;


class Info extends Generic implements TabInterface
{
/**
* @param Context $context
* @param Registry $registry
* @param FormFactory $formFactory
* @param Config $wysiwygConfig
* @param Status $newsStatus
* @param array $data
*/


public function __construct(
Context $context,
Registry $registry,
FormFactory $formFactory,
array $data = []
) {

parent::__construct($context, $registry, $formFactory, $data);

}

/**
* Prepare form fields
*
* @return MagentoBackendBlockWidgetForm
*/
protected function _prepareForm()
{


$model = $this->_coreRegistry->registry('appnotification_appnotification');

/** @var MagentoFrameworkDataForm $form */
$form = $this->_formFactory->create();

$form->setHtmlIdPrefix('notification_');
$form->setFieldNameSuffix('notification');


$fieldset = $form->addFieldset(
'base_fieldset',
['legend' => __('AppNotification')]
);

if ($model->getId()) {
$fieldset->addField(
'id',
'hidden',
['name' => 'id']
);
}
$fieldset->addField(
'title',
'text',
[
'name' => 'title',
'label' => __('Title'),
'required' => true
]
);
$fieldset->addField(
'subtitle',
'text',
[
'name' => 'subtitle',
'label' => __('Sub Title'),
'required' => true
]
);
$fieldset->addField(
'image',
'image',
[
'label' => __('Upload Image'),
'name' => 'image',
'required'=>true
]
);
$data = $model->getData();
$form->setValues($data);
$this->setForm($form);


return parent::_prepareForm();
}

/**
* Prepare label for tab
*
* @return string
*/
public function getTabLabel()
{
return __('AppNotification Info');
}

/**
* Prepare title for tab
*
* @return string
*/
public function getTabTitle()
{
return __('AppNotification Info');
}

/**
* {@inheritdoc}
*/
public function canShowTab()
{
return true;
}

/**
* {@inheritdoc}
*/
public function isHidden()
{
return false;
}


}


Here I Want To add customer filed where i want to fetch all customer name









share



























    0















    I Want To fetch all customer name in multi select in my form using customer collection



    Following is my form file



    <?php

    namespace MagnetoAppNotificationBlockAdminhtmlFormEditTab;

    use MagentoBackendBlockWidgetFormGeneric;
    use MagentoBackendBlockWidgetTabTabInterface;
    use MagentoBackendBlockTemplateContext;
    use MagentoFrameworkRegistry;
    use MagentoFrameworkDataFormFactory;
    use MagentoCmsModelWysiwygConfig;


    class Info extends Generic implements TabInterface
    {
    /**
    * @param Context $context
    * @param Registry $registry
    * @param FormFactory $formFactory
    * @param Config $wysiwygConfig
    * @param Status $newsStatus
    * @param array $data
    */


    public function __construct(
    Context $context,
    Registry $registry,
    FormFactory $formFactory,
    array $data = []
    ) {

    parent::__construct($context, $registry, $formFactory, $data);

    }

    /**
    * Prepare form fields
    *
    * @return MagentoBackendBlockWidgetForm
    */
    protected function _prepareForm()
    {


    $model = $this->_coreRegistry->registry('appnotification_appnotification');

    /** @var MagentoFrameworkDataForm $form */
    $form = $this->_formFactory->create();

    $form->setHtmlIdPrefix('notification_');
    $form->setFieldNameSuffix('notification');


    $fieldset = $form->addFieldset(
    'base_fieldset',
    ['legend' => __('AppNotification')]
    );

    if ($model->getId()) {
    $fieldset->addField(
    'id',
    'hidden',
    ['name' => 'id']
    );
    }
    $fieldset->addField(
    'title',
    'text',
    [
    'name' => 'title',
    'label' => __('Title'),
    'required' => true
    ]
    );
    $fieldset->addField(
    'subtitle',
    'text',
    [
    'name' => 'subtitle',
    'label' => __('Sub Title'),
    'required' => true
    ]
    );
    $fieldset->addField(
    'image',
    'image',
    [
    'label' => __('Upload Image'),
    'name' => 'image',
    'required'=>true
    ]
    );
    $data = $model->getData();
    $form->setValues($data);
    $this->setForm($form);


    return parent::_prepareForm();
    }

    /**
    * Prepare label for tab
    *
    * @return string
    */
    public function getTabLabel()
    {
    return __('AppNotification Info');
    }

    /**
    * Prepare title for tab
    *
    * @return string
    */
    public function getTabTitle()
    {
    return __('AppNotification Info');
    }

    /**
    * {@inheritdoc}
    */
    public function canShowTab()
    {
    return true;
    }

    /**
    * {@inheritdoc}
    */
    public function isHidden()
    {
    return false;
    }


    }


    Here I Want To add customer filed where i want to fetch all customer name









    share

























      0












      0








      0








      I Want To fetch all customer name in multi select in my form using customer collection



      Following is my form file



      <?php

      namespace MagnetoAppNotificationBlockAdminhtmlFormEditTab;

      use MagentoBackendBlockWidgetFormGeneric;
      use MagentoBackendBlockWidgetTabTabInterface;
      use MagentoBackendBlockTemplateContext;
      use MagentoFrameworkRegistry;
      use MagentoFrameworkDataFormFactory;
      use MagentoCmsModelWysiwygConfig;


      class Info extends Generic implements TabInterface
      {
      /**
      * @param Context $context
      * @param Registry $registry
      * @param FormFactory $formFactory
      * @param Config $wysiwygConfig
      * @param Status $newsStatus
      * @param array $data
      */


      public function __construct(
      Context $context,
      Registry $registry,
      FormFactory $formFactory,
      array $data = []
      ) {

      parent::__construct($context, $registry, $formFactory, $data);

      }

      /**
      * Prepare form fields
      *
      * @return MagentoBackendBlockWidgetForm
      */
      protected function _prepareForm()
      {


      $model = $this->_coreRegistry->registry('appnotification_appnotification');

      /** @var MagentoFrameworkDataForm $form */
      $form = $this->_formFactory->create();

      $form->setHtmlIdPrefix('notification_');
      $form->setFieldNameSuffix('notification');


      $fieldset = $form->addFieldset(
      'base_fieldset',
      ['legend' => __('AppNotification')]
      );

      if ($model->getId()) {
      $fieldset->addField(
      'id',
      'hidden',
      ['name' => 'id']
      );
      }
      $fieldset->addField(
      'title',
      'text',
      [
      'name' => 'title',
      'label' => __('Title'),
      'required' => true
      ]
      );
      $fieldset->addField(
      'subtitle',
      'text',
      [
      'name' => 'subtitle',
      'label' => __('Sub Title'),
      'required' => true
      ]
      );
      $fieldset->addField(
      'image',
      'image',
      [
      'label' => __('Upload Image'),
      'name' => 'image',
      'required'=>true
      ]
      );
      $data = $model->getData();
      $form->setValues($data);
      $this->setForm($form);


      return parent::_prepareForm();
      }

      /**
      * Prepare label for tab
      *
      * @return string
      */
      public function getTabLabel()
      {
      return __('AppNotification Info');
      }

      /**
      * Prepare title for tab
      *
      * @return string
      */
      public function getTabTitle()
      {
      return __('AppNotification Info');
      }

      /**
      * {@inheritdoc}
      */
      public function canShowTab()
      {
      return true;
      }

      /**
      * {@inheritdoc}
      */
      public function isHidden()
      {
      return false;
      }


      }


      Here I Want To add customer filed where i want to fetch all customer name









      share














      I Want To fetch all customer name in multi select in my form using customer collection



      Following is my form file



      <?php

      namespace MagnetoAppNotificationBlockAdminhtmlFormEditTab;

      use MagentoBackendBlockWidgetFormGeneric;
      use MagentoBackendBlockWidgetTabTabInterface;
      use MagentoBackendBlockTemplateContext;
      use MagentoFrameworkRegistry;
      use MagentoFrameworkDataFormFactory;
      use MagentoCmsModelWysiwygConfig;


      class Info extends Generic implements TabInterface
      {
      /**
      * @param Context $context
      * @param Registry $registry
      * @param FormFactory $formFactory
      * @param Config $wysiwygConfig
      * @param Status $newsStatus
      * @param array $data
      */


      public function __construct(
      Context $context,
      Registry $registry,
      FormFactory $formFactory,
      array $data = []
      ) {

      parent::__construct($context, $registry, $formFactory, $data);

      }

      /**
      * Prepare form fields
      *
      * @return MagentoBackendBlockWidgetForm
      */
      protected function _prepareForm()
      {


      $model = $this->_coreRegistry->registry('appnotification_appnotification');

      /** @var MagentoFrameworkDataForm $form */
      $form = $this->_formFactory->create();

      $form->setHtmlIdPrefix('notification_');
      $form->setFieldNameSuffix('notification');


      $fieldset = $form->addFieldset(
      'base_fieldset',
      ['legend' => __('AppNotification')]
      );

      if ($model->getId()) {
      $fieldset->addField(
      'id',
      'hidden',
      ['name' => 'id']
      );
      }
      $fieldset->addField(
      'title',
      'text',
      [
      'name' => 'title',
      'label' => __('Title'),
      'required' => true
      ]
      );
      $fieldset->addField(
      'subtitle',
      'text',
      [
      'name' => 'subtitle',
      'label' => __('Sub Title'),
      'required' => true
      ]
      );
      $fieldset->addField(
      'image',
      'image',
      [
      'label' => __('Upload Image'),
      'name' => 'image',
      'required'=>true
      ]
      );
      $data = $model->getData();
      $form->setValues($data);
      $this->setForm($form);


      return parent::_prepareForm();
      }

      /**
      * Prepare label for tab
      *
      * @return string
      */
      public function getTabLabel()
      {
      return __('AppNotification Info');
      }

      /**
      * Prepare title for tab
      *
      * @return string
      */
      public function getTabTitle()
      {
      return __('AppNotification Info');
      }

      /**
      * {@inheritdoc}
      */
      public function canShowTab()
      {
      return true;
      }

      /**
      * {@inheritdoc}
      */
      public function isHidden()
      {
      return false;
      }


      }


      Here I Want To add customer filed where i want to fetch all customer name







      magento2 magento-2.1 adminform multiselect-attribute customer-collection





      share












      share










      share



      share










      asked 9 mins ago









      Harsh JayswalHarsh Jayswal

      256




      256






















          0






          active

          oldest

          votes











          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "479"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f264403%2fhow-to-fetch-all-customer-name-in-multi-select-in-custom-admin-form%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes
















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Magento Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f264403%2fhow-to-fetch-all-customer-name-in-multi-select-in-custom-admin-form%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          “%fieldName is a required field.”, in Magento2 REST API Call for GET Method Type The Next...

          How to change City field to a dropdown in Checkout step Magento 2Magento 2 : How to change UI field(s)...

          夢乃愛華...