2 Replies Latest reply on Sep 4, 2014 4:06 AM by rasmuslaine

    when creating new record, relational fields will have often some context.

    rasmuslaine

      Title

      when creating new record, relational fields will have often some context.

      Post

      Hey ya all.

      I have a Contact management database(starter solutions), which has been upgraded/expanded under recent years. 

      There is 3 tables where I think the problem lies. Person table, Person-Company table and Company table. These tables are all linked/related. 

      When you are creating new record in person layout you will get automatically in company related fields some existing companies data, when these fields should be blank. Former developer, who created this database, added possibility to create companies from persons layout and when you type in company division field it triggers a script which commits the company and division data. So in the same time you create a contact you can create company from same layout.


      When you create a record there is no scripts running at that instance.(And I even deleted every script from the database, no changes)

       

      The biggest problem is when creating record, when you change the company to another, it may change other existing person company details.


      related Person-company table (aputaulu)

      has fields

      Company -> text (foreign key as company name)

      Division -> text

      Hlo_id -> text (Person foreign key)

      hlo_name -> text

      How should I solve this puzzle? I removed every data from person-company table from hlo_name field,
      it works fine. And it's not even a foreign key table. I don't understand.

      Capture.PNG

        • 1. Re: when creating new record, relational fields will have often some context.
          philmodjunk

          I can't match the screen shot to your written description of the design of your database.

          Allow creation of records via this relationship dose not automatically create records in the related table. It merely makes it possible to do so from the context of the other table via a portal or a few other methods--such as entering data into a field from the table where "allow..." was enabled when on a layout based on the related table occurrence.

          So if you are creating a new record and data pops up in fields from a related table, this sounds like a potentially very serious issue with your data. It sounds like your new record already matches to existing records in the related table and this should not be the case.

          • 2. Re: when creating new record, relational fields will have often some context.
            rasmuslaine

            Hey, thanks for helping. I did now solve the problem. Serial number in person table is formatted as a text and in aputaulu too. 

            And there was existing keys which where higher than next increment value. Problem is now fixed, formatting text to number, validates that the key is unique. Replaced old data with new unique keys.