Idempiere UpdateAction webservice is returning error message: cannot set column message - adempiere

I created a webservice to update a column value in a table. While calling it using SOAP request xml, getting error message like: Cannot set value of column.
For users table, I am able to call similar webservice without any issue. But, this issue is coming with particular table. In which case, this message might come? Cannot set value of column.

Check the log on the server, the cause of that failure is logged in SEVERE level.

This exception if you are using non supported value. If your field is boolean type then use Y or N as value.

Related

How to check thrown errors during Sequelize validation execution

I have a sequelize model, which needs custom validation. That custom validation relies on some foreign keys being valid (valid as in valid uuid, not checked that they exist in db) on a record. There is also another validator appended that checks for mutual exclusivity of the foreign keys (only one can be present at the same time). After all this, I access the database in another validator to fetch data from another collection. I dont want this to happen if any of above validators fail because I dont want to access the database if I dont have to and I dont want to check if uuid is valid again because that is a job for one of previous validators.
The order is like so:
check if field contains valid type (uuid) - field type validator
check that field is not clashing with another field (mutually exclusive) - model-wide validator
fetch record from another collection to do further validation - model-wide validator
I want to check if previous validator has already thrown an error and not execute the next one if it has. Even better if I can check which one has thrown an error. Sequelize executes all validators even if error was already thrown. In documentation it says:
Any error messages collected are put in the validation result object
alongside the field validation errors, with keys named after the
failed validation method's key in the validate option object. Even
though there can only be one error message for each model validation
method at any one time, it is presented as a single string error in an
array, to maximize consistency with the field errors.
I tried several ways to access this "error" object but to no avail. Is there a way at all to know if error was already thrown by one of previous validators?

Not recognizing Null value in Laravel Validation Rule with Condition

Laravel version: 7.0
I am going to validate using exists with extra condition.
My validation rule is as following:
$rule['id'] = 'required|exists:domains,id,website_id,null';
I was going to validate if id exists in domains table where website_id is null.
Even there there are some rows which meet above rule, it returned validation error message: selected id is invalid.
I think system consider null as string 'null'.
So I tried like this.
$rule['id'] = 'required|exists:domains,id,website_id,' . null;
But same error.
Can anyone please help me?
Thanks!
You can use 'NULL' as the value. It specifically looks for this value for when you want to do a WHERE NULL with the database related rules.

how to create view of field collection in drupal 7

when i am creating a view of field collection they give error when we add fields in view
error is that:
An AJAX HTTP error occurred.
HTTP Result Code: 500
Debugging information follows.
Path: /en/admin/structure/views/view/new_page/preview/page/ajax
StatusText: error
ResponseText: Exception: Invalid field name given: field_translations is not a Field Collection field. in FieldCollectionItemEntity->__construct() (line 210 of /home)
how handle this problem
To create field collection view you need to add relationship to the Field collection first and than you can use it. The above error seems like you're using a wrong field.
Check if the field field_translations still exists as a field collection field on your installation (probably not anymore). Apparently removed fields remain inside the database table of Field Collection.
To solve this:
Take a database backup of your current installation (just to make sure)
go to your database, find the table field_collection_item and
explore it
find all the items referencing to field mentionned in the error (in
this case this would be field_translations)
Remove all these items and clear the cache of your Drupal
installation
(Source)

how to customize joomla db sql error messages and how to prevent duplicate entries

my showtime table contains following fields,
id, name, showtime where id is a int type auto-increment field(pK). showtime time type unique field .
when I try to add a showtime(duplicate value) to showtime field($row->store()) it shows the following joomla error message.(I used $row->getError() method)
TableShowTime: :store failed
Duplicate entry '10:30:00' for key 'showtime' SQL=INSERT INTO `jos_myextension_showtime` (`id`,`name`) VALUES ('0','evening')
I want to know is there any way to show only the db error message without showing sql query.
I have an idea to check the duplicate values using a query before insert, is it a good practice? Plz Help.
I think that if you don't want to display the query, then you shouldn't show the other part of the error message neither (don't tell the user you're trying to insert a duplicate key). A simple fix to this might be something like this:
if ( $row>getError() ) {
echo "Could not store [...]";
}
If this is a custom component, you could also modify your table class to customize these error message, or even show distinct error messages depending on the error number.
I hope it helped!

What is the proper way to catch and handle ORA-00001 SQLException with JDBC?

I'm creating a simple form that stores entered data in an extremely simple Oracle database table via a Java Servlet using JDBC. That table is using the email address as a primary key. If a user submits a form multiple times with the same email address, the execute function fails and throws a SQLException. The exception's string is the following:
java.sql.SQLException: ORA-00001: unique constraint (...removed...) violated
In this scenario, I would like to catch this exception and deal with it by telling the user that the form cannot be submitted multiple times with the same email address. What is the proper way to handle ORA-00001 separately and differently from any of the other SQLExceptions that can be thrown by execute? A string compare could obviously work here, but that seems like a poor solution.
If you don't need to be DBMS independent use SQLException.getErrorCode()
It returns the vendor specific numeric error code. For ORA-0001 this would be 1

Resources