Alpha Video Training
Results 1 to 10 of 10

Thread: Can't add new child records because parent grid has no records

  1. #1
    Member
    Real Name
    Andi Hidajat
    Join Date
    May 2007
    Posts
    28

    Default Can't add new child records because parent grid has no records

    I have created 2 tables:

    1. invoice_header.dbf
    2. invoice_detail.dbf

    I have created 3 web components:

    1. wc_invhd.a5wcmp which contains grid with columnar type and updateable

    2. wc_invdetail.a5wcmp which contains grid with tabular type and updateable

    3. wc_invoice.a5wcmp which contains grid-linker that links wc_invhd and

    wc_invdetail. Child component is wc_invdetail.

    I have created invoice.a5w page and inserted component: wc_invoice.a5wcmp

    Then I run Internet Explorer and navigate to the web page: invoice.a5w
    I fill in some data in the header grid ( wc_invhd ) and then I fill in some data

    into the first row of the detail grid (wc_invdetail).

    But after I click the "Submit" button, I get the following error message:

    Error: Can't add new child records because parent grid has no records.

    What have I done wrong ? Please help me.

    Your help is highly appreciated and best regards,

    Andi Hidajat
    Jakarta, Indonesia

  2. #2
    "Certified" Alphaholic mmaisterrena's Avatar
    Real Name
    Mauricio Maisterrena
    Join Date
    Nov 2006
    Location
    Torreon, Mexico
    Posts
    1,435

    Default Re: Can't add new child records because parent grid has no records

    you must save first the information n the parent grid

    if you fill the parent grid and then the child grid then hit save on the child grid, the information on the parent grid will not be saved and thats why you see that error message.

    always make sure that a record on the parent grid is selected.

  3. #3
    Member
    Real Name
    Jack Lim
    Join Date
    Jun 2005
    Posts
    218

    Default Re: Can't add new child records because parent grid has no records

    Hi andi

    Do you find any solutions to update the header and detail records already?

    Many thanks for sharing

    Jack Lim
    Singapore
    Many Thanks.

    Jack Lim

  4. #4
    Member
    Real Name
    Jack Lim
    Join Date
    Jun 2005
    Posts
    218

    Default Re: Can't add new child records because parent grid has no records

    Hi mmaisterrena

    When click the header submit, the page become a new page, all the record enter in the detail are gone.

    What is the best solution u can suggest?

    Many thanks

    Jack Lim
    Many Thanks.

    Jack Lim

  5. #5
    Member
    Real Name
    Andi Hidajat
    Join Date
    May 2007
    Posts
    28

    Default Can't add new child records because parent grid has no records

    Hi JackLim in Singapore,
    I'm glad to receive your message.

    After some days trying by myself, I've got the answer by myself as follow:

    1. create grid component "invoice header view" to show invoice header data
    2. create grid component "invoice detail add" to add data to invoice detail grid
    3. create grid linker "invoice link" to link "invoice header view" and "invoice detail add"
    4. create columnar Invoice header grid and set properties to Add Records only. Set "update settings - target page" to "invoice detail.a5w" page

    "invoice detail.a5w" page contains grid linker "invoice link" which links 2 grid components:
    invoice_header_view and invoice_detail_add.

    So each time, the user has to create the Invoice Header and clicks submit, the computer will then show the newly created invoice header, then click on the row in the "invoice header view" to add data to "invoice detail".

    Hope this helps,
    Andi Hidajat
    Last edited by andi; 07-06-2007 at 12:28 AM.

  6. #6
    Member
    Real Name
    Jack Lim
    Join Date
    Jun 2005
    Posts
    218

    Default Re: Can't add new child records because parent grid has no records

    Hi

    I have tried my self and do some study too.. I think web based this is the only way to do it.

    If u create a Invoice Header Page and After the User click Submit to redirect to the Invoice Detail Page, how to transfer the HDR ID and 2nd Page by using the session.

    Can u show me how u do it? I am appreciate that...
    Many Thanks.

    Jack Lim

  7. #7
    Member
    Real Name
    Andi Hidajat
    Join Date
    May 2007
    Posts
    28

    Default Re: Can't add new child records because parent grid has no records

    Invoice Header id is automatically detected by Alpha5 if we use grid linker and until now I haven't used session variable to transfer the HDR id to the second page (invoice detail).

    Rgds,
    Andi Hidajat

  8. #8
    Member
    Real Name
    Jack Lim
    Join Date
    Jun 2005
    Posts
    218

    Default Re: Can't add new child records because parent grid has no records

    If u dnt mind, can u show me yours how u do it?
    Many Thanks.

    Jack Lim

  9. #9
    Member
    Real Name
    Andi Hidajat
    Join Date
    May 2007
    Posts
    28

    Default Re: Can't add new child records because parent grid has no records

    Sorry for being late to reply. Here is my source program for sales order, hope this helps.

    Rgds,
    Andi Hidajat
    Jakarta, Indonesia

  10. #10
    Member
    Real Name
    Jack Lim
    Join Date
    Jun 2005
    Posts
    218

    Default Re: Can't add new child records because parent grid has no records

    Hi Andi

    When u click the Header Page Submit, it goes to the Detail Page for user enter the record... how to transfer the Hdr ID and the Detail Page?

    Please advice..
    Many Thanks.

    Jack Lim

Similar Threads

  1. Delete Parent, child records also get deleted
    By Dan Blank in forum Web Application Server v7
    Replies: 1
    Last Post: 01-22-2007, 05:55 PM
  2. Show Parent records only that match query on child
    By fordgt40mkii in forum Alpha Five Version 6
    Replies: 5
    Last Post: 07-01-2005, 02:22 PM
  3. Appending child and parent records
    By edward.mattison@scbhn.org in forum Alpha Five Version 5
    Replies: 2
    Last Post: 05-16-2005, 03:29 AM
  4. Displaying only parent of specific child records
    By Greg Fong in forum Alpha Five Version 4
    Replies: 6
    Last Post: 06-19-2002, 05:09 AM
  5. Filtering Child Records Apart From Parent
    By Rodney Efird in forum Alpha Five Version 4
    Replies: 12
    Last Post: 08-21-2000, 08:25 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •