Questions tagged [crud]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1 vote
0 answers
16 views

Code refactor - EntityManager, ResourceModel and handlers

I have a slider module which use EntityManager. I want to refactor code to use ResourceModel, but i have problem with many to many relations. With EntityManager i used EntityManager\Operation\...
  • 11
0 votes
1 answer
28 views

How to create custom commands to perform crud operations in magento 2

How to create custom commands to perform crud operations in Magento 2.I am not getting help online. please provide code if possible.
  • 19
0 votes
1 answer
86 views

How to create simple CRUD module in Magento 1?

I'm new to Magento 1. I want to create 1 simple CRUD Operation module.
0 votes
1 answer
245 views

CRUD operation with admin grid, working example Magento 2

help to beginners give us working example of CRUD system in magento 2 with admin grid
  • 65
0 votes
1 answer
19 views

Does magento offers a crud CLI

I was wondering if magento was offering a CRUD CLI like Symfony would do. You get a prompt that ask you your entity fields and once your entered them all then the entity and it's related repository is ...
  • 853
0 votes
0 answers
37 views

I need a tutorial to create a crud

I'm looking to create a form on the back end that makes a registration in the bank using grid, but I don't think 1 tutorial that works, they are always out of date or incomplete. Can anyone inform me ...
  • 197
-3 votes
3 answers
465 views

I want to develop custom grid module with add buttons in Magento2 [duplicate]

I want to create custom module in which grid in backend with all add,edit,delete,and mass delete and also with buttons in grid for reset,back,delete,save and display it on frontend. so can anyone have ...
  • 507
0 votes
4 answers
2k views

Magento 2 - Check if record with certain value already exist in table before creating it

I created a new table company_shipping_quote. I am writing data into it like this: $quoteId = $quote->getId(); $html = $this->_generateNote($expressRule); $quoteModel = $this->...
  • 2,571
0 votes
1 answer
110 views

Magento 2 update column

I have one cronjob needs to update status periodically. Target table name is "Custom" if custom table contain customid, user_id, status, exp_date columns. I have scheduler php file call &...
0 votes
1 answer
3k views

How to Create CRUD operations with Admin Grid in Magento 2

How to create the CRUD operations with Admin Grid in Magento 2? I want to : First of create frontend input form. frontend input form data get in admin grid. In admin grid Create delete options. In ...
  • 3,277
0 votes
1 answer
212 views

Cannot update product name using productRepository in Admin Store ( Store 0 )

I'm trying to update a product using productRepository ( migrating from a flow using product factory with load ). Problem is tha when updating the name it is updating in store 1 ( default store ) but ...
  • 231
0 votes
1 answer
71 views

How To Upload Images and Show Their Thumbnails From Custom Module Admin Form

I have a custom grid. Need to upload product images from admin form of the custom module. Here is the grid Edit file at: app\code\local\Crud\Banner\Block\Adminhtml\Banner\Edit\Form.php $...
0 votes
0 answers
38 views

Block class is not getting loaded in magento 2.3.4

I created a simple layout where I specify the block class and the template to be rendered. But it seems like the block and template is not getting rendered. Below is the code. I am trying the CRUD ...
1 vote
2 answers
725 views

Magento 2:- Updating table value

I want to update the value of amount column in custom database table where customer_id with value of $total. $total = $array['amount'] - $arr['base_grand_total']; $sortedData = $prepaidModel->...
2 votes
5 answers
8k views

CRUD operation step by step with example

Is there any working example for CRUD operations step by step with code? I tried many links but not getting the accurate result to understand the steps of crud operations. I want to make it an ...
0 votes
1 answer
138 views

Magento 2: Why Add/Edit redirect to Admin Dashboard

I'm working on simple CRUD (create, read, update and delete) module without grid or ui component, just simple CRUD. So when i'm trying to create add/edit form, i've meet some weird issue, when i ...
  • 1,198
2 votes
1 answer
699 views

UIComponent Form - Spinner showing

In my Form UIComponent only a spinner is showing. I compared my implementation to several ways it is implemented. The grid is showing just fine, i only have the problem in the form. My layout file: &...
  • 301
1 vote
1 answer
436 views

How to add a pay until date to invoice in Magento2?

Please excuse me if I am asking a dumb question, but I am new to Magento and frankly, my first impression is that it is over-designed and poorly documented. Maybe this is part of their business model, ...
0 votes
1 answer
3k views

Magento 2.2.6 | Uncaught Error: Undefined class constant 'CACHE_TAG'

I am very new to Magento, i created a CRUD custom module, when I input some data in form, and hit save button, I got an error like this: Fatal error: Uncaught Error: Undefined class constant '...
0 votes
1 answer
753 views

Connect Ionic App to Magento 2.3 REST API

I'm a Magento developer and I need to connect an app developed in Ionic with the Magento 2 REST API. I need to make an extension that grants more access to a customer token, additionally, I need to ...
2 votes
0 answers
48 views

Magento 2 - Can I have to create API, Interface & Resource Model for relational table

I am creating a module which have three tables let's say for example table1 -------- id int(13) PRIMARY_KEY title varchar(50) table2 -------- id int(13) PRIMARY_KEY title varchar(255) table3 `...
  • 1,691
1 vote
2 answers
679 views

Magento2: Can anyone describe crud operation?

Can anyone describe the CRUD operations by admin panel ?
  • 1,127
1 vote
0 answers
149 views

Magento 2 API - crud for all tables

Is it possible to create a new REST API to update or create data in all magento tables from a xml added in POST : <data> <row table="Nom_Table_1" key="Nom_Champ_Key_1"> <...
  • 144
3 votes
2 answers
444 views

Cusotm module edit action redirects it to the dashborard

I created Grid using UI Components and provide Edit action using < actionsColumn > in vendormodulename_entity_list.xml <actionsColumn name="actions" class="Vendor\Modulename\Ui\Component\...
1 vote
1 answer
1k views

Magento 2, Cannot `getCollection()` from model factory

Using magento 2.2, CRUD, API. I got an error while try to access method getCollection(). { "messages": { "error": [ { "code": 500, "...
3 votes
2 answers
107 views

Magento 2.2.5: Add Student Instead of Update Student

So instead of update the student, this code add a new student. I'm looking for a way that not using object manager, because the objectmanager is recommended not to use. So when i searching for how to ...
  • 1,198
6 votes
3 answers
3k views

Magento 2.2.5 : Cant go to execute() in Controller

I'm doing a simple CRUD custom module after this module C:\xampp\htdocs\magento\vendor\magento\module-cms\Controller\Adminhtml\Page\Save.php and I have a controller to save/create/add the "students" ...
  • 1,198
0 votes
2 answers
1k views

Magento 2 : CRUD, Invalid method _getResource() in model when Save

Magento CE 2.2.0; I created CRUD for model 'people' and save data in to database by controller for testing. While i try to save by using controllor Add: $_person = $this->_objectManager->...
1 vote
1 answer
5k views

Magento 2.2 CRUD(Add,Update,Delete,Inline Edit) with ui component

My Concern is i want to develop basic extension with ui component with simple crud operation so i am referencing cms-page. What i have achived so far: Grid is properly working(with filter,column ...
  • 1,691
3 votes
0 answers
102 views

Magento 2 : How to get top 10 repeated values in a column using CRUD instead of sql?

I want to get top 10 most repeated values in a column of my table, I can do so using sql but I need to do it using CRUD i.e using collections or model as magento coding standard doesn't allow naked ...
  • 4,605
0 votes
1 answer
104 views

Magento2 : CRUD Module Add Button Not Showing

Starting with this sample, https://github.com/mageplaza/magento-2-sample-module, I'm trying to make a CRUD manager module. I went through the sample and changed everything I could find that looked ...
  • 153
0 votes
3 answers
2k views

Correct way to save entries to database

I want to know, what is the correct way to implement CRUD operations in Magento 2? because I found a lot of examples but they use deprecated methods. I created a table ('quote reserved item') with ...
12 votes
2 answers
4k views

What and why is the proper way to load a model

I have quite a lot of experience with Magento but I realized that I don't understand which way of loading a model is the correct one and why. I've read everything that I could, about the topic but ...
  • 179
2 votes
1 answer
438 views

CRUD logic in Controller or Block?

I have referred several blogs which explains CRUD functionality, some of the blogs write code like saving a model, in a Controller and some in a Block. Blogs CRUD functionality in Block : http://...
2 votes
0 answers
92 views

How to go around "Incorrect namespace usage(s)" in static tests

I have a simple CRUD module for Magento 2. When I run the static tests I get the following error/warning. "Incorrect namespace usage(s) found in file..... <Vendor>_<Module>". The ...
  • 196k
0 votes
1 answer
668 views

How to store dropdown value in database and display selected when edit item?

I am developing custom module. Other fields are saving data in database but i have issue with Dropdown field. It's not saving value in database. My code as following: $elements['target'] = $fieldset-&...
  • 1,464
0 votes
1 answer
387 views

Correct way to join core tables in magento 2

I am able to join table something like this.. $totalsales = $this->orderCollectionFactory->create() ->addFieldToSelect('*') ->...
  • 4,605
1 vote
2 answers
1k views

Can Anyone Describe a Basic CRUD Operation of Magento From Admin Side in Magento

I want to understand the actual crud operation from admin side with coding.
  • 2,116
1 vote
1 answer
3k views

Can Any one Describe a Basic CRUD Operation in Magento Front Side [duplicate]

I want to Know what is the process of ADD Update Delete in Magento from front side. so can any one help with code.
  • 2,116
3 votes
2 answers
2k views

Magento\Framework\Exception\NoSuchEntityException when updating products

I am Trying to update product programmatically magento2 Magento ver. 2.1.2 Hear is my code require 'vendor/autoload.php'; use Magento\Framework\App\Bootstrap; include('app/bootstrap.php'); $...
2 votes
0 answers
50 views

service contract save method flow - magento 2 [duplicate]

I can able to get custom table records from database using service contract but hard to understand the save flow. di.xml <preference for="Mobi\Service\Api\RcRepositoryInterface" type="Mobi\...
  • 9,619
19 votes
2 answers
18k views

Best Way to Load a Custom Model in Magento 2

Because it was hard for me to find the right way, below you could find the best practice I made mine. Enjoy, correct my English if needed and say me I'm wrong if I am. :) Edit : ... and I found out I ...
0 votes
1 answer
469 views

Magento 1: most efficient way to bulk add entities

So I'm working on a CRUD module that creates entities based on an XML feed. Right now, I'm using Magento system, so I have an array of data that I use to populate my object then call the save() ...
0 votes
1 answer
2k views

Magento 2: Grid mass action provides collection of Magento\Framework\View\Element\UiComponent\DataProvider\Document instead of models

I'm trying to make a mass delete action for my custom grid. A very helpful source of examples is this grid sample module by Marius but still I can't find the reason why the grid pass collection of ...
  • 724
1 vote
2 answers
772 views

Updating product in the catalog

I've some code to import some products: if the prodocut is new, I've insert it in the catalog, otherwise, I've to update the product if there are some changes. Code is the following: <?php ...
  • 131
5 votes
2 answers
5k views

Magento 2 Custom Module Insert Data Issue

I'm using Magento 2 CE Version 2.1.0 I'm making a custom module. For developing custom module i'm taking reference of Magento CMS Module {folder path}\magento2\vendor\magento\module-cms I have below ...
  • 9,553
3 votes
3 answers
8k views

Magento 2 Compile Generation Does Not Exist

I'm using Magento 2 CE Version 2.1.0 C:\wamp\www\magento2>C:\wamp\bin\php\php5.6.19\php.exe bin/magento setup:di:compile Compilation was started. %message% 0/7 [>---------------------------] ...
  • 9,553
0 votes
2 answers
6k views

Delete a row by custom field in Magento

I am facing an issue with deleting rows from table by custom field. Below my database table link_id | quote_id | giftcard_value | giftcard | redeemed_at ---------------------------------------------...
28 votes
1 answer
5k views

Magento 2.1: using the entity manager

From 2.1 Magento has introduced Magento/Framework/Model/EntityManager I may be wrong here but from my understanding it is to replace Magento/Framework/Model/AbstractModel which was implementing the ...
10 votes
2 answers
379 views

Magento 2 and Services Contracts

I know there is a lot of topics about this question but I'm not sure to clearly understand.. When did we need to use service contract ? Are they replacing the CRUD done by Model / ResourceModel ? ...