Normal Topic Using XLookup and XPost (Read 1046 times)
cbislander
Full Member
***
Offline



Posts: 103
Joined: Mar 22nd, 2018
Using XLookup and XPost
Aug 27th, 2023 at 11:55pm
Print Post Print Post  
I have a very simple interaction with our delivery database and our invoice databases from 2020 onward.  When a delivery is complete, the invoice number is entered into the delivery database and the customer's name is brought up.  When all the invoice numbers are entered, a mass update is done to post the date and status to the invoice databases.

Here is the Mass Update:

IF POSTED0 = "" THEN {XPOST("DATA\I-NGV2.DB",INVOICE NUMBER0, "CUSTOMER!INVOICE" , DELIVERY DATE , "DELIVERY DATE","")
                                   POSTED0 = "YES"
                       XPOST("DATA\I-NGV2.DB",INVOICE NUMBER0, "CUSTOMER!INVOICE" , POSTED0 , "CMP","")
                 XPOST("DATA\I-2020V2.DB",INVOICE NUMBER0, "CUSTOMER!INVOICE" , DELIVERY DATE , "DELIVERY DATE","")
                                   POSTED0 = "YES"
                       XPOST("DATA\I-2020V2.DB",INVOICE NUMBER0, "CUSTOMER!INVOICE" , POSTED0 , "CMP","")

                 XPOST("DATA\I-2022V2.DB",INVOICE NUMBER0, "CUSTOMER!INVOICE" , DELIVERY DATE , "DELIVERY DATE","")
                                   POSTED0 = "YES"
                       XPOST("DATA\I-2022V2.DB",INVOICE NUMBER0, "CUSTOMER!INVOICE" , POSTED0 , "CMP","")
                                   
                 XPOST("DATA\I-2023V2.DB",INVOICE NUMBER0, "CUSTOMER!INVOICE" , DELIVERY DATE , "DELIVERY DATE","")
                                   POSTED0 = "YES"
                       XPOST("DATA\I-2023V2.DB",INVOICE NUMBER0, "CUSTOMER!INVOICE" , POSTED0 , "CMP","")
                                   

                 XPOST("DATA\I-2021V2.DB",INVOICE NUMBER0, "CUSTOMER!INVOICE" , DELIVERY DATE , "DELIVERY DATE","")
                                   POSTED0 = "YES"
                       XPOST("DATA\I-2021V2.DB",INVOICE NUMBER0, "CUSTOMER!INVOICE" , POSTED0 , "CMP","")
}

The problem is that it doesn't work for every invoice.  We found the issue with invoice 95085 in 2023.  I retrieved that 1 record in the delivery database and just left the 2023 command lines in the Mass Update.  It still did not work.

Any ideas?
  

Screenshot_2023-08-27_205124.png ( 52 KB | 20 Downloads )
Screenshot_2023-08-27_205124.png
Back to top
 
IP Logged
 
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2480
Joined: Aug 20th, 2003
Re: Using XLookup and XPost
Reply #1 - Aug 28th, 2023 at 3:22pm
Print Post Print Post  
Hello,

Are both the source and the target fields number fields? If so, Writeln() out the raw values and verify they are 95085.0000000 and that one of them isn't 95085.01000000 or something like that.

-Ray
  

Raymond Yoxall Consulting
ray.yoxall@gmail.com
ryoxall@lantica.com
Sesame Applications, Design and Support
Back to top
IP Logged
 
cbislander
Full Member
***
Offline



Posts: 103
Joined: Mar 22nd, 2018
Re: Using XLookup and XPost
Reply #2 - Aug 29th, 2023 at 3:00am
Print Post Print Post  
Hi Ray,

I will check that, but if the Xlookup worked, wouldn't the XPost work as well?
  
Back to top
 
IP Logged
 
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2480
Joined: Aug 20th, 2003
Re: Using XLookup and XPost
Reply #3 - Aug 29th, 2023 at 12:43pm
Print Post Print Post  
The code you posted has no XLookups so I can not draw that conclusion off the data that has been presented to me.

Problems like this require debugging. Is @Error being set? If so, What is @ErrorType()? Is that record locked in 2023? etc. etc.

-Ray
  

Raymond Yoxall Consulting
ray.yoxall@gmail.com
ryoxall@lantica.com
Sesame Applications, Design and Support
Back to top
IP Logged
 
cbislander
Full Member
***
Offline



Posts: 103
Joined: Mar 22nd, 2018
Re: Using XLookup and XPost
Reply #4 - Aug 30th, 2023 at 12:24pm
Print Post Print Post  
Hi Ray,

The computer is at a remote location.  I didn't get a chance to check it more.  When I did the Writeln, the result I go in each database was 95085 without any decimals.  I tried doing an Xlookup for the invoice number from the Delivery database but the result was 0.  I unloaded and unlocked the 2023 database and that didn't change it.

The odd part is that it works on most records, but not all.

I will check the @ERROR this evening.

I tried the @Error, and it says Command Error.

I have a copy of their Delivery Database on my system and tested it against my 2023 database, can got the same results.
« Last Edit: Aug 30th, 2023 at 2:34pm by cbislander »  
Back to top
 
IP Logged
 
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2480
Joined: Aug 20th, 2003
Re: Using XLookup and XPost
Reply #5 - Aug 30th, 2023 at 2:37pm
Print Post Print Post  
cbislander wrote on Aug 30th, 2023 at 12:24pm:
the result I go in each database was 95085 without any decimals


Okay that means it is a string comparison.

Quote:
I tried doing an Xlookup for the invoice number from the Delivery database but the result was 0.


I would bet that means the XLookup is also failing and you are casting the return value of a blank as an Int.

Is there security on the 2023 database?

-Ray
  

Raymond Yoxall Consulting
ray.yoxall@gmail.com
ryoxall@lantica.com
Sesame Applications, Design and Support
Back to top
IP Logged
 
cbislander
Full Member
***
Offline



Posts: 103
Joined: Mar 22nd, 2018
Re: Using XLookup and XPost
Reply #6 - Aug 30th, 2023 at 4:18pm
Print Post Print Post  
Hi Ray,

Yes, there is security on that database.

The delivery database doesn't appear to have xlookup password.

I added an Xlookup password and it seem to work for the record.

I'll try the rest tonight.

Thanks Ray.
  
Back to top
 
IP Logged