DA - elimiante/modify business rule fail message from server on javascipt client - json message

I have implemented the beforeProcessDeltaChange business rule on a datatable on server side and I set a fail message :
fail(‘My custom fail message’)

On javascript client I receive this message:

“Update failed for:
{“recid”:0,“changetype”:“insert”,“status”:“failed”,“message”:“Script failed in beforeProcessDeltaChange: My custom fail message”,“old”:[80,1150,“2012-02-15T09:51:48.677Z”,“2012-02-15T09:51:48.677Z”],“new”:[80,1150,“2012-02-15T09:51:48.677Z”,“2012-02-15T09:51:48.677Z”]}”

I don’t want the client to see this type of message, I want only to see the message i set in fail function: “My custom fail message”. How can I achieve this?

Unfortunately, this part is quite rudimentary at the moment. It’s already logged as 53618: DA/JS reconcile dialog but I don’t think it will be implemented in the upcoming release.

So, the simplest solution is to modify DataAbstract.js and to change that part of RemObjects.DataAbstract.RemoteDataAdapter.prototype.applyUpdates to call your error handling function instead of alert() like this:

switch (__res.deltas[i].data[j].status) {
    case "failed" :
    if (this.onChangeFail) this.onChangeFail(__res.deltas[i].data[j])
    else alert("Update failed for:\n" + RemObjects.UTIL.toJSON(__res.deltas[i].data[j]));

and putting somewhere in your code

adapter.onChangeFail = function(change) {
    alert(change.message);
}

Uncompressed version of DataAbstract.js is located in \Data Abstract for JavaScript\Source folder. Then put modified version to the html folder of your DA server.

I use RemObjects Data Abstract for .NET - 6.0.55.957 - Trial version.
I don’t have a folder \Data Abstract for JavaScript, instead i have Data Abstract for .NET bun’t doesn’t contains the file DataAbstract.js
Where can I find the file DataAbstract.js?

attached

I don’t have a html folder by default on my DA server, if I create one and put the DataAbstract.js doesn’t work. Where do I have to put the file DataAbstract.js? Have to override the function IsFileContainedInResource of my RemObjects.DataAbstract.Server.JavaScriptHttpDispatcher object? Could you please give me an example? Thanks

Please look at http://wiki.remobjects.com/wiki/How_to_Write_a_RemObjects_SDK_Client_(JavaScript)#Enabling_JavaScript_access_at_the_server

And, afaik, ServeFilesFromFolder property should be set to true.