I am stuck in an issue. I did some changes on CustTable form. CustTable form is dependent on four datasources. I did some validation on CustTable Table and OrganizationDetail Table. Now the issue is when the form is saved the validateWrite() on only the focused datasource is called. Is it possible that the validateWrite() of the whole form is called. I mean of all the datasources associated with the form.
Answer:
AFAIR, the system calls validateWrite only on the active datasource and on datasources that are joined with the active one.
So if your link type is active or delayed (not inner join, for example), then the validateWrite on such datasource won't get called. (it is a different query, after all).
well, you see. This is an impossible situation.
if your datasource is inner joined with CustTable, the validateWrite on this datasource would be called automatically.
So I gather that it is not inner joined. Which means that it's an active join (probably you have a separate grid or something showing data from this table).
And when you press Ctrl+S on the form, the validateWrite is called only on the active datasource.
so you have to write code on both validateMethods, making sure that the interconnected fields don't get wrong input. BUT you validate only data from the active dataSource.
So, if you save CustTable record, the custTable field is validated, and if it is a restricted combination, you say that this is the wrong value in CustTable, not in the related table.
And if you save the record in the related table, you validated only data on this table.
hope this makes sense to you