Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 10 of 15 total
Thread Strange..
Mon, Oct 15 2018 6:04 PMPermanent Link

Ian Branch

Avatar




Attachments: Screenshot_B.jpg Screenshot_A.jpg Screenshot_C.jpg
Tue, Oct 16 2018 3:05 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Ian


Things like this I always start by suspecting the data so

1. pointing at different tables design time & run time
2. nulls in key
3. no entry in Parts for PartNo;BusCode


Roy Lambert
Tue, Oct 16 2018 5:24 AMPermanent Link

Ian Branch

Avatar

Hi Roy,
   Thanks for the input.
>
> 1. pointing at different tables design time & run time
IB - Nope.

> 2. nulls in key
IB - Nope.  Well not in the relevant records anyway.

> 3. no entry in Parts for PartNo;BusCode
IB - All there.

Regards,
Ian
Tue, Oct 16 2018 5:33 AMPermanent Link

Ian Branch

Avatar

A discovery,
   Just on a whime I changed the FormShow code from this.
{code}
Parts.Open;
Backorders.Active := True;
Backorders.Filter := 'JobNo = 999999999 and buscode = ''F''';
Backorders.Filtered := True;
{code}
   to this..
{code}
Parts.Open;
Backorders.Active := True;
Backorders.Filter := 'JobNo = 999999999 and buscode = ''F''';
Backorders.Filtered := True;
Backorders.Active := False;
Backorders.Active := True;
{code}
   It worked!  Sorta.  Showed the correct bins against the correct Parts.  
   
   If I simply moved to the next or previous record, all was good.

   If I clicked the Last button in the Navigator, all but one of the bins dissappeared. Frown?????  Nothing would restore
them except restarting the test app.

   Actually, clicking the First & Last buttons caused the showing Bin to swap to the opposite end of the table showing
while all the BO records remained static.

   Quite frustrating.

Ian
Tue, Oct 16 2018 7:33 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Ian


I tend to use OnCalc fields rather than lookup - I have done for ages maybe things like this was why I changed - memory fades -.

Two thoughts then

1. try using an OnCalc fiield
2. try using a standard dbgrid

Roy Lambert
Tue, Oct 16 2018 8:17 AMPermanent Link

Ian Branch

Avatar

Hi Roy,
   OK.
>
> 1. try using an OnCalc field
IB - Hmm.  Bit of a play here, haven't used them often.
{code}
procedure TForm12.BackordersCalcFields(DataSet: TDataSet);
begin
 Backorders.FieldByName('PartsBin').AsString := Parts.FieldByName('Bin').AsString;
end;
{code}
IB - Gives be the same Bin for all parts. Frown

> 2. try using a standard dbgrid
IB - It is a standard dbgrid.
>

   This is all too hard.  Frown

Ian
Tue, Oct 16 2018 9:46 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Ian


>    This is all too hard. Frown

Nope - this is what happens when you get old Smile

{code}
procedure TForm12.BackordersCalcFields(DataSet: TDataSet);
begin
if Parts.Locate('PartNo;BusCode',VarArrayOf(Backorders.FieldByName('PartNo').AsString,BackOrders.FieldByName('BusCode').AsString,[loCaseInsensitive])
then Backorders.FieldByName('PartsBin').AsString := Parts.FieldByName('Bin').AsString;
end;
{code}

should work - ie you have to do the lookup yourself.

Another alternative, especially since you're doing a filter on BackOrders would be to use a sensitive query. It would involve a subselect so something like

SELECT *, (SELECT Bin FROM Parts P WHERE P.PartNo = B.PartNo COLLATE ANSI_CI AND P.BusCode = B.BusCode COLLATE ANSI_CI)
From BackOrders B
WHERE JobNo = 999999999 and buscode = ''F''';



Roy



Tue, Oct 16 2018 1:41 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Ian,

Please include descriptions of any issues that you're seeing.  It's very hard to determine what's going on from just screen shots, and, if there *is* a bug, I have nothing to enter for an incident report.

Tim Young
Elevate Software
www.elevatesoft.com
Tue, Oct 16 2018 4:07 PMPermanent Link

Ian Branch

Avatar

Hi Tim,
   Fair enough but I wasn't yet convinced it was a bug rather than a deficiency on my part.
   If it had proven to be a bug you would have got all the details, including an example projec/data.
Regards,
Ian
Tue, Oct 16 2018 4:43 PMPermanent Link

Ian Branch

Avatar

Hi Roy,
   No good I'm afraid.
   
   I modified the first suggestion slightly.
{code}
procedure TForm12.BackordersCalcFields(DataSet: TDataSet);
begin
 if Parts.Locate('PartNo;BusCode', VarArrayOf([Backorders.FieldByName('PartNo').AsString,
Backorders.FieldByName('BusCode').AsString]), [loCaseInsensitive])
 then Backorders.FieldByName('PartsBin').AsString := Parts.FieldByName('Bin').AsString;
end;
{code}
   However it gives me the same as my previous effort. Frown

   The second, sql, suggestion won't work because it has a sub select and as soon as you set the TEDBQuery to Active it
sets the ReadOnly property, regardless of the RequestSensitive.

   No offence but at this stage I think I will bundle it up and send it to Tim for assessment.

Regards,
Ian
Page 1 of 2Next Page »
Jump to Page:  1 2
Image