Announcement

Collapse
No announcement yet.

assign data from table 1 to table 2

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • assign data from table 1 to table 2

    First I want to select a contract in my form, then I want to see all articles that are already assigned to the selected contract and all articles that I can still assign.

    I don't have any experience with Scriptcase yet, but I have to make a lookup after selecting the contract, but how do I get all articles with a checkbox next to them, which I then assign and then write back into the database.

    At the moment I have no idea how to do this. Is there a tutorial or a video about it, or can you tell me in detail how I have to create it?

    Do I need a control or a form?

    Thanks for your help

    Translated with www.DeepL.com/Translator
    Best regards: - Simon -

  • #2
    I would use a double select with all contracts. On the left side would be the one which still have to be assigned on the right side those already assigned. By double clicking in the left column you can transfer a contract to the right column (=assigned).

    Depending the structure of your db the assigned contracts will be saved by ID-field in a field in a format like 1;78;124,3 (so with the indexes of the contract) or you can use a N:N relationship to update a table after saving/updating form.

    Lots of examples on the site/youtube/forum/

    Comment


    • #3
      Hello
      I can find such an example.
      I have a form with 2 fields. 'First Field the contract ID and the second as multiselect. How to configure that the icons go from left to right?

      Must I choose therefore an control? The saving then in an event?
      Best regards: - Simon -

      Comment


      • #4
        I have noch id with ajax event onclick and 1 multiselect field that loads data where vertrag_id = 1 but how can I show that these data are selected or which data I must assign to my table?
        Best regards: - Simon -

        Comment


        • #5
          You should at least have 2 tables. One with the contracts and another one like a customerslist (to store assigned contracts in)

          I would make a FORM of the customerslist (with field contracts in it). To this field contracts add a (double) select with a lookup of your contracts. By double clicking you will add a contract . SAVE and done is the job.

          Comment


          • #6
            Another way with only one table could be that:

            1. you add a INTEGER field to your contracts table with name eg status
            2. make a form of this table
            3. make select/checkbox of this status field
            4. use MANUAL lookup to load the value of the select/checkbox (eg value=0; label = NOT assigned/value=1; label=assigned)

            Succeeded?

            Comment

            Working...
            X