This topic is locked

Lookup Wizard and Dependent columns

3/23/2021 4:57:06 PM
PHPRunner General questions
G
Gwx author

PHPRunner 10.5
Scenario:
Quote table - Contains ClentId and EnquiryId (Enquiry id is optional FK to the Enquiry table)

On the Add page for Quote, I have a lookup on the Client table to populate ClientId (using a dropdown list) - all fine

There is also lookup wizard defined for EnquiryId that selects from the Enquiry table using the ClientId as a filter - fine.
The issue is that when there is exactly one Enquiry for a client it populates the value automatically into EnquiryId which is an optional field and so I would like it to be the users choice to select from the list in case they don't want to choose the one that is available. For those clients that do not have any enquiries or have more than one that is the behaviour I get - which is great. I just want the same when there is a single match.
I've tried adding field events to the ClientId to reset the EnquiryId but I guess the sequence of operations isn't quite right and this didn't work.
Any ideas?

admin 3/24/2021

This sounds like a job for the field event but it is hard to tell what exactly is wrong without seeing the actual project.

G
Gwx author 3/26/2021

I have uploaded the project to the demo area here. User demo/demo1234.

Ignore the error on the dtashboard this is because the function didn't upload to the database.

On the left, click Client Management, then Quote. Click Add New:

  1. Selecting Beau Bridges as the client will leave the Enquiry field blank as they have more than one enquiry.
  2. Selecting Bloggs Bogs as the client will cause the Enquiry field to be set to "1" as they only have one enquiry in the system. I would prefer this to remain blank, allowing the user to decide whether to populate it and with which item, even if there is only one to choose from :).

I hope that helps...I've tried a few things, no luck so far...I was hoping someone might have seen this behaviour before and could advise what I've done wrong or how I can modify the behaviour to suit my requirement.

admin 3/26/2021

After you uploaded the project to Demo Account you need to contact support directly with this.

G
Gwx author 3/26/2021

Sadly my support has expired and I cannot extend it at this time, so I was hoping someone out there may have seen this before and could point me in the right direction. I don't need a coded solution, just a starting place. I looked at Field Events, and added some code the the client field to try and "reset" the enquiry" field, but it didn't work and I suspect that the firing sequence of the events may be why...but I am working without enough understanding of how this part of PHPRunner works - is there some additional help available that covers how the events fire and in what sequence please?