Method Community

 

Changing a field type to a dropdown box

Last post 11-26-2012 10:44 AM by MikeB. 8 replies.
Page 1 of 1 (9 items)
Sort Posts: Previous Next
  • 11-22-2012 8:33 AM

    Changing a field type to a dropdown box

    I'd like the State/Prov. fields in the New/Edit Customers and New/Edit Leads screens to be dropdown boxes limited to Canadian provinces as fields. I realize that the way QuickBooks handles addresses is a bit strange (line-by-line instead of individual fields for province and postal code), but hopefully this should be relatively easy to do using the BillAddressState field.

    I assume I just add a dropdown, link it to the BillAddressState field in the Customer (and later, the Lead) table and then use a filter built from a selection list that contains provinces in order to limit the inputs to valie province entries.

    Should I also need to delete the existing BillAddressState text boxes? Would there be a problem if I just hid it and there ended up being 2 fields on the screen linking to the same BillAddressState field in the Customers table?

    Please confirm.

    Thanks

  • 11-22-2012 9:58 AM In reply to

    Re: Changing a field type to a dropdown box

    Hi Mike,

    You are correct for the most part.  

    There are a few things you need to consider when going this route.  The first and most important is that the BillAddressState needs to stay on the screen.  It can be hidden, but this field is linked to QB and your dropdown won't be. That new dropdown box will not exist in QB.  You should set the Provice dropdwon to update the BillAddressState field, so that when Method saves, your Province dropdown value (which was passed to the BillAddressState field) is passed to QB in the appropriate field.

    Another point to consider is that if a change is made in QB, that change won't be reflected in the dropdown box in Method.  Quickbooks will have no knowledge of this new field, and as such won't update it.  There is no way around this.  Also, it would probably be best to use abbreviated province names.

    As far as design, consider making a new table with the abbreviated province names, and linking that table to a new field in the customer table.

    I hope this all makes sense.


     - Adam


    Adam Lyons
    Manager of Support
    Method Integration
    a.lyons@method.me
  • 11-22-2012 10:20 AM In reply to

    Re: Changing a field type to a dropdown box

    But wait - aren't the screens and fields just "windows" to populating the Customer table? In other words, it's the values in the tables that are synced, regardless how they are populated.

    If a dropdown is linked to the BillAddressState field in the Customer table, won't it just show the entry for that customer that exists in the Customer table? If it's changed in QB, then synced in Method, isn't it the table that is synced?

  • 11-22-2012 2:39 PM In reply to

    Re: Changing a field type to a dropdown box

    MIke,

    Yes, its the table that is synced.  

    I think where you might be confused is that linking the BillAddressState field to your new Province dropdown will only allow you to select values from that field.  So if you started off with no customers (so no values in the BillAddressState field), that dropdown would be blank.  The Selection list in a dropdown only filters the values in the dropdown, it does not populate it.

    Also if you don't update the BillAddressState field on the screen with the value from the dropdown, when you hit save the field will update again with the blank value in the hidden BillAddressState.  If the value changes in QB, the only field in Method that will change is the associated BillAddressState in Method.  

    - Adam

    Adam Lyons
    Manager of Support
    Method Integration
    a.lyons@method.me
  • 11-23-2012 9:49 AM In reply to

    Re: Changing a field type to a dropdown box

    I think I'm more confuse now:

    • If I edit the existing Prov text box, the title of the first screen is "Textbox Properties for field EmployeeAddressState"
    • If I create a new dropdown, Step 4 of 6: Dropdown Object Choices allows me to link it to the Customer table.
    If I added the new dropdown linked to the Customer table and removed the existing text box on the screen wouldn't the data in the Customer table be populated by the entries in the dropdown, going forward? I have lots of customers already so many of the provinces will be available (but I guess, not all of them).
    Also, regarding your statement: "Also if you don't update the BillAddressState field on the screen with the value from the dropdown, when you hit save the field will update again with the blank value in the hidden BillAddressState.  If the value changes in QB, the only field in Method that will change is the associated BillAddressState in Method."

    I'm not sure what you mean.

    All I am looking for are simple data controls for entering a province. It should be easy to replace/convert an existing text box with a dropdown list, shouldn't it?


  • 11-23-2012 9:54 AM In reply to

    Re: Changing a field type to a dropdown box

    Answer

    @Mike

    The bottom line is that we cannot switch the data type for existing QuickBooks fields. Method can't and no other developer can either. If Intuit dictates that a field is text, it must be sent and received by the SDK in the same format. You can choose to populate that text value however you want (enter it in, fill it in using a value from a dropdown, etc.) but it must go back to QB in a text format just like QuickBooks.

  • 11-26-2012 9:43 AM In reply to

    Re: Changing a field type to a dropdown box

    "You can choose to populate that text value however you want (enter it in, fill it in using a value from a dropdown, etc.) but it must go back to QB in a text format just like QuickBooks." I believe this is partly what I was saying.

    I don't want to change the data type. Currently, the province field on the Edit Customer screen is a text box. I'd like it to be a drop-down instead, pre-populated with all the provinces and linked to the Customer table so that it populates entries. I assumed that if this was done, the associated field in the Customer table would still have text values - that wouldn't change. I just want more controlled data entry.

    I just wanted to double-check that I wouldn't mess anything up by adding a drop-down field in the Customer screen to replace the current text box field. I assume that regardless how the data makes its way into the customer table (dropdown with text choices, or a text box) as long as its text for that state/Prov field, it would be fine.

  • 11-26-2012 10:35 AM In reply to

    Re: Changing a field type to a dropdown box

    Mike,

    What I think you might be missing here is that when even when you link the dropdown to the field, you are linking a dropdown data type to a text data type, and as such they don't match.  There is a difference between a dropdown text value and a regular text value.  To see for yourself, you can make a simple table with two text fields, add a dropdown to the default screen, link it to a field and try to create a new entry.  You will see that the linked field won't update with the value in the dropdown.

    The best way to achieve what you want is to set the BillAddressState field to the value in your dropdown on your screen.  Tthat way the table is being updated text field to text field.


    - Adam

    Adam Lyons
    Manager of Support
    Method Integration
    a.lyons@method.me
  • 11-26-2012 10:44 AM In reply to

    Re: Changing a field type to a dropdown box

    OK, thanks.

    I thought that there were "field types" and "data types", where different field types (eg. dropdowns and text boxes) could populate a data table with the same "data type". (eg. text) if one replaced the other.

    I guess I was mistaken.

Page 1 of 1 (9 items)