Results 1 to 13 of 13
  1. #1
    Join Date
    Apr 2013
    Location
    USA
    Posts
    132
    Provided Answers: 2

    Unanswered: Cloning Relational data

    Here is a challenge fellows. I have not heard nothing from BD support yet.
    Hopefully some of you have the solution.

    I'm planning to generate recurring billing, so the goal is to clone a quote (containing relational data) in to another folder. I need to convert quotes to sales orders keeping a copy of the quote on default folder.

    I have attached a database with an example of the goal to reach. Also the three buttons are the code that I have implemented with no success.

    I will appreciate if you and your guys can give me a hand with this challenge. I'm pretty sure that my code is wrong but I can't figure it out.

    Regards,

  2. #2
    Join Date
    Apr 2013
    Location
    USA
    Posts
    132
    Provided Answers: 2

    forgot the attachment

    here is the file. Please rename to .bbd since I don't have winzip installed.

    Thank you.
    Attached Files Attached Files

  3. #3
    Join Date
    Sep 2011
    Location
    Australia
    Posts
    264
    Provided Answers: 2
    Hi Spyroot
    If I can find time will have a play around with this problem.
    In mean time can I suggest you create master keys and child keys in each form.
    This will always allow tracking of related records and be useful if need to export to a different database system.

  4. #4
    Join Date
    Apr 2013
    Location
    USA
    Posts
    132
    Provided Answers: 2
    I will try and get back to you.

    Thanks tamcind

  5. #5
    Join Date
    Apr 2013
    Location
    USA
    Posts
    132
    Provided Answers: 2
    how can I create primary keys?

    I though that by assigning the relation will be track it automatically.

  6. #6
    Join Date
    Sep 2011
    Location
    Australia
    Posts
    264
    Provided Answers: 2
    Yes that is true but it is "internal". Having keys gives you an "visable" options if we run in to problems working out a functional script. Not really that hard to do and little storage space used. If you exported forms to say an SQL database you need some reference keys to link tables. I believe what you are attempting is possible ( even with out keys) but need a quite moment and clear head to work it through.
    Also what quantity of records do you expect in quotes and products - may influence method used?

  7. #7
    Join Date
    Apr 2013
    Location
    USA
    Posts
    132
    Provided Answers: 2
    I will say that one quote may not have more than 10 entries/ records.

    Ex:
    Quote 1
    Item A
    Item B
    .
    .
    Item I

    Thanks for your time buddy

  8. #8
    Join Date
    Jul 2012
    Location
    Ireland
    Posts
    815
    Provided Answers: 17
    Hi Spyroot.

    Without knowing what your exact intentions are, I don't see the logic behind your current layout.

    Bearing that in mind, I feel that you can make this pretty darn easy on yourself with some minor changes. For example, there is no need to have your products listed 3 times. No need for 4 forms when 2 will do, and no need for so many folders.

    A Structure that would make more scene to me would be you have your Quotation folder, Products, and your Sales Orders folder.

    You create a quotation for a customer and add your products to that quotation. You do not clone or duplicate the products. So the only new record is the quotation.

    If this quotation is to progress into an order, then you select the qutation you gave the customer and press a single button.

    The script for the button would work like this.
    1: You clone the current record.
    2: You move back to the original record.
    3: You populate a variable with the contents of the relation field.
    4: You move back to your new record.
    5: You populate the relation field with the contents of the variable.
    6: You move the selected record to your Sales Folder.

    Something like that would simplify all this by a long way.

    Edit... actually, I'll write this for you. Please see example attached.
    Go to the Quotes folder, select a quote and press Run.

    Regards
    James.
    Attached Files Attached Files

  9. #9
    Join Date
    Sep 2011
    Location
    Australia
    Posts
    264
    Provided Answers: 2
    If the product data is to be identical after cloning "quotes" then James's idea should work (would need to know all the actual fields used in the real application) . This being the case might it even be possible to just have a single "Quote/Sale form with check box(s) that signals a quote now has a sale status. These could be used for filtering, visability rules, reports etc.
    Still would like to investigate cloning relational data independenty from original even as an exercise - adds to knowledge base for future applications.

  10. #10
    Join Date
    Jul 2012
    Posts
    94
    Provided Answers: 4
    Is this what you want? I cant understand well.
    Attached Files Attached Files

  11. #11
    Join Date
    Apr 2013
    Location
    USA
    Posts
    132
    Provided Answers: 2
    Thank you guys for the fast response, I will try both demos as soon I can.

  12. #12
    Join Date
    Apr 2013
    Location
    USA
    Posts
    132
    Provided Answers: 2

    Thumbs up Big Thank you

    MacHeuS,

    This is exactly what I was looking for. Now I have a better idea how to manipulate relational data between forms.

    tamcind, thank you much for your help as well. Your example is great.

    Feels good to get fast solutions from people like you.

    Thanks again.

  13. #13
    Join Date
    Apr 2013
    Location
    USA
    Posts
    132
    Provided Answers: 2

    Thanks to you folks

    I attached an image showing what I was able to do thank you to your help.

    Thanks again and looking forward to help others with my little experience.
    Attached Thumbnails Attached Thumbnails Relational data.jpg  

Posting Permissions

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