Purchase orders - arrrhhhhhhhhh!!!!

Support, Questions and Suggestions for the FM7 Version of CC Calendar.
Posts: 25
Joined: Sat Aug 12, 2006 2:34 am
PostPosted: Thu May 17, 2007 7:08 am
Hi John,

I have another problem where I copy data from one table to another (From a suppliers line item to purchase order line items)

After I have found my records, I want to add this into the purchase line items table using the following script.

Go to Layout ["Purchase Orders" (Purchase order)]
New Record/Request
Set Variable [$PO Number, Value:PurchaseOrders::PurchaseOrderID]
Set Field [PurchaseOrders::SupplierID, $SupplierID]
Go to Layout ["SupplierLineItems" (Supplier Line Items)]
Go to Record/Request/Page [First]
Loop
Set Field [Purchase Order Line Items::PurchaseOrderID; $PO Number]
Set Field [Purchase Order Line Items::VendorSKU; SupplierLineItems::Vendor SKU Code
Set Field [Purchase Order Line Items::Name; SupplierLineItems::Name
Set Field [Purchase Order Line Items::Size; SupplierLineItems::Size
Set Field [Purchase Order Line Items::Price; SupplierLineItems::Price
Set Field [Purchase Order Line Items::Barcode; SupplierLineItems::Barcode
Go to Record/Request/Page
[Next; Exit after Last]
End Loop
Go to Layout "Purchase Order" (Purchase order)

There is a relationship from SupplierLineItems (SupplierLineItemsID) = PurchaseOrderLineItems (PurchaseOrderLineItemsID) with "Allow creation of records.....and delete records both ticked on the PurchaseOrderLineItems Side

It keeps overwriting the existing records (Fine if it doesn't find a previous entry for a particular item but if you have ordered it before it overwrites the po number and doesn't create a new request.

Regards,

Roy
SeedCode Staff
SeedCode Staff
Posts: 2756
Joined: Thu Nov 20, 2003 11:01 am
PostPosted: Sat May 19, 2007 12:41 pm
rservis wrote:There is a relationship from SupplierLineItems (SupplierLineItemsID) = PurchaseOrderLineItems (PurchaseOrderLineItemsID) with "Allow creation of records.....and delete records both ticked on the PurchaseOrderLineItems Side

It keeps overwriting the existing records (Fine if it doesn't find a previous entry for a particular item but if you have ordered it before it overwrites the po number and doesn't create a new request.


Sounds like this relationship is true for all POLineItems for a given SupplierLineItem, when what you probably want is a relationship that is true for all a SupplierLineItem's POLineItems on this PO. So I'd create a global field for the PO number in SupplierLineItems and then add a match between that global and Purchase Order Line Items::PurchaseOrderID to your allow-creation relationship. That way when you first arrive, there will be no matching records since you've never ordered that item before on that PO.

Hope that helps!
John Sindelar
SeedCode
Posts: 25
Joined: Sat Aug 12, 2006 2:34 am
PostPosted: Sat May 19, 2007 1:48 pm
Thanks John,

Worked a treat,

Best Regards

Roy

Return to CC Calendar (FM7/8)

Who is online

Users browsing this forum: No registered users and 2 guests

cron
(855) SEEDCODE
support@seedcode.com
Follow us: