Return error after using ApplyUpdate()

Hi,
I got the following error after using ApplyUpdate(). What is missing?

“Referenced dataset is not speificed or does not exist. Cannot generate SQL”

Thanks!

Hi,

have you used personal BusinessProcessor for this table?
can you show that properties you have set?

according to error, it can’t find BP.ReferencedDataset in Schema

Hi,
I haven’t any BusinessProcessor in my project. And I tried to add BusinessProcessor, the error is the same. I review your demo that need to create the Command in server side. Right?

Hi,

Can you create a simple project that reproduce this error, pls?
you can post it here or drop email to support@ for keeping privacy.

Hi,
I sent the simple project by email yesterday. Please check it.
Thanks!

Hi,

I don’t see any emails from you.
probably it was considered as a spam by provider …
try to send it directly to support group or to me here

Hi,
Here is my simple case. Thanks!
testcase(UpdateRec).zip (67.1 KB)

Hi,

You should specify valid LogicalName.
try

procedure TClientForm.Button2Click(Sender: TObject);
begin
  DAMemDataTable1.Close;
  ClientDataModule.RemoteDataAdapter.ReadSchema(true);
  DAMemDataTable1.LogicalName := 'Supplier'; ///<<<<<<<<<<<<<<< added
  ClientDataModule.RemoteDataAdapter.FillWithDASql(DAMemDataTable1, ComboBox2.text, nil);
end;

Hi,
Your suggestion is solved my problem. Thanks a lot. If some fields haven’t any data input by user, how to set the default value if without any data? Is it setting in Schema or need to handle by my coding?

Hi,

you can use field.DefaultValue property.
also you can use the table.OnNewRecord event and initialize required fields.

Noted with thanks!

Hi,
My DAMemDataTable is filled by MSSQL View that is join different tables. If I use ApplyUpdate, I got the error. How should I do?

Hi,

specify Insert/Update/Delete commands for such view:

see more about Schema Modeler at the Schema Modeler (Windows) article.

in some rare cases you can create stored procedures that will manage operations for several tables

Noted with thanks

Hi,
If I’m using DBEdit, is it possible using “Command” feature to insert the record in DB? Am I need to assign the DBEdit to “Command” parameters and then cancel the TDAMemDataTable’s? Otherwise, I need to redesign the UI that using TEdit for this.

Hi,

Can you describe what you want to reach, pls?

memtable has ruoPost option. it allows to do ApplyUpdates automatically at Post.

Hi,
I want to using DBEdit to capture the record information. Then I edit the value in DBEdit and using “Command_Update” to update the record. I guess it will rollback orginal DBEdit data because it should not refresh the TDAMemDataTable after “Command_Update”. I tested it will update TDAMemDataTable and it is what I want.
Thanks !

Hi,

DataAbstract supports standard DB controls.
if you want keep data in TDAMemDataTable unchanged after editing, better to use TEdit and edit data here.
changing of value inside TDBEdit will change field value in TDAMemDataTable too.

TDAMemDataTable can use your custom command automatically if it is set up inside Schema Modeller. otherwise, you can launch custom command with TDARemoteCommand

Hi,
Noted with thanks! If TDAMemDataTable hasn’t any TDAFieldCollection items, then I can’t using “FieldByName()” function. Right? My TDAMemDataTable is using runtime by inherit form. So it will not have any TDAFieldCollection items. How to create the TDAFieldCollection items after I assigned DASQL statement?

Hi,

When you open table with RDA.FillWithDASql, internal field collection will be filed with real field data.
so you can use table.Fields, table.FieldByName after table is opened w/o any problems.

check the DASQL sample for details.