Normal Topic Parent - child/relational linking/matching field (Read 741 times)
lksseven
Full Member
***
Offline



Posts: 416
Location: Southwest
Joined: Jan 26th, 2009
Parent - child/relational linking/matching field
Feb 4th, 2009 at 5:28pm
Print Post Print Post  
On an Order Master form with a LineItem subform:   would the linking/matching field be the OrderNum (so that the line items for that order are linked with that order #)?

      (it's such an elementary question, but <shrug>.... 

My clients all have custom pricing - when an order is created, the ClientID is entered (and some other stuff) on the OrderForm and then an ItemNum is entered in the LineItem subform.  On exit from the ItemNum field, programming creates a new value (ClientID+ItemNum) in a hidden field (ItemCustPricingNum) and then goes to Pricing database to look for a stored corresponding ItemCustPricingNum in the Pricing records for this ClientID.  If it finds a match, then programming takes the Pricing record ItemCustPricingNum and plugs it into the LineItem Price field.   If there is no matching record, the the Price field is blank and a price can be input by the person creating the order.  I'm doing it in QA right now, and must be able to do accomplish the same thing in Sesame.

What happens currently is that if there is not already a custom price for that client for that product in the Pricing database, then the operator is supposed to make a note of that fact (new product for the client and no Pricing record yet), and then later create a Pricing record for that client for that ItemNum.  Of course, often times that followup task doesn't get done and the new Pricing record doesn't get created.   
            My thinking was that I would make programming so that on exit of the Price field of the LineItem subform, if the Price if left empty (meaning that the input operator needs to consult with someone else (senior sales rep, mgr, etc), after order entry, as to an appropriate price, then nothing happens in the Pricing database - but if on exit of the Price field the Price field is not empty, then a boolean decision takes place via programming:  1) if there is a matching ItemCustPricingNum record in Pricing, then the value in Order!LineItem!Price is compared with the value in Pricing!Price - if the value is the same, then no action; if the value is different then Pricing!Price is updated with value from Order!LineItem!Price ... and 2) if there is not a matching ItemCustPricingNum in Pricing, then programming will create a Pricing record for this client for this Item and populate it with the appropriate values (that way a customer's pricing is kept up-to-date on the fly, with only one instance of data entry).
             Is that doable?   Whew!
  

Larry
Back to top
IP Logged
 
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re: Parent - child/relational linking/matching fie
Reply #1 - Feb 5th, 2009 at 10:09pm
Print Post Print Post  
lksseven wrote on Feb 4th, 2009 at 5:28pm:
On an Order Master form with a LineItem subform:   would the linking/matching field be the OrderNum (so that the line items for that order are linked with that order #)?


Probably. But it is also probable that you may want a naturally linked subform instead.

Quote:
Is that doable?   Whew!


I'm not sure, but it is very likely.
  

Mark Lasersohn&&Programmer&&Lantica Software, LLC
Back to top
IP Logged
 
lksseven
Full Member
***
Offline



Posts: 416
Location: Southwest
Joined: Jan 26th, 2009
Re: Parent - child/relational linking/matching fie
Reply #2 - Feb 5th, 2009 at 10:35pm
Print Post Print Post  
Mark,

If I use a natural link LineItem subform in my Purch database (for example), my understanding is that my Order database and Pricing database cannot then talk to the  Purch!LineItem!Cost field ... is that correct?

My dream is to build my new operating platform so that data is changed once and seen everywhere.  How best to go about that?
  

Larry
Back to top
IP Logged
 
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re: Parent - child/relational linking/matching fie
Reply #3 - Feb 6th, 2009 at 12:05am
Print Post Print Post  
Well, I can't say for sure without a much more thorough understanding of your arrangement, but there is nothing about natural vs. relational linking that by itself changes which elements can address each other. All it determines is by which means subform/subrecords get linked to their parents.
  

Mark Lasersohn&&Programmer&&Lantica Software, LLC
Back to top
IP Logged
 
lksseven
Full Member
***
Offline



Posts: 416
Location: Southwest
Joined: Jan 26th, 2009
Re: Parent - child/relational linking/matching fie
Reply #4 - Feb 6th, 2009 at 6:04am
Print Post Print Post  
Mark,

We build Purchase Orders daily, and order items from our vendors daily (we sell printer ctgs and paper to businesses, so the products are repeatedly bought and sold daily and weekly).    Costs can change daily or weekly, and with some of our margins being as low as 2 or 3%, it's important that our sales reps have exact cost information so we can adjust pricing daily or weekly.   So, each night, the Purch!ItemCost  values from that day are automatically posted to the Inventory file's LastCost field.

Purch pulls the ItemCost from the Inventory database!LastCost field.  The ItemCost is confirmed with the vendor when the PO is verbally placed.  If the cost has changed from the last time, then that new cost is entered into the PO.  That night, the PO Line items are posted to the Inventory database LastCost fields, so the new cost is reflected the next day. 

I wrote a bunch more description, but deleted it (I doubt anyone's THAT interested).

Bottomline, I'd like to use one LineItem database as a subform for both the PO and the SalesOrders databases.  It would include cost and price fields, but I would just hide the price field via programming in the PO subform, and gray-dim the Cost field in the Order database subform so it can be viewed but not directly altered via the Orderscreen.   

So we could enter a new cost in a real-time PO, and have that new cost instantly hit the Inventory!ItemCost field, and thus be available instantly when a Sales Order is placed 30 seconds after the PO Item is confirmed, or when a new price record is created in the Pricing database  (instead of with QA, where the updated cost doesn't show up until the next day, after batch posting is done at night via macro posting routines).

By the same token, in Orders, when I enter an Item number in the LineItem subform, it should pull that specific client price for that item (said price might be unique to that client) into the price field of the line item.  It should also pull in the ItemCost from the Inventory cost field.  If the Item Cost is realtime updated, then I might see that the standing Price from the Pricing database is now too low.  I'd like to be able to enter a new price on the fly into the Price field, and upon saving that line item, have the new Price be updated into (via programming) the Client's Pricing record for that Item. 

So, the goal is: 
A) enter costs in the PO LineItem subform during a PO transaction and have everyone see the new cost instantly from the Inventory, Purch, Pricing, and SalesOrder databases.
B) enter a new price in the SalesOrder LineItem subform during an Order entry and have everyone see the new price instantly from the Orders or Pricing databases.

... I thought I had read (and observed in my initial playing around with designing some forms) that if a natural link line item database was used for subform for a PO, then that subform couldn't be used for the Orders database, or any other database.
  

Larry
Back to top
IP Logged