8 Replies Latest reply on May 27, 2016 5:28 AM by isamudysan

    Initial/First New Record/Create Issue

    isamudysan

      When "New Record" is clicked, a new record is shown to be created; however; adding further data in the fields following the Date field it creates a second record with the current populated of that field, and leaving the first record empty except for the Date (Creation Date of course).  I have a screen shot, video, and the sample file.

       

      I want to thank BruceRobertson for the scripts that is used in the sample file.  This was from a post a month ago or so that he graciously helped me with.

       

      record_create_issue.png

       

        • 1. Re: Initial/First New Record/Create Issue
          greatgrey

          In this case remove the New Record/Request line, will stop the duplcate record. The Set Field [Shipping::gshippingID;""] also makes a new record.

          • 2. Re: Initial/First New Record/Create Issue
            isamudysan

            thanks for your reply greatgrey.  however, that does not solve the problem.  i have previously tried that by removing/disabling the New Record/Request and Set Field [Shipping::gshippingID;""] lines.  even when you click on the New Record button on the status/toolbar (?) to create a new record, the same problem persist.

             

            in the same file when i first was working with it, i set the gShippingID (global) field to be an auto-enter for serial number; and, related to the ShippingID field in its duplicate occurrence.  i don't think that was the correct or proper way to use global fields; but, it wasn't giving me the problem i have now. of course, through all of this i've been using the same scripts found in the attached file above.

            • 3. Re: Initial/First New Record/Create Issue
              erolst

              The fields in your Header part come from a self-join via the global gShippingID, allowing creation of records; so when you enter data in those fields, you're creating a new record with a shippingID set to whatever is in that global field – unless the global value is identical to an existing shippingID …

               

              << i set the gShippingID (global) field to be an auto-enter for serial number>>

               

              and that doesn't work because switching records doesn't trigger the update.

               

              You could/should do several things:

               

              • disallow record creation via the relationship

               

              • change the relationship to a straight self-join by shippingID, or

                make sure that both new record creation as well as entering a record sets the global ID to the new/current record's shippingID – as you already intended …

               

              That could simply be done with a one-liner script Set Field [ Table::gShippingID ; Table::shippingID ] and an OnRecordLoad trigger.

              1 of 1 people found this helpful
              • 4. Re: Initial/First New Record/Create Issue
                BruceRobertson

                First of all.

                What's with the field missing?

                Second. Please explain how you think this works, we went through all that when you got the original example.

                Third. Yes, removing new record DOES fix the problem.

                 

                 

                If [ Get( RecordOpenCount ) = 0 ]

                Set Field [ Shipping::gShippingID; "" ]
                Go to Field [ Shipping_Create::<Field Missing> ] New Record/Request

                End If

                 

                1 of 1 people found this helpful
                • 5. Re: Initial/First New Record/Create Issue
                  isamudysan

                  ah, sorry, about that line in the New Record script.  just saw it late last night (into the whee hours).  the missing field is PN; and BruceRobertson thanks again for the script.  i know your original script does not have the New Record/Request step, so i added it just for the initial record creation.  other than that everything else works great after creating that very first record.

                   

                  the intention of this is to not show any related data in the fields, in the above header, when selected in the body.  that has been accomplished via the self-join from the gShippingID to ShippingID. this part works great as records are created after the very first record.

                   

                  removing the New Record/Request does fix the problem, but does not create that first record.  once past that everything is fine.

                   

                  EDIT:  thanks, bruce, for the sample file...i didn't see that as i went straight into replying.

                  • 6. Re: Initial/First New Record/Create Issue
                    BruceRobertson

                    Another mod to the file. This one works and is tested. Interesting exercise.

                    • 7. Re: Initial/First New Record/Create Issue
                      isamudysan

                      lol, BruceRobertson i was thinking something similar to that as well.  i'll work on the file a bit later. thanks!

                      • 8. Re: Initial/First New Record/Create Issue
                        isamudysan

                        wow...that's totally awesome! looking at that script my mind is exploding lol.  i really appreciate your assistance to me and to the FM community.  when i implement this, i'll give credit where credit is due.

                         

                        i'm not a fulltime FM developer.  i only develop when asked by my team leads or their supervisors. but, i'm learning thanks to you all; and, i'm gonna keep going at it even when i'm not working on new solutions .

                         

                        may i have you explain the $$newflag variable?

                         

                        thank you.