Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: Prevent parameter-based master/detail when using range-based master/detail


This question is answered.


Permlink Replies: 2 - Last Post: Apr 15, 2016 1:23 AM Last Post By: Asbjørn Heid
Asbjørn Heid

Posts: 267
Registered: 11/12/12
Prevent parameter-based master/detail when using range-based master/detail  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Apr 14, 2016 8:15 AM
Hi,

I have a master/detail setup with orders and order lines. I want to use range-based master/detail for this so I can use the centralized cache (schema adapter).

I've got that part set up according to the documentation (MasterSource, MasterFields, IndexFieldNames).

I want to operate on a single order, so I do as follows:

  qryOrder.Close;
  qryOrder.ParamByName('OrderId').AsInteger := orderId;
  qryOrder.Open;
  qryOrderLines.Close;
  qryOrderLines.ParamByName('OrderId').AsInteger := orderId;
  qryOrderLines.Open;


This seems to work fine so far.

The problem is that when I do something to qryOrder, like say editing and posting, it tries to reload the data from qryOrderLines as if I used parameter-based master/detail.

The help states something about combining both methods by using fiDetails in FetchOptions.Cache. However I want to do the opposite, I want it to not try to use parameter-based master/detail and just have it apply the range to the detail dataset.

The help for fiDetails make it sound like that's not something I want to disable, so how do I do this?

Cheers
- Asbjørn
Dmitry Arefiev

Posts: 1,406
Registered: 12/7/03
Re: Prevent parameter-based master/detail when using range-based master/detail
Correct
Click to report abuse...   Click to reply to this thread Reply
  Posted: Apr 14, 2016 11:45 PM   in response to: Asbjørn Heid in response to: Asbjørn Heid
qryOrderLines.Close;
qryOrderLines.ParamByName('OrderId').AsInteger := orderId;
qryOrderLines.Open;

For that the parameter in this query should have a name
different from the MasterFields.

--
With best regards,
Dmitry
Asbjørn Heid

Posts: 267
Registered: 11/12/12
Re: Prevent parameter-based master/detail when using range-based master/detail  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Apr 15, 2016 1:23 AM   in response to: Dmitry Arefiev in response to: Dmitry Arefiev
Dmitry Arefiev wrote:
qryOrderLines.Close;
qryOrderLines.ParamByName('OrderId').AsInteger := orderId;
qryOrderLines.Open;

For that the parameter in this query should have a name
different from the MasterFields.

Well that was a proper facedesk moment, why didn't I think of that... :)

Cheers
- Asbjørn
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02