Subject Re: [IBO] Lookup on Client table
Author Helen Borrie
At 11:38 PM 8/10/2006, you wrote:
>Hi All,
>
>Using IBO/FB I have two tables, master/client. Requestlive set to true
>on both.
>Both have PK fields. Client has FK field on master PK. PK fields are
>autogenerated (Using GeneratorLinks - a standard integer) fields for
>both tables.
>Everything works according to plan.
>
>If I add a lookup to the client based on it's FK refering to
>the 'SupplierName' mastertable field I get a "Field X must have a
>value" when attempting an insert on the client - where Field X is a
>required field for the client (there are 4 required fields in total).

Can you explain what you mean by "add a lookup to the client"?

>What I don't understand is why using INSERT seems to generate a POST -
>which is where I anticipate the error comes from as would be expected
>for a 'not null' field.

Let's first get clear about what you're doing here. If you have
implemented a master-detail relationship then the master record must
be posted before inserting a detail record can be allowed. So - if
you have actually inserted into the master record but that record is
not yet posted, then IBO posts the master record first, before
putting the detail set into dsInsert. So, if anything, the required
entry FieldX is in the master record, not the detail. IBO is aware
of required fields and it won't let a Post proceed if any
non-nullable fields are null. You're getting this error on the
client side: this is BeforePost checking which IBO does to avoid
incurring exceptions by posting blindly.

>Suggestions/workaround?

It's not a question of a "workaround". Only to make sure that
anything that has to be posted is ready to post. To provide a
solution for the user, mark the required field in some way and then
be ready intercept the error if he decides to move on before
finishing what he started. You can then send him a friendly message
like "Can't proceed until the compulsory fields are filled" and hop
the focus back to the first offending field.

Helen