I was unable to find a similar issue, so here goes: Has anyone else experienced issues with modifications not working correctly between two companies in the same database?
I have two companies in my database. Certain tables synchronize between the companies - among them the Item and Vendor tables and related subtables.
We implemented a modification to the Sales Line table to pull the Unit Price from the Item Prices table to help ensure compliance with GSA pricing policies (you cannot sell to your commercial clients for less than the GSA schedule without modifying the schedule, except with a waiver essentially).
The Item Prices table contains various prices over time and must be retained for auditing purposes, so we match the Starting Date with a field on the Vendor Card. The idea is that, if the vendor exists, the filter is set for Starting Date = Vendor Card date when it copies the Unit Price to the Sales Line table as GSA Unit Price, so that if there is no Starting Date = Vendor Card date, GSA Unit Price should be $0.
What I have found is that, given the same data in the Vendor and Item Prices tables for both companies, the code is only working in one of the companies. In the other company, it disregards the filter for the Starting Date and just goes to the last record found for the quantity break.
This is the chunk of code, on the OnValidate trigger of several fields (to be called basically whenever anyone modifies a field that could affect pricing):
GSAPrice.SETFILTER("Item No.","No.");
GSAPrice.SETFILTER("Price Group Code",'GSA');
IF Mfr.GET(Item."Vendor No.") THEN
GSAPrice.SETFILTER("Starting Date",'%1',Mfr."GSA Client Price Imported")
ELSE
GSAPrice.SETFILTER("Starting Date",'..%1',WORKDATE);
IF (Quantity > 0) THEN
GSAPrice.SETFILTER("Quantity Break",'<=%1',Quantity)
ELSE
GSAPrice.SETFILTER("Quantity Break",'1');
IF GSAPrice.FIND('+') THEN BEGIN
"GSA Unit Price" := GSAPrice."Unit Price";
UpdateUnitPrice;
IF Type = Type::"Account (G/L)" THEN
CLEAR("GSA Unit Price");
END;
I am at a loss to explain why it would work in one company but not the other.
0
Comments
That said I will still continue to blame the code every time it doesn't work
RIS Plus, LLC