Jump to content

Value List and calculation won't work


amerioca

This topic is 1729 days old. Please don't post here. Open a new topic instead.

Recommended Posts

I have created a list report with a value list assigning values to fields of certain colours. All from 1 table – no related values. Layout is based on the same table.
The script filters the number of records with a certain colour.  The script button is located in the footer of the report.


Excursion scripts: Departure show Pink


Set Variable [ $DeptG; Value:customer::Dep_Date ]
Go to Layout [ “Departure_List” (customer) ]
Enter Find Mode [ Specified Find Requests: Find Records; Criteria: customer::Bus_Color: “=Pink” ]
[ Restore ]
Commit Records/Requests
Set Field [ customer::Dep_Date; $DeptG ]
Perform Find [ ]

(This script is assigned to 6 different buttons for each colour)


Every colour is assigned to a certain text value assigned by value list, which should show up in a calculation field in the header of the report for print purposes
The calculation field has a formula stored:


Case ( customer::Transpo 1 =  "Rail" ; "Rail" ; customer::Transpo 1  = "Globus Garage" ; "Globus Garage";Transpo 1 = "Gambrinus"; "Gambrinus";customer::Transpo 1 = "Tefra";"Tefra";customer::Transpo 1 = "Sprinter";"Sprinter";customer::Transpo 1 = "Individual";"Individual" )


I am encountering 2 problems:


1.)     When I trigger the script, the calculation field comes back with random values from the value list, but never the one set in the value list. It also somehow resets the value list to a random value not matching the calculation. It’ all messed up.
2.)    Whenever I click next to the records in the list, the values in the calculation field as well as in the value list disappear which spoils the purpose of printing the list.


Anyone with an idea, of where I messed up? I am sort of a rookie and assume that I have messed up something very basic here.
 

Graph.png

Link to comment
Share on other sites

-Enter Find Mode, remove the existing find request (Restore)

-Remove Commit step, never needed while in find mode. 

But you appear to set a variable based on the current record, then do a find for that record.

Very confusing what you’re actually trying to do and where the calculation field fits in. 

Edited by Steve Martino
Link to comment
Share on other sites

This calculation:

Case ( customer::Transpo 1 =  "Rail" ; "Rail" ; customer::Transpo 1  = "Globus Garage" ; "Globus Garage";Transpo 1 = "Gambrinus"; "Gambrinus";customer::Transpo 1 = "Tefra";"Tefra";customer::Transpo 1 = "Sprinter";"Sprinter";customer::Transpo 1 = "Individual";"Individual" )

does nothing useful that I can see. It returns whatever value is in customer::transpo1. You might as well return customer::transpo1.

 

Link to comment
Share on other sites

This topic is 1729 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.