Autofill not working when lookup field is a master field

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
lancealot83
User
Posts: 5

Autofill not working when lookup field is a master field

Post by lancealot83 »

Hello I am using phpmaker version 9.2.0 and I have noticed that the auto fill is not functioning when the lookup field of the autofill is also the key field of a master/detail add page.

I think it is because the look up field is just plain text in that situation....

Example:
Master Record: Service Requests

Request ID | 6
Date Received
(dd/mm/yyyy) | 09/11/2005
Completion Status | COM, Complete
Referral

Date Created
(dd/mm/yyyy) |08/02/2013
Date Modified
(dd/mm/yyyy) | 08/02/2013

Section: Projects
Add Delete Selected Records

The Service Request ID is the basis of the auto fill in the projects table, but when the add button is clicked the service request id which is the FK in the Project table is filled in already and is not editable (which is expected), however the Auto fill fields based on this ID are not being filled in.

Is there anyway to make the auto fill work in this scenario?

Thank You


mobhar
User
Posts: 11790

Post by mobhar »

Since you mention the master/detail, if I am not mistaken, did you want to autofill the key in the Detail section based on the key of the master record?


lancealot83
User
Posts: 5

Post by lancealot83 »

I want to have the other fields in the detail table be autofilled which is based on selecting the servicerequestid.


mobhar
User
Posts: 11790

Post by mobhar »

You can refer to the demo project.

From the "orders" menu, you can see its master/detail relationship to the "orderdetails" table. After you click on "Add order/orderdetails" button, then you can see in the "Detail" section, when you are selecting the "Product ID", the "Unit Price" column will be auto-filled in based on the selected Product ID.


danielc
User
Posts: 1601

Post by danielc »

Autofill does not work if you use foreign key as the the link field since foreign key is not editable. So, it will not trigger to fill your target.

You need to use Row_Inserting server event to get the value from other table to fill your value.


lancealot83
User
Posts: 5

Post by lancealot83 »

Ok thanks, danielc I will try doing it in the Row_Insetring event or the Row_selected event.


Post Reply