Resolved - Mass Action - Mass Database Update in Magento Grid The Next CEO of Stack OverflowExclude a specific categoryCreate categories through installerMass action in Sales order gridUpdate to 1.9.2.4 breaks custom Sales Order Grid mass ActionMass Action in Order GridShopping cart is empty after cancel the payment in magento-1.9.1.1Solved - Adding Mass Delete Action to the GridValidate mass action columnShipment grid custom mass action problem with UiComponentFactory::argumentsResolver()Get Shipment Id while creating Shipment in Magento 1.9
Which kind of appliances can one connect to electric sockets located in a airplane's toilet?
How do I avoid eval and parse?
I believe this to be a fraud - hired, then asked to cash check and send cash as Bitcoin
How to start emacs in "nothing" mode (`fundamental-mode`)
If Nick Fury and Coulson already knew about aliens (Kree and Skrull) why did they wait until Thor's appearance to start making weapons?
Anatomically Correct Strange Women In Ponds Distributing Swords
Is there a way to save my career from absolute disaster?
Won the lottery - how do I keep the money?
Novel about a guy who is possessed by the divine essence and the world ends?
Is there an analogue of projective spaces for proper schemes?
If/When UK leaves the EU, can a future goverment conduct a referendum to join the EU?
Would this house-rule that treats advantage as a +1 to the roll instead (and disadvantage as -1) and allows them to stack be balanced?
What connection does MS Office have to Netscape Navigator?
If a black hole is created from light, can this black hole then move at speed of light?
How to invert MapIndexed on a ragged structure? How to construct a tree from rules?
MessageLevel in QGIS3
Make solar eclipses exceedingly rare, but still have new moons
Would a completely good Muggle be able to use a wand?
What is "(CFMCC)" on an ILS approach chart?
How do we know the LHC results are robust?
Elegant way to replace substring in a regex with optional groups in Python?
How do I go from 300 unfinished/half written blog posts, to published posts?
How powerful is the invisibility granted by the Gloom Stalker ranger's Umbral Sight feature?
Preparing Indesign booklet with .psd graphics for print
Resolved - Mass Action - Mass Database Update in Magento Grid
The Next CEO of Stack OverflowExclude a specific categoryCreate categories through installerMass action in Sales order gridUpdate to 1.9.2.4 breaks custom Sales Order Grid mass ActionMass Action in Order GridShopping cart is empty after cancel the payment in magento-1.9.1.1Solved - Adding Mass Delete Action to the GridValidate mass action columnShipment grid custom mass action problem with UiComponentFactory::argumentsResolver()Get Shipment Id while creating Shipment in Magento 1.9
I have this grid developed for the custom module. I added the mass delete action which works fine. But the mass Approve/Disapprove actions work only for one value, when I select multiple values I get this error.
Please help to resolve this:
Here is the code for the approve function in controller file:
public function massApproveAction()
$requestIds = $this->getRequest()->getParam('id');
if(!is_array($requestIds))
Mage::getSingleton('adminhtml/session')->addError(Mage::helper('adminhtml')->__('Please select reqeust(s)'));
else
try
foreach ($requestIds as $requestId)
$RequestData = Mage::getModel('cpstest_productcomment/cps')->load($requestId);
$id = $this->getRequest()->getParam('id');
$data = array('comment_status'=>'Approved');
$model = Mage::getModel('cpstest_productcomment/cps')->addData($data);
$model->setId($id)->save();
echo "Data updated successfully.";
catch (Exception $e)
echo $e->getMessage();
magento-1.9 module grid custom massaction
add a comment |
I have this grid developed for the custom module. I added the mass delete action which works fine. But the mass Approve/Disapprove actions work only for one value, when I select multiple values I get this error.
Please help to resolve this:
Here is the code for the approve function in controller file:
public function massApproveAction()
$requestIds = $this->getRequest()->getParam('id');
if(!is_array($requestIds))
Mage::getSingleton('adminhtml/session')->addError(Mage::helper('adminhtml')->__('Please select reqeust(s)'));
else
try
foreach ($requestIds as $requestId)
$RequestData = Mage::getModel('cpstest_productcomment/cps')->load($requestId);
$id = $this->getRequest()->getParam('id');
$data = array('comment_status'=>'Approved');
$model = Mage::getModel('cpstest_productcomment/cps')->addData($data);
$model->setId($id)->save();
echo "Data updated successfully.";
catch (Exception $e)
echo $e->getMessage();
magento-1.9 module grid custom massaction
add a comment |
I have this grid developed for the custom module. I added the mass delete action which works fine. But the mass Approve/Disapprove actions work only for one value, when I select multiple values I get this error.
Please help to resolve this:
Here is the code for the approve function in controller file:
public function massApproveAction()
$requestIds = $this->getRequest()->getParam('id');
if(!is_array($requestIds))
Mage::getSingleton('adminhtml/session')->addError(Mage::helper('adminhtml')->__('Please select reqeust(s)'));
else
try
foreach ($requestIds as $requestId)
$RequestData = Mage::getModel('cpstest_productcomment/cps')->load($requestId);
$id = $this->getRequest()->getParam('id');
$data = array('comment_status'=>'Approved');
$model = Mage::getModel('cpstest_productcomment/cps')->addData($data);
$model->setId($id)->save();
echo "Data updated successfully.";
catch (Exception $e)
echo $e->getMessage();
magento-1.9 module grid custom massaction
I have this grid developed for the custom module. I added the mass delete action which works fine. But the mass Approve/Disapprove actions work only for one value, when I select multiple values I get this error.
Please help to resolve this:
Here is the code for the approve function in controller file:
public function massApproveAction()
$requestIds = $this->getRequest()->getParam('id');
if(!is_array($requestIds))
Mage::getSingleton('adminhtml/session')->addError(Mage::helper('adminhtml')->__('Please select reqeust(s)'));
else
try
foreach ($requestIds as $requestId)
$RequestData = Mage::getModel('cpstest_productcomment/cps')->load($requestId);
$id = $this->getRequest()->getParam('id');
$data = array('comment_status'=>'Approved');
$model = Mage::getModel('cpstest_productcomment/cps')->addData($data);
$model->setId($id)->save();
echo "Data updated successfully.";
catch (Exception $e)
echo $e->getMessage();
magento-1.9 module grid custom massaction
magento-1.9 module grid custom massaction
edited Apr 6 '17 at 18:22
bestwebdevs
asked Apr 6 '17 at 0:24
bestwebdevsbestwebdevs
122213
122213
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
Everything is correct but at the time of saving data you set all request params in setId method. Please find below line and correct it.
$model->setId($id)->save();
Replace with below code
$model->setId($requestId)->save();
Thanks for your respond. With this code I don't get the error any more, but it still saves only one value.
– bestwebdevs
Apr 6 '17 at 16:58
Your solution is correct, I made a mistake and put it outside the loop, that's why it was only saving 1 value. Then I put it in the foreach loop and it works great :) Thank you!
– bestwebdevs
Apr 6 '17 at 17:34
add a comment |
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f167880%2fresolved-mass-action-mass-database-update-in-magento-grid%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Everything is correct but at the time of saving data you set all request params in setId method. Please find below line and correct it.
$model->setId($id)->save();
Replace with below code
$model->setId($requestId)->save();
Thanks for your respond. With this code I don't get the error any more, but it still saves only one value.
– bestwebdevs
Apr 6 '17 at 16:58
Your solution is correct, I made a mistake and put it outside the loop, that's why it was only saving 1 value. Then I put it in the foreach loop and it works great :) Thank you!
– bestwebdevs
Apr 6 '17 at 17:34
add a comment |
Everything is correct but at the time of saving data you set all request params in setId method. Please find below line and correct it.
$model->setId($id)->save();
Replace with below code
$model->setId($requestId)->save();
Thanks for your respond. With this code I don't get the error any more, but it still saves only one value.
– bestwebdevs
Apr 6 '17 at 16:58
Your solution is correct, I made a mistake and put it outside the loop, that's why it was only saving 1 value. Then I put it in the foreach loop and it works great :) Thank you!
– bestwebdevs
Apr 6 '17 at 17:34
add a comment |
Everything is correct but at the time of saving data you set all request params in setId method. Please find below line and correct it.
$model->setId($id)->save();
Replace with below code
$model->setId($requestId)->save();
Everything is correct but at the time of saving data you set all request params in setId method. Please find below line and correct it.
$model->setId($id)->save();
Replace with below code
$model->setId($requestId)->save();
edited 7 mins ago
Teja Bhagavan Kollepara
3,01241949
3,01241949
answered Apr 6 '17 at 6:25
ARVIND KARKARARVIND KARKAR
4722418
4722418
Thanks for your respond. With this code I don't get the error any more, but it still saves only one value.
– bestwebdevs
Apr 6 '17 at 16:58
Your solution is correct, I made a mistake and put it outside the loop, that's why it was only saving 1 value. Then I put it in the foreach loop and it works great :) Thank you!
– bestwebdevs
Apr 6 '17 at 17:34
add a comment |
Thanks for your respond. With this code I don't get the error any more, but it still saves only one value.
– bestwebdevs
Apr 6 '17 at 16:58
Your solution is correct, I made a mistake and put it outside the loop, that's why it was only saving 1 value. Then I put it in the foreach loop and it works great :) Thank you!
– bestwebdevs
Apr 6 '17 at 17:34
Thanks for your respond. With this code I don't get the error any more, but it still saves only one value.
– bestwebdevs
Apr 6 '17 at 16:58
Thanks for your respond. With this code I don't get the error any more, but it still saves only one value.
– bestwebdevs
Apr 6 '17 at 16:58
Your solution is correct, I made a mistake and put it outside the loop, that's why it was only saving 1 value. Then I put it in the foreach loop and it works great :) Thank you!
– bestwebdevs
Apr 6 '17 at 17:34
Your solution is correct, I made a mistake and put it outside the loop, that's why it was only saving 1 value. Then I put it in the foreach loop and it works great :) Thank you!
– bestwebdevs
Apr 6 '17 at 17:34
add a comment |
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f167880%2fresolved-mass-action-mass-database-update-in-magento-grid%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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