“THAT RECORD IS NOT EDITABLE”

When trying to set a image field value in “before submit” i have used :

new_rec.save({

ignoreMandatoryFields: true,

enableSourcing: false

});

But getting an error :

This error will be removed when record.save() is excluded from the script. but the issue is that the required image is not visible on the Magento website. When attaching images to an item on update , the previous value is set up on the website. the required image was not seen.

1 comment

  1. Issue solved . The image sync works fine. The reason behind the problem is that the image file name did not update whenever new images came. The same images were created on the Magento site. issue resolved by setting the timestamp value along with the image file name.

    let timeNow = Math.round(+new Date() / 1000);

    let curImageName = `image_${timeNow}.${curImageType}`;

    By setting this value will make the file name should be unique so that no duplicates are created.

Leave a comment

Your email address will not be published. Required fields are marked *