In today’s adventure, I discovered what I thought was a simple change was not so simple.
The system I’m working on has jobs and each job has POs written as part of doing the job. Each PO is delivered to an address which is USUALLY the job address, but not always, so the PO has a single address field that gets populated initially with the job’s address, which is entered into the job screen using component parts (street address, city, state, zip) but is concatenated together into the single job address field.
Originally, each job had 1 address at which it was taking place. So the address or components of the address could be inferred from the job record.
On a particular report which reports foremen’s POs that they ordered on a job on a particular day, the city only appeared on this report, but the city from the job record.
Ok, now fast foward into the future. I have been asked to allow jobs to have multiple addresses.
The address can be chosen on an individual PO.
I implemented this by changing the address text field to a combo box which allows free text entry, but you can choose any of the available job addresses.
Now on the report, the city should reflect the address they chose on the PO.
BUT HERE’S THE PROBLEM:
They may have chosen one of those records, or they might have customized the field completely and entered any random text. There is also a checkbox on the form to replace any entered address with the company doing the job since they may need to have the item delivered to the “shop” and then they take it to the job site.
So, because I forgot all about those implementation details, I asked what city they should see on this report and I was told the one they selected. This means they want me to move the city from the ONE that used to be associated with the job to the ONE now on the PO in the report line.
What are my options?
- Add something into the PO record to indicate whether and which address they chose. Pro: makes it easy as long as they choose one. Cons: changes to the city won’t be picked up (but they aren’t now anyway), and what if they don’t choose one but enter something in manually.
- Try to parse the address field from the PO and isolate the city. Pro: nothing really needs to change except adding a function on the report to attempt the parse and you will always get the “city” saved with the PO assuming you can parse it out. Cons: Parsing addresses is notoriously tricky when you have free text fields. The user can put ANYTHING in there.
- Change the interface to require them to enter component parts of the address into the PO. Pro: makes it easy to isolate and retrieve the intended city. Con: expensive to change the interface and would also require changing 2 other forms for pulling in the address into the invoice processing and inspection orders. users may have a lot more typing / clicking to do to put separate pieces of information into different fields.
All of them have their trade offs. I’ll need to discuss this with my customer and explain the trade offs and see what they choose.