12 Replies Latest reply on Jun 9, 2014 8:38 AM by philmodjunk

    Regarding Salary

    samarthmkt

      Title

      Regarding Salary

      Post

           Dear Sir,

           As I have customise the salary document as per our requirement. I have completed all the necessary data field as well as portal setup also to define the transitions.  In portal setup data field is not appearing though I have define the same data field in edit layout. I think so I am some were wrong. Please give me feedback where I am wrong. for are perusal I am attaching the temp of the same.

           Thanking you

      Capture.PNG

        • 1. Re: Regarding Salary
          samarthmkt
          /files/bc43c372ea/Capture1.PNG 1454x765
          • 2. Re: Regarding Salary
            philmodjunk

                 What relationship have you defined linking your Salary Tutorial: What are Table Occurrences? to your Advances Trancition table occurrence?

                 What are the match fields that you defined for this relationship.

                 In order for a record from the Advances Trancition table to appear in the portal for the current Salary record those match fields must have identical values.

                 If you want to be able to add new records by entering data into a portal row, you need to open Manage | database | Relationships, double click the relationship line linking these two table occurrences and select the "allow creation of records via this relationship" check box for Advances Trancition.

                 And if you want to use the Add Transaction button to add portal rows, you'll need to write a script for adding new records in the Advances Trancition table that creates the new record and assigns the correct values to your match field(s) of the new record.

            • 3. Re: Regarding Salary
              samarthmkt

                   Thanks

                   Yes I want to use the add transaction button to put values in advance description portal table. I have already define the script as in screen shot but still no any solution. Secondly I also want the addition of all line (Rows) advance amount and similarly this total amount will also be appear in total advance amount taken in current month of salary table.

                    

              • 4. Re: Regarding Salary
                philmodjunk

                     Your script does not create any new records. All it does is put the cursor in the Date field of the last row of the portal. This will not do anything unless you alothe "allow creation..." option that I mentioned earlier.

                     Most "add new portal record" scripts use this type of script, though there are other possible methods:

                     Freeze Window
                     Set Variable [$ID ; Salary::PrimaryKey ]
                     Go to Layout ["Advances Trancition" (Advances Tracition) ]
                     New Record/Request
                     Set Field [Advances Trancition::ForeignKey ; $ID ]
                     Go to Layout [original layout]

                     Note: You did not describe your relationship and match fields like I asked. Since I do not know the name of the match fields used, my answer assumes that you have this relationship:

                     Salary::PrimaryKey = Trancition::ForeignKey

                     You'll need to use the actual names of your match fields in place of "PrimaryKey" and "ForeignKey".

                     Second Note:

                     Any script that changes layouts can trip a large number of different script triggers that you might have set on fields or the layout of either layout. Scripts performed by those triggers will interrupt this script, perform and then return control to the original script. That can, in some cases, keep the original script from functioning correctly.
                      

                • 5. Re: Regarding Salary
                  samarthmkt

                       Sorry I forgotten to put screen shots of relation table. First of all very much thanks for your valuable tips for scripts.

                  • 6. Re: Regarding Salary
                    philmodjunk

                         The match fields do not appear to be the correct fields to use for your relationship.

                         You need a field in the parent table that uniquely identifies each record in the Salary table. This would normally be an auto entered serial number field. In my solutions, I would name that field __pkSalaryID and use field options to select the serial number auto-enter option. If you have existing records in your table already, you'll need to use Replace Field contents to update this field with serial numbers.

                         That field then needs to match to a field in Advances Trancition with the same data type as __pkSalaryID. I'd name that field _fkSalaryID.

                    • 7. Re: Regarding Salary
                      samarthmkt

                           Thanks Sir for getting the feedback of above table solutions. Yet I have rectify the error on your valuable tips. Now I am not getting the calculative value in specific field . I have put this script(in screen shots) but not getting the calculative value. The calculation is as

                      • 8. Re: Regarding Salary
                        samarthmkt
                        /files/8ec6743198/Capture1.PNG 1280x900
                        • 9. Re: Regarding Salary
                          philmodjunk

                               Let's back up. What is this calculation supposed to produce as an answer?

                               An If funtion has three parts: If ( Part 1 ; Part 2 ; part 3 ), also called parameters.

                               The first Parameter should be a Boolean expression. An expression that evaluates as True or False. In many cases, this is a numeric calculation that produces a number results. When that is the case, any value other than zero or empty evaluates as True. Zero or Empty results evaluate as False.

                               The function then returns the value of either part 2 or part 3 depending on the value returned by part 1. If part 1 is True, Part 2 is evaluated. If it is False, Part 3 is evaluated.

                               So I don't think part 1 of your If function:

                               IsEmpty ( SalaryMonth ) / No of Days in Month * No of Leaves in Month

                               makes sense as a Boolean expression. Simply using IsEmpty ( SalaryMonth )  would produce the same results from your If function.

                          • 10. Re: Regarding Salary
                            samarthmkt

                                 Thanks Sir,

                                 I put the above function but still Leave value showing blank

                            • 11. Re: Regarding Salary
                              samarthmkt
                              /files/ced38c45c4/Salary.PNG 1272x863
                              • 12. Re: Regarding Salary
                                philmodjunk

                                     I did not suggest that you make any changes to this calculation as I want to know what value this calculation is supposed to produce first.

                                     I merely observed that:

                                     If ( IsEmpty ( SalaryMonth ) / No of Days in Month * No of Leaves in Month ; 0 ; SalaryMonth  / No of Days in Month * No of Leaves in Month )

                                     and

                                     If ( IsEmpty ( SalaryMonth ) ; 0 ; SalaryMonth  / No of Days in Month * No of Leaves in Month )

                                     Would produce the same result. I did not suggest that you make this change as I do not know what you need this calculation to do.