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.
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.
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:
Set Variable [$ID ; Salary::PrimaryKey ]
Go to Layout ["Advances Trancition" (Advances Tracition) ]
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".
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.
Sorry I forgotten to put screen shots of relation table. First of all very much thanks for your valuable tips for scripts.
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.
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
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.
I put the above function but still Leave value showing blank
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 )
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.