No announcement yet.

What's the best way to keep track movement in Form

  • Filter
  • Time
  • Show
Clear All
new posts

  • #16
    hi weilies,
    did you see this video?

    exactly at time 6:45 mins. may help.


    • #17
      hi itsme3, my problem above is the pagination not updated (<1, 2, 3... >) when there is a new row added
      not to update a master field.

      Currently i have 2 detail rows (it shows < 1, 2 >)
      When i added a detail and it redirect back, it's still showing < 1, 2 > where i expect it to shows < 1, 2, 3 >
      hope it's clear for my explanation

      You can play around with my app via link above

      i realized when i removed some hardcode and the app doesn't work properly.
      I have my
      Person 1 - with no effective (date key) 29 Sep
      Person 2 - with effective 29 Sep

      When i try to insert 29 Sep for Person 1, it complain key exist
      Last edited by weilies; 09-29-2014, 06:28 PM.


      • #18
        Hi jsb, what I didn't followed, is to set PM = null
        My keys for the history table are
        Person id, which is the FK of master person table
        Effective, a date key field which I always set as today and its unique bcoz no row inserted for today yet.

        Correct me if I am wrong, by setting both field above, I don't need to create extra PK field to auto increment, right?


        • #19

          yes dear i understand, i guess it is the same idea, you need some sort of ajax to make the update, that's why i posted that link to have a look

          actually i didn't work on such scenario before, that is why i am not sure i can help in this, but i am sure guys here will provide you with your suitable solution, just be patient a little they might didn't find enough time yet

          btw: auto increment for "any" table is almost a must


          • #20
            hi itsme3, i worked from mysql > Oracel DB > mysql again
            So, my mindset changed a bit, auto-increment field is not required in oracle as long as the unique keys are identifiied. i assumed the same concept applied to mysql and plz correct me if i am wrong.

            Master Person >> PK=person_id
            Person History tracking >> PKs = person_id + effective(date field)

            Does SC required something like below?
            Person History tracking >> PKs = person_id + effective(date field) + change_id(auto_increment)

            Coz i tried jz now to add the auto_increment field, i got the same erroro "row already exist"

            Hope to get help from gurus


            • #21
              it's not scriptcase that's giving you the headache. I'm sorry to say but it is your database design that's faulty.
              You are right an auto increment field is not required as a primary key, but then it's your problem to take care of it.
              Person_id + date is NOT unique, hence the db gives you the error. Scriptcase has nothing to do with it.

              Please don't feel offended but take a pencil, a sheet of paper and a (big) eraser and start defining (exactly) what your application
              should do, what data you need for it and then begin designing your database (read up on normalization).
              That's at least 75% of your application and the rest is creating the user interface and programming the logic from step 1.
              This is where scriptcase shines and saves you a tremendous amount of time.

              It seems to me what you are doing right now is fixing a superficial error and by doing so creating two new ones. At the end you might
              get a working application by adding a workaround after workaround but if anything changes your whole system collapses like a house of cards.

              As I said earlier, don't feel offended but I strongly suggest you get your foundation (database) right otherwise people here in the forum are
              having a hard time helping you over the hurdles.



              • #22
                Hi Jsb, Thanks for all the support and helps given.
                I promise you that i will learn with a humble heart.

                And hope you could continue guide me on my problem.

                I don't understand why Person_id + date is not unique? Could you explain more on this?
                as i could always consider a person A on 1 SEP 2014, his marital status is 'Single' and 10 OCT 2014, his status could be 'Married'

                And regarding 'normalization', there is a purpose i design the table with redundant fields. It was trying to copy the concept from PeopleSoft, the "effective dated" concept
                Person | Effective Date | marital status | name | ... any fields can modal a 'Personality'
                P001 | 1 JAN 2014 | Single | Fatimah | ... other fields
                P001 | 1 FEB 2014 | Single | Fatimah John ... name changed and yet other fields are remain the same
                P001 | 1 FEB 2014 | Married | Fatimah John ... only update marital status

                Correct me if i am wrong, your intention to normalize the table to reduce the redundancy?
                I have adopted this concept from Peoplesoft and i found it easy when to extract data based on certain date (effective date), even with redundancy in DB. That's the reason i keep the DB table design in such a way.

                And to make me more reasonble to modal a 'Person', i would need to design table to hold his 'citizenship', 'contact info(address)', which similar effective date design.
                That's why as of a given time, i can write a simple SQL to pull out the person's status.

                Due to many person related tables are 'effective dated', so i have to have a master table which to hold 'Person ID' and the photo only
                That's why you can see i have my person master
                and the detail apps will be hosted in 'tab' (Personality, Contact, etc...)

                Thanks for your patient in explaining but i am so sorry bcoz i can't spot what's wrong with such DB design. Sorry coz my DB knowledge might not as good as yours


                • #23
                  Originally posted by weilies View Post
                  It was trying to copy the concept from PeopleSoft, the "effective dated" concept
                  hi weilies,
                  i think this is the step you are overlooking, as jsb said, do what you need, don't copy other people concepts, plan well... believe me once he told me this and i was fighting over an idea... he told me will collapse later and it did soon after-all, normalization is very important to work on base project, i changed one project over and over until i got the desired setup that can hold my scenario and that was also by jsb advise, now i am happy with less workarounds although still struggling with some issues that are logic and can be solved.

                  why don't you try to explain briefly your scenario of the project, lets have a look and advise about best normalization possible, to be honest, i would like SC guys to open a section for this... many people have scenario in mind and they don't know what is the best practice to do using scriptcase... sometimes SC does save a lot of time if you know how to use its power correctly...

                  one more concept i like to use from time to time, if i have powerful platform for specefic need that i can use "PHP/Open source" and flexible to use, why do i start creating new one using SC? did you try sugar crm? did you see orang hrm? those are people management stuff hold big platforms flexibility and they are open source, have a look... may save you time and give you more useful features, those people is their domain, they for sure planned the software well and added/planned for different requirements scenario