Method Community

 

How to edit a field in a table?

Last post 09-18-2012 12:48 PM by Anonymous. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 09-16-2012 10:02 AM

    How to edit a field in a table?

    I have copied the QuickBooks Invoice screen to customize it.  The Quantity field in the Invoice Line Item Table/Grid is showing with 2 decimal places, but client wants to see whole numbers only.  I've gone to the Tables/Fields section for the InvoiceLineItem and clicked on Edit fields, but it won't let me edit that field.  What can I do to change that field to show as a whole number?


    Thanks!

    Karen Dellaripa


  • 09-16-2012 10:10 AM In reply to

    Re: How to edit a field in a table?

    Also, there is an "Update" button below the rows that needs to be clicked for the Qty times cost calculation to happen, but I can't find the code for this anywhere on the invoice screen to modify it.  What am I missing?

    Thanks!

  • 09-16-2012 9:07 PM In reply to

    Re: How to edit a field in a table?

    Regardless of the raw data entered/saved, I think you can override the display of the Qty number using the SQL Round function to simply drop the decimals off, leaving the whole number.

    That may be a bit confusing, though, should your customer enter a 2.5 for Qty, refresh the grid, and see a 2 in the field b/c of the rounding.

    Blake C
  • 09-16-2012 9:13 PM In reply to

    Re: How to edit a field in a table?

    It's been a while since I've looked at the stock Method screen grids, but the Qty field in the grid likely has custom actions added to its LoseFocus event that does the Qty X Price = TotalPrice calculation. 

    Also, (triggered on postback) each grid has a before/after Edit and before/after Add function where you can add custom actions.

    Blake C
  • 09-18-2012 12:48 PM In reply to

    Re: How to edit a field in a table?

    Answer

    Hi Karen,

    kdellaripa:
    I've gone to the Tables/Fields section for the InvoiceLineItem and clicked on Edit fields, but it won't let me edit that field.

    Once a field is created there is no way to edit it, you're only allowed to delete it.

    kdellaripa:
    What can I do to change that field to show as a whole number?

    You'll need to:

    1. Make a copy of the QuickBooks_Invoice screen and edit the grid for InvoiceLineItems.  
    2. On step 2 you'll see a list of all the columns for this grid, click the actions link on the Quantity column.
    3. Under the event dropdown you'll want to select Lose Focus.
    4. You'll want to add 2 actions here:
      - Basic Math Calculation and the value you'll want is Value From Screen: InvoiceLineItems:Quantity.  Add 0 to this and make sure you pick the rounding options that suit your needs.
      - Enter Value Into Field On Screen and you'll want to update the field: InvoiceLineItems:Quantity with the action result from the step above this.
    5. Click Save & Close Click Finish.

    These actions will round the quantity field on the InvoiceLineItems grid everytime the field loses focus.  There is no way to limit the data entry into this field since it's a decimal in the database so we're just changing the value after the user enters it.  You may want to put a note somewhere on this page telling customers the quantity field will only accept whole numbers and will round up any decimal places.  

    Please let me know if you have any questions on this.

    ~C

Page 1 of 1 (5 items)