Error Message with Delegate

Archived from the Xataface Users forum.

tnorbut13 — Tue Aug 11, 2009 12:08 pm

I’m getting the following error message with a delegate class I have put in. Please help.

Fatal error: Class ‘tables_PartVendorPricing’ not found in /var/www/xataface/Dataface/Table.php on line 1049

Delegate Class:

valueChanged('Vendor\_ID') ){ $vendorid = df\_get\_record('Vendor', array('Vendor\_ID'=>'='.$record->val('Vendor\_ID'))); $record->setValue('PartVendorPricing', $vendorid->val('PartVendorPricing')); } } ?> Conf.ini: ; File: conf.ini ; Description: ; ------------ ; This file contains configuration information for the dataface framework. ; Configuration options include such things as database connection information ; tables to be displayed in the menu, and behavioral and display characteristics ; of the dataface application (like whether to display the menu). ; ;debug=1 default\_table=RFQ [\_database] host = "localhost" user = "xxxx" password = "xxxx" name = "xxxx" [\_auth] users\_table = Users username\_column = Username password\_column = Password [\_tables] dashboard = "Dashboard" Customer = "Customer" Sales = "Sales" RFQ = "RFQ" Purchasing = "Purchasing" Pricing = "Pricing" Part = "Part" Vendor = "Vendor" PartVendorPricing = "PartPricing" --- **shannah** — Tue Aug 11, 2009 12:39 pm I think your PHP code is being messed up by PHPBB. Check the "Disable HTML in this post" checkbox and post again. In any case your problem is that your delegate class is named incorrectly (probably has a typo). Your delegate class should contain a class named: tables\_[tablename] where [tablename] is the name of your table. --- **tnorbut13** — Tue Aug 11, 2009 12:41 pm Delegate Class: valueChanged('Vendor\_ID') ){ $vendorid = df\_get\_record('Vendor', array('Vendor\_ID'=>'='.$record->val('Vendor\_ID'))); $record->setValue('PartVendorPricing', $vendorid->val('PartVendorPricing')); } } ?> --- **shannah** — Tue Aug 11, 2009 12:46 pm OK.. You need to place this method inside a class as follows: Code: [Select all](#) : `valueChanged('Vendor_ID') ){             $vendorid = df_get_record('Vendor',                   array('Vendor_ID'=>'='.$record->val('Vendor_ID'))             );             $record->setValue('PartVendorPricing', $vendorid->val('PartVendorPricing'));         }     } }` --- **tnorbut13** — Tue Aug 11, 2009 12:51 pm Ok. Getting closer. Now I get Fatal error: Call to a member function val() on a non-object in /var/www/rfqtest/tables/PartVendorPricing/PartVendorPricing.php on line 6 Does this mean that it can't find the field value that it needs? --- **shannah** — Tue Aug 11, 2009 12:59 pm It looks like the call to df\_get\_record() didn't actually find any matching records. So when you tried to use the found record, it was just null: i.e. $venderid is null - there was no record found in the Vendor table such that the Vendor\_ID was $record->val('Vendor\_ID') --- **tnorbut13** — Tue Aug 11, 2009 1:00 pm Ok. But there are records in the Vendor table. Isn't that what I'm doing here? I'm trying to pull the Vendor ID from the Vendor table and insert it in the PartVendorPricing Vendor ID when I save. --- **shannah** — Tue Aug 11, 2009 1:43 pm You need to do a little debugging. What I can tell you is that there are no records in the Vendors table matching your query. Good debugging technique might be: print\_r($record->vals()); exit; To see what is in the record. Perhaps the Vendor\_ID field doesn't contain what you think it does. -Steve --- **tnorbut13** — Thu Aug 13, 2009 12:21 pm Ok. Debugging showed that it was trying to put the name in the field instead of the id. However, I still can't get this to work. Have tried removing the delegate class entirely and just having the ability to put 'Vendor\_ID = x' manually to test. Still will not store the vendor id in the join table. --- **shannah** — Thu Aug 13, 2009 12:33 pm Can you describe your steps when you are trying to insert the record? Are you doing this via add related record, or via new record? --- **tnorbut13** — Thu Aug 13, 2009 12:38 pm Trying to add a new record. What I need to happen is this: I start an RFQ. Select parts to go with RFQ. Select vendors that go with each part. Vendors supply back pricing information. I can do all of the above except the vendor association. Don't know if it's a table structure issue or my own personal mental retardation... Anyway, on the add new record I've been able to get the Vendor field to display the Name instead of the ID via code you've left for me before: [http://xataface.com/forum/viewtopic.php?p=23562#23562](http://xataface.com/forum/viewtopic.php?p=23562#23562) Now I just need the insert of the Vendor ID into the join table to get this working. --- **tnorbut13** — Fri Aug 14, 2009 8:38 am Any thoughts on this. --- **shannah** — Fri Aug 14, 2009 10:20 am > I start an RFQ. Select parts to go with RFQ. Select vendors that go with each part. Vendors supply back pricing information. Please translate this into something like: 1. I go to the RFQ table. 2. Click "New Record" 3. In the X field (using the Y widget) I check Z parts (which come from a valuelist ...) 4. etc... I'm trying to get a clear picture of why this is happening, and it's still a little vague (the process) to me. --- **tnorbut13** — Fri Aug 14, 2009 11:44 am 1 Start new RFQ record on the RFQ table by clicking new record 2 Input information for RFQ regarding due dates. Click Save (this all works so I won't elaborate) 3 'Current Record: Untitled RFQ Record' comes up with the related tables for RFQ. I select the 'Part' table. 4 On Part table, select 'add new part record' 5 On the Part Number field, using the yui\_autocomplete widget, I input the part number which come from a value list (\_\_sql\_\_ = "Select XXXX\_Part\_Number from XXXX\_Part\_Info"). Input quantities requested into the quantities fields. (see image [http://www.lutzsales.com/images/rfq/parttable.jpg](http://www.lutzsales.com/images/rfq/parttable.jpg)) Click Save 6 At this point, the program returns to the RFQ related tab for part (see image (see image http:///www.lutzsales.com/images/rfq/parttable2.jpg) I click the 'Part Request Number' to go to the Part Request table. 7 On the Part Request Table, I select the VendorPricing tab (connected to the PartVendorPricing table). I select add New VendorPricing record. 8 I Choose a Vendor from the Vendor ID field (using a Select Widget) that is populated with vendor Name from a valuelist and a delegate file. I click save. (see image [http://www.lutzsales.com/images/rfq/vendorselect.jpg](http://www.lutzsales.com/images/rfq/vendorselect.jpg)) Also see code for field, valuelist and delegate in next post. 9 Application goes back to PartVendorPricing table without any Vendor\_ID input. (see image at [http://www.lutzsales.com/images/rfq/vendorresult.jpg](http://www.lutzsales.com/images/rfq/vendorresult.jpg)). The application is trying to pass the Vendor name into the Vendor ID field, which won't work. I don't want to add the Vendor name in as another field on the PartVendorPricing join table either as this is a normalized environment. --- **tnorbut13** — Fri Aug 14, 2009 11:47 am Code for PartVendorPricing table widgets, etc. Fields: [Vendor\_ID] widget:type = select vocabulary = Vendors Valuelists: [Vendors] \_\_sql\_\_ = "select Vendor\_ID, Vendor\_Name from Vendor ORDER BY Vendor\_Name" PartVendorPricing Delegate class: valueChanged('Vendor\_ID') ){ // $vendorid = df\_get\_record('Vendor', array('Vendor\_ID'=>'='.$record->val('Vendor\_ID'))); // $record->setValue('PartVendorPricing', $vendorid->val('PartVendorPricing')); // } // } function Vendor\_ID\_\_pushValue(&$record, &$element){ // Get the employer name as entered in the text field $vendorName = $element->getValue(); // Get the associated employer id $vendorRecord = df\_get\_record('Vendor', array('Vendor\_Name'=>$vendorName)); // If employer doesn't exist yet, we create a new one if ( !$vendorRecord){ $vendorRecord = new Dataface\_Record('Vendor', array()); $vendorRecord->setValue('Vendor\_Name', $employerName); $vendorRecord->save(); } // Return the employer ID for this employer return $vendorRecord->val('Vendor\_ID'); } function Vendor\_ID\_\_pullValue(&$record, &$element){ // we'll be a bit tricky here and use valuelists on this // field. When using valuelists, the display() method will // display the display value of the field instead of the // id. Since we want to return the display value, // all we need to do is... return $record->display('Vendor\_ID'); } } ?> --- **tnorbut13** — Thu Aug 13, 2009 12:38 pm Trying to add a new record. What I need to happen is this: I start an RFQ. Select parts to go with RFQ. Select vendors that go with each part. Vendors supply back pricing information. I can do all of the above except the vendor association. Don't know if it's a table structure issue or my own personal mental retardation... Anyway, on the add new record I've been able to get the Vendor field to display the Name instead of the ID via code you've left for me before: [http://xataface.com/forum/viewtopic.php?p=23562#23562](http://xataface.com/forum/viewtopic.php?p=23562#23562) Now I just need the insert of the Vendor ID into the join table to get this working. --- **tnorbut13** — Fri Aug 14, 2009 8:38 am Any thoughts on this. --- **shannah** — Fri Aug 14, 2009 10:20 am > I start an RFQ. Select parts to go with RFQ. Select vendors that go with each part. Vendors supply back pricing information. Please translate this into something like: 1. I go to the RFQ table. 2. Click "New Record" 3. In the X field (using the Y widget) I check Z parts (which come from a valuelist ...) 4. etc... I'm trying to get a clear picture of why this is happening, and it's still a little vague (the process) to me. --- **tnorbut13** — Fri Aug 14, 2009 11:44 am 1 Start new RFQ record on the RFQ table by clicking new record 2 Input information for RFQ regarding due dates. Click Save (this all works so I won't elaborate) 3 'Current Record: Untitled RFQ Record' comes up with the related tables for RFQ. I select the 'Part' table. 4 On Part table, select 'add new part record' 5 On the Part Number field, using the yui\_autocomplete widget, I input the part number which come from a value list (\_\_sql\_\_ = "Select XXXX\_Part\_Number from XXXX\_Part\_Info"). Input quantities requested into the quantities fields. (see image [http://www.lutzsales.com/images/rfq/parttable.jpg](http://www.lutzsales.com/images/rfq/parttable.jpg)) Click Save 6 At this point, the program returns to the RFQ related tab for part (see image (see image http:///www.lutzsales.com/images/rfq/parttable2.jpg) I click the 'Part Request Number' to go to the Part Request table. 7 On the Part Request Table, I select the VendorPricing tab (connected to the PartVendorPricing table). I select add New VendorPricing record. 8 I Choose a Vendor from the Vendor ID field (using a Select Widget) that is populated with vendor Name from a valuelist and a delegate file. I click save. (see image [http://www.lutzsales.com/images/rfq/vendorselect.jpg](http://www.lutzsales.com/images/rfq/vendorselect.jpg)) Also see code for field, valuelist and delegate in next post. 9 Application goes back to PartVendorPricing table without any Vendor\_ID input. (see image at [http://www.lutzsales.com/images/rfq/vendorresult.jpg](http://www.lutzsales.com/images/rfq/vendorresult.jpg)). The application is trying to pass the Vendor name into the Vendor ID field, which won't work. I don't want to add the Vendor name in as another field on the PartVendorPricing join table either as this is a normalized environment. --- **tnorbut13** — Fri Aug 14, 2009 11:47 am Code for PartVendorPricing table widgets, etc. Fields: [Vendor\_ID] widget:type = select vocabulary = Vendors Valuelists: [Vendors] \_\_sql\_\_ = "select Vendor\_ID, Vendor\_Name from Vendor ORDER BY Vendor\_Name" PartVendorPricing Delegate class: valueChanged('Vendor\_ID') ){ // $vendorid = df\_get\_record('Vendor', array('Vendor\_ID'=>'='.$record->val('Vendor\_ID'))); // $record->setValue('PartVendorPricing', $vendorid->val('PartVendorPricing')); // } // } function Vendor\_ID\_\_pushValue(&$record, &$element){ // Get the employer name as entered in the text field $vendorName = $element->getValue(); // Get the associated employer id $vendorRecord = df\_get\_record('Vendor', array('Vendor\_Name'=>$vendorName)); // If employer doesn't exist yet, we create a new one if ( !$vendorRecord){ $vendorRecord = new Dataface\_Record('Vendor', array()); $vendorRecord->setValue('Vendor\_Name', $employerName); $vendorRecord->save(); } // Return the employer ID for this employer return $vendorRecord->val('Vendor\_ID'); } function Vendor\_ID\_\_pullValue(&$record, &$element){ // we'll be a bit tricky here and use valuelists on this // field. When using valuelists, the display() method will // display the display value of the field instead of the // id. Since we want to return the display value, // all we need to do is... return $record->display('Vendor\_ID'); } } ?> --- **tnorbut13** — Mon Aug 17, 2009 7:08 am Bump --- **shannah** — Wed Aug 19, 2009 7:34 am Looks like there is a problem in your Vendor\_ID\_\_pushValue() method: Code: [Select all](#) : `$vendorName = $element->getValue(); // Get the associated employer id $vendorRecord = df_get_record('Vendor', array('Vendor_Name'=>$vendorName));` $element->getValue() will return the ID (possibly an array of ids) of a vender not a name. --- **tnorbut13** — Wed Aug 19, 2009 7:38 am Ok. Based on everything I've posted, though, how can I accomplish the goal of populating Name in the select but transferring ID to the record? --- **shannah** — Wed Aug 19, 2009 8:51 am The problem was that your select list was being populated with (id,name) pairs and would store the id. Then in your pushValue() function you were expecting the name - but it was giving you the id. Similarly your pullValue function was giving you the name but xataface expected an id. I'm not sure why you can't just get rid of the pushValue/pullValue methods and use the field as defined with the valuelist. By default the select list shows the names but stores the ids. --- **tnorbut13** — Wed Aug 19, 2009 9:11 am Steve, I really appreciate your time on this. I know it must be a little frustrating dealing with issues like this, but it shows how much you care about this product. Ok. I eleminated all of the delegate classes from partvendorpricing and just put in a fields.ini and a valuelist.ini but still no dice. I get no select field to choose from on the record. Here is the Fields.ini: [VendorID] widget:type = select vocabulary = Vendors Here is the valuelist.ini: [Vendors] \_\_sql\_\_ = "select Vendor\_ID, Vendor\_Name from Vendor ORDER BY Vendor\_Name" Looks like it should work, but it doesn't. --- **tnorbut13** — Thu Aug 20, 2009 1:58 pm Ok. I think I have a lead on why this might be happening, but I still don't know a work around. To get to my PartVendorPricing record from my Part screen, I have the following relationship: [VendorPricing] PartVendorPricing.Part\_Request\_Number="$Part\_Request\_Number" Pricing.Pricing\_ID=PartVendorPricing.Pricing\_ID However, this is where I don't get a select option for Vendor as I have the field definition in another table called PartVendorPricing. The relationship for PartVendorPricing is: [Pricing] Pricing.Pricing\_ID = PartVendorPricing.Pricing\_ID PartVendorPricing.Vendor\_ID = "$Vendor\_ID" This is where I can't get the work around figured out. I need to relate the pricing record to both the Vendor and to the Part. What am I missing? For further consideration, I have put the valuelist and field ini in the base of the application. When I do this, the select does work on the VendorPricing screen (as it should). However, when the record is saved, it saves the name of the vendor, not the ID. --- **tnorbut13** — Fri Aug 21, 2009 12:35 pm I'm beginning to get an idea of what to do now, but still need some help with a SQL query. It's pretty clear that I'm going to have to do a SQL statement with a join to get all 3 tables set up together on the same tab for use. Here's what I have for a statement (don't laugh, I know it isn't good): [VendorPricing] \_\_sql\_\_ = "SELECT Vendor.Vendor\_ID, Vendor.Vendor\_Name, pvp.\*, p.\* FROM PartVendorPricing pvp left join Pricing p on pvp.Pricing\_ID = p.Pricing\_ID AND pvp.Vendor\_ID = Vendor.'$Vendor\_ID' AND pvp.Part\_Request\_Number = '$Part\_Request\_Number'" And I get this error: Fatal error: [pear\_error: message="Parse error: Unexpected clause on line 1 SELECT Vendor.Vendor\_ID, Vendor.Vendor\_Name, pvp.\*, p.\* FROM PartVendorPricing pvp left join Pricing p on pvp.Pricing\_ID = p.Pricing\_ID AND pvp.Vendor\_ID = Vendor.'$Vendor\_ID' AND pvp.Part\_Request\_Number = '$Part\_Request\_Number' ^ found: "$Vendor\_ID"" code=0 mode=return level=notice prefix="" info=""] On line 228 of file /var/www/xataface/Dataface/Relationship.php in function printStackTrace() On line 102 of file /var/www/xataface/Dataface/Relationship.php in function \_init(array(SELECT Vendor.Vendor\_ID, Vendor.Vendor\_Name, pvp.\*, p.\* FROM PartVendorPricing pvp left join P) On line 1486 of file /var/www/xataface/Dataface/Table.php in function Dataface\_Relationship(Part,VendorPricing,array(SELECT Vendor.Vendor\_ID, Vendor.Vendor\_Name, pvp.\*, p.\* FROM PartVendorPricing pvp left in /var/www/xataface/Dataface/Relationship.php on line 228 Need to get from point A to point B here. How can I adjust the SQL statement to JOIN the 3 Tables together? --- **shannah** — Tue Aug 25, 2009 1:55 pm I don't have the full picture but I'm getting the feeling that this database is not normalized. You are trying to create a relationship between which two tables? It looks like it is going from Part to PartVendorPricing. Is this correct? If so, just leave everyone else out of the mix. And you don't care about Vendor\_ID at all for this relationship because you'll want pricing for all vendors for this part. What is the primary key of the Part table? What is the primary key of the PartVendorPricing table? What is the foreign key of the PartVendorPricing table on which you are joining it to the Part table? The answer to these questions will determine exactly how you need to define the relationship. All other things should not be part of the relationship. They can be handled elsewhere by either adding calculated fields to tables or using valuelists cleverly. --- **tnorbut13** — Tue Aug 25, 2009 1:57 pm Primary Key for Part is Part\_Request\_Number Primary Key for PartVendorPricing is made up of 3 foreign keys (Pricing\_ID, Vendor\_ID, Part\_Request\_Number) No Foreign Key --- **tnorbut13** — Tue Aug 25, 2009 2:00 pm PartVendorPricing SQL CREATE TABLE IF NOT EXISTS `PartVendorPricing` ( `Part\_Request\_Number` int(11) NOT NULL, `Vendor\_ID` int(11) NOT NULL default '0', `Pricing\_ID` int(11) NOT NULL default '0', PRIMARY KEY (`Part\_Request\_Number`,`Vendor\_ID`,`Pricing\_ID`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1; --- **tnorbut13** — Thu Aug 20, 2009 1:58 pm Ok. I think I have a lead on why this might be happening, but I still don't know a work around. To get to my PartVendorPricing record from my Part screen, I have the following relationship: [VendorPricing] PartVendorPricing.Part\_Request\_Number="$Part\_Request\_Number" Pricing.Pricing\_ID=PartVendorPricing.Pricing\_ID However, this is where I don't get a select option for Vendor as I have the field definition in another table called PartVendorPricing. The relationship for PartVendorPricing is: [Pricing] Pricing.Pricing\_ID = PartVendorPricing.Pricing\_ID PartVendorPricing.Vendor\_ID = "$Vendor\_ID" This is where I can't get the work around figured out. I need to relate the pricing record to both the Vendor and to the Part. What am I missing? For further consideration, I have put the valuelist and field ini in the base of the application. When I do this, the select does work on the VendorPricing screen (as it should). However, when the record is saved, it saves the name of the vendor, not the ID. --- **tnorbut13** — Fri Aug 21, 2009 12:35 pm I'm beginning to get an idea of what to do now, but still need some help with a SQL query. It's pretty clear that I'm going to have to do a SQL statement with a join to get all 3 tables set up together on the same tab for use. Here's what I have for a statement (don't laugh, I know it isn't good): [VendorPricing] \_\_sql\_\_ = "SELECT Vendor.Vendor\_ID, Vendor.Vendor\_Name, pvp.\*, p.\* FROM PartVendorPricing pvp left join Pricing p on pvp.Pricing\_ID = p.Pricing\_ID AND pvp.Vendor\_ID = Vendor.'$Vendor\_ID' AND pvp.Part\_Request\_Number = '$Part\_Request\_Number'" And I get this error: Fatal error: [pear\_error: message="Parse error: Unexpected clause on line 1 SELECT Vendor.Vendor\_ID, Vendor.Vendor\_Name, pvp.\*, p.\* FROM PartVendorPricing pvp left join Pricing p on pvp.Pricing\_ID = p.Pricing\_ID AND pvp.Vendor\_ID = Vendor.'$Vendor\_ID' AND pvp.Part\_Request\_Number = '$Part\_Request\_Number' ^ found: "$Vendor\_ID"" code=0 mode=return level=notice prefix="" info=""] On line 228 of file /var/www/xataface/Dataface/Relationship.php in function printStackTrace() On line 102 of file /var/www/xataface/Dataface/Relationship.php in function \_init(array(SELECT Vendor.Vendor\_ID, Vendor.Vendor\_Name, pvp.\*, p.\* FROM PartVendorPricing pvp left join P) On line 1486 of file /var/www/xataface/Dataface/Table.php in function Dataface\_Relationship(Part,VendorPricing,array(SELECT Vendor.Vendor\_ID, Vendor.Vendor\_Name, pvp.\*, p.\* FROM PartVendorPricing pvp left in /var/www/xataface/Dataface/Relationship.php on line 228 Need to get from point A to point B here. How can I adjust the SQL statement to JOIN the 3 Tables together? --- **shannah** — Tue Aug 25, 2009 1:55 pm I don't have the full picture but I'm getting the feeling that this database is not normalized. You are trying to create a relationship between which two tables? It looks like it is going from Part to PartVendorPricing. Is this correct? If so, just leave everyone else out of the mix. And you don't care about Vendor\_ID at all for this relationship because you'll want pricing for all vendors for this part. What is the primary key of the Part table? What is the primary key of the PartVendorPricing table? What is the foreign key of the PartVendorPricing table on which you are joining it to the Part table? The answer to these questions will determine exactly how you need to define the relationship. All other things should not be part of the relationship. They can be handled elsewhere by either adding calculated fields to tables or using valuelists cleverly. --- **tnorbut13** — Tue Aug 25, 2009 1:57 pm Primary Key for Part is Part\_Request\_Number Primary Key for PartVendorPricing is made up of 3 foreign keys (Pricing\_ID, Vendor\_ID, Part\_Request\_Number) No Foreign Key --- **tnorbut13** — Tue Aug 25, 2009 2:00 pm PartVendorPricing SQL CREATE TABLE IF NOT EXISTS `PartVendorPricing` ( `Part\_Request\_Number` int(11) NOT NULL, `Vendor\_ID` int(11) NOT NULL default '0', `Pricing\_ID` int(11) NOT NULL default '0', PRIMARY KEY (`Part\_Request\_Number`,`Vendor\_ID`,`Pricing\_ID`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1; --- **shannah** — Tue Aug 25, 2009 2:15 pm OK. So it looks like the relationship is actually between the Part table and the Pricing table using the PartVendorPricing table as a join table. So we would have: Code: [Select all](#) : `[VendorPricing] PartVendorPricing.Part_Request_Number="$Part_Request_Number" Pricing.Pricing_ID = PartVendorPricing.Pricing_ID` Then you would set the widget:type of the Vendor\_ID field (in the PartVendorPricing table) to be a select widget using a valuelist of all of the vendors. --- **tnorbut13** — Tue Aug 25, 2009 2:17 pm And this relationship is in the PartVendorPricing, correct? --- **shannah** — Tue Aug 25, 2009 2:23 pm No. If it is going from the Part table to the Pricing table, it would be in the Part table's relationships.ini file. --- **tnorbut13** — Tue Aug 25, 2009 2:24 pm And the Valuelist entries should be in the Part table too, correct? --- **tnorbut13** — Tue Aug 25, 2009 2:27 pm Ok. This gets me almost there....but Now the Part\_Request\_Number is blank. The Vendor select is there (great) but nothing in Part\_Request\_Number, which should be the current record, correct? --- **tnorbut13** — Tue Aug 25, 2009 2:31 pm Never Mind! Had an extra Part\_Request\_Number field in my Pricing table from something I was trying. Removed it and this works now. Thanks Steve! --- **shannah** — Tue Aug 25, 2009 2:47 pm Didn't you say that the Part\_Request\_Number is the primary key of the Part table? Hence it should not be blank in the Part table, and should not even appear on the related record form - should get auto populated. Unless you have some before/after save trigger that is wiping it out. --- **tnorbut13** — Tue Aug 25, 2009 2:31 pm Never Mind! Had an extra Part\_Request\_Number field in my Pricing table from something I was trying. Removed it and this works now. Thanks Steve! --- **shannah** — Tue Aug 25, 2009 2:47 pm Didn't you say that the Part\_Request\_Number is the primary key of the Part table? Hence it should not be blank in the Part table, and should not even appear on the related record form - should get auto populated. Unless you have some before/after save trigger that is wiping it out.