Method Community

 

Linked Field, Linked DropDown in a Grid on a screen

Last post 02-10-2015 2:15 PM by Method_Justin. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 02-10-2015 12:20 PM

    Linked Field, Linked DropDown in a Grid on a screen

    Hi,

    Here is my table layout:

    (a) In my own table "ProductInfo", there are two fields "ProductUniqueID" (an unique field) and "ProductName"

    (b) In "PurchaseOrderLine" table, a Linked field to ProductInfo.RecordID is inserted as a dropdown, and named as "AssociatedProduct".

    (c) In "PurchaseOrderLine" table, a linked field to ProductInfo.ProductName is inserted via "AssociatedProduct". This linked field is named as "AssociatedProductName"

    Then in "Purchase Order" screen, I modify "ProductOrderLine" grid to add one column "AssociatedProductName".

    I have two questions while working with "PurchaseOrderLine" grid 

    (1) It seems that "AssociatedProductName" on the screen is "readonly", that is, I can not input anything in this column. Is it because this is a linked field, so it just displays information, but not allow editing? What if I need to edit this field, and update back to "ProductInfo" table, how should I do it? I was thinking if I need to do like:

    (i) add a plain text field to accept "productname"

    (ii) create a new row in "ProductInfo" with this input "productname"

    (iii) get the RecordID from (ii) and set this value to "AssociateProduct"

    Is it the right way? or any easier way to do?

    (2) In this "PurchaseOrderLine" grid, there is an "Item" column, which is a dropdown. However, It just allows users to select any items exists in the database. Is there way that I can add a "add new..." item in this dropdown, then trigger actions to open "add item" popup screen? It seems that I can do this in a dropdown out of a grid, but not in a grid.

    Thanks.

    Alex

    Chief Architect
    Yi Systems, Inc.
    alexhuang@yisystems.com
    www.yisystems.com blogs.yisystems.com
    Software.Web.Cloud.IT
  • 02-10-2015 2:15 PM In reply to

    Re: Linked Field, Linked DropDown in a Grid on a screen

    Answer

    Hi Alex,

    Linked Fields are dependent on the dropdown they are linked through, so depending on what you've selected in the dropdown they'll show the data associated with that record. You should be able to update the table using actions like you described, and then refresh the grid to display the updated value.

    To add a new item directly from a dropdown in a line item grid, take a look at the InvoiceLineItem grid on our stock Invoices screen. You'll have to add the actions to the Button Click event of the grid column.

    Hope this helps.

    - Justin

    Justin Henderiks
    Technical Sales Specialist
    Method Integration Inc.
    Toll Free: 1.888.925.6238
    Local and overseas: 416.847.0400
    Fax: 416.640.6027
    E-mail: j.henderiks@method.me
Page 1 of 1 (2 items)