9 Replies Latest reply on Nov 20, 2012 9:49 AM by philmodjunk

    Portal Issues



      Portal Issues


           I have a layout setup to intake field technician data sheets.  Within this layout I have a portal that generates records for samples taken in the field.  Each sample number is the same as field data sheet number, but a letter is added to the end to signify it’s a corresponding sample.  Example:  If the field sheet number is 7209 and there was 4 samples taken, then the sample numbers in the portal would be 7209A, 7209B, 7209C, 7209D.  As it sits, the portal draws the field sheet number into each line without the addition of the sequential letter.  My first question is this…  How do I automatically add a sequential letter to the end of the number? In the screen shot “Capture2e” you will see what the portal looks like empty.  By click the “Add Cylinder” button it adds a line to the portal as seen in “Capture3e”.  I have added letters to the end manually; as you will see the last line is without a letter.  This is how each line normally appears. 

           My second question is, why does a line always exist in the portal even though there are no records added yet.  As you will seen in “Capture2e” there is an empty line with my trashcan at the end of it.  How do I get rid of this line until someone pushes “Add Cylinder”.

           My third question relates to what seems to be an anomaly.  The “CAST DATE” date field in the portal is also automatically populated from the date of the field sheet record.  Sometimes it populates and sometimes it does not.  Please refer to the screen shots that I have attached to see what I am talking about.  If I press add cylinder 50% of the time the date will appear in the portal and the other half it will not.  To correct this, the user must delete the line in the portal and repeat the procedure.  After doing this it works for all the rest of the lines.  But if I start a new field sheet and group of cylinders in the portal I am back to the 50% working again. See image “Capture4”  Very strange!



        • 1. Re: Portal Issues

               1) It appears that you have this relationship: (I'm using my table names as I am unsure of yours.)


               FieldSheet::DataSheetNumber = Sample::CylinderNumber

               Where your layout refers to "FieldSheet" in layout setup | Show records from and your portal refers to "Sample" in Portal Setup | Show Related Records From.

               If so, your portal is functioning correctly and adding that letter would break the link between FieldSheet and Sample--not a desirable result. You'd need a different relationship and/or a different approach to auto-enter those letters for each new record in your portal.

               2) That extra row is because you have enabled "allow creation of records via this relationship". This extra row represents the "add row" where you can create a new related portal record by entering data into fields in this empty row in your portal.

               3) If the date is auto-entered from the FieldSheet Record, why do you need to copy it over like that? Won't it be the same date for every record listed in the portal?

               To figure out why it is only sometimes entering a date requires knowing exactly how you set this up as there is more than one method that could be used.


          • 2. Re: Portal Issues

                 Ok- So with regards to auto adding the letters, please see the screen shot to see how my relationship is setup.  I simply click add new cylinder, it transfers the fieldsheet number into the cylinder number field on the portal via this script: 

                 Go to Field [CYLINLDERS::Cylinder No.]
                 Go to Portal Row [Last]
                 Set Field [CYLINDERS::Cylinder No.;"???"]  (the "???" is in case the user has not entered a fieldsheet number)

                 What I need to do is add the letter to the end.  By manualy adding the letter I do not break the relationship, rather it works perfect.  I just want to automate the process.





            • 3. Re: Portal Issues

                   But what I am warning you is that if you do that, the new record will disappear from your portal. This change to the FieldSheet k field will keep it from correctly matching to a record in FieldSheets.

                   You should not need to match by 2 pairs of fields here from what I can see. Depending on how you collect data on each cylinder, you should be able to match just by FieldSheet k or by Cylinder number, not both.

                   If you continue to match by the FieldSheet k field, put the letter in a separate text field so that it does not affect your relationship.

                   There are several ways to auto-enter the next letter in a series when a new record is created, but you need to consider whether there is the slightest chance that two users might enter data from the same fieldsheet at the same time. From what I can see here, that's not possible, but need to check or we can have additional trouble assigning those sequence letters.

              • 4. Re: Portal Issues

                     Hi Phil-

                     The current process is as follows and works like a charm.  The tech goes to the FIELDSHEET layout and fills in the required data.  They then go to the portal (From CYLINDERS) and click the scripted button I placed above the portal.  Each time the button is pressed a new record is generated in the portal.  The Cylinder number is automatically placed in the first field “Cylinder Number” (which is actually the fieldsheet number entered by the tech).  After entering 4 cylinder records the tech then goes back to the “Cylinder Number” field on each line of the portal and enters “A”, “B”, “C” etc.  Upon entering the letter relationship is not broken.  All records remain in the portal and can be cross referenced via the “FIELDSHEET” layout or the “CYINLDER” layout.  Thus, if I look up say cylinder 9989A in the Cylinder layout, I have a scripted button that takes me back to the Fieldsheet layout where I can see Fieldsheet number 9989. The portal is still populated with only the related cylinders; 9989A, 9989B, 9989C, etc.

                     So forgive me, but I don’t understand why I would sever the relationship by adding a letter.  I have over 1000 fieldsheets and 4000 cylinders working perfectly together.  I just want to remove the manual step of adding the letter to the end.  The reason for the two relationship is to avoid exactly what you are saying.  The records in both Fieldsheets and Cylinders are related by automated serial number and then are further related by the manual addition of the FIELDSHEET number.  This relationship is simply there to enforce that the cylinders created in the portal have the same number as the fieldsheet.

                     Am I out to lunch or what…Be kind…


                     As always, thank again for your superb help,


                • 5. Re: Portal Issues

                       Check and see exactly which field they are editing to add the letter and what field type is specified for it. What does "k" indicate in the field name and why do you have both a "fieldsheet k" and a "cylinder number" field in the same table if the field sheet number and the cylinder number are the same? Which of these two fields matches to the pk serial number field and why does it have both a pk serial number field and also a fieldsheet No. field?

                  • 6. Re: Portal Issues

                         OK - The fieldsheet number and the cylinder number are not in the same table.  The fieldsheet number is in the fieldsheet table and the cylinder number is in the cylinder table.  The tables are related by both a serial number and then the fieldsheet number.  The serial is unique and hidden so that it can't be entered twice and corrput a relationship,  where as a fieldsheet number is manually added by the user and is not guaranteed to be unique.  The tech enters the fieldsheet data, they then use the portal to generate the corresponding records of cylinders.  The cylinder number field type is "General" and thus accepts the letter after the number.  As for PK  and K it is simply to distinguish between parent and child. pk Serial Number = Fieldsheet k  and Field Sheet No. = Cylinder No..  I know the names are confusing; to be cleaned up shortly.  "Fieldsheet k" - I should really have entered it as "kserial" (pkserial=kserial).  Sorry for the label "fieldsheet k";  makes for much of the confusion.




                    • 7. Re: Portal Issues

                           The cylinder number field type is "General" and thus accepts the letter after the number.

                           That's the date format, not the data type. Please open Manage | Database | fields, find the field definition there and see if it is of type number or text. I suspect that it is of type number and that you are entering text, the letters into a number field--not an apporach that I can recommend.

                           As far as I can tell, you can actually simplify your relationship to be:

                           pk Serial Number = Fieldsheet k

                           I don't see that matching also by cylinder number provides any additional functionality here and the relationship back to FieldSheets will enable you to access the cylinder number whenever that is needed.

                           Out of curiosity...


                                a fieldsheet number ... is not guaranteed to be unique.

                           Why is not not guaranteed to be unique by either specifying a validation rule of unique values or by using an interface design that precludes duplicate values?

                      • 8. Re: Portal Issues

                             Yes the field is setup as a number.  Should I change it to text?  How would you recommend it be setup?  The reason the value may not be unique is the company currently has preprinted fieldsheets and we have discoverd that some have the same numbers.  Try to make sure the data stays separate...another story another time.  I really need to get these letters added to the end automatically and I need to know what you think is my best root for doing so.


                             Thanks again...


                        • 9. Re: Portal Issues

                               I would define a separate text field for the letters. Then use either merge fields or a calculation field to combine the field sheet number with the letter. That allows you to set up a text field for the letter that your script can use to compute the next letter in the series when you create a new record in the portal with that script.

                               Define this relationship to a new occurrence of cylinders:


                               Cylinders::Cylinder No. = CylindersSameCylinder::Cylinder

                               Double click the relationship line and sort the records in CylindersSameCylinder by CylLetter--the new text field that we will use for our letter series. Specify a descending order.

                               Your script can then create the new record in Cylinders but then use the following code to assign the letter:

                               Set Field [Cylinders::CylLetter ; If ( IsEmpty ( CylindersSameCylinder::CylLetter ) ; "A" ; Char ( code ( CylindersSameCylinder::CylLetter ) + 1 ) ) ]