Results 1 to 8 of 8
  1. #1
    Join Date
    Jul 2014
    Posts
    20
    Provided Answers: 1

    Unanswered: Addiing a Record in a Popup Window with Relational Fields cloned

    The clone record does not have the option of a popup window whereas the add record does.

    The clone copies all fields and the add record none.

    Is there a way to create a popup window that fills selected fields and leaves the others blank?

    What makes it more complicated is that the fields that should be filled are relational.

    I have looked at this example:

    1 [$rec_id] = Add Record (Payment, Payments, No, Just create new record)
    2 For Each Record From [$rec_id]
    3 Payment: [Payment type] = "Credit Card"
    4 Next Item

    I have tried using the Change Relational Field Value action, but, it did not work.

    I have also examined the Set field value (text) action.

    Bill

  2. #2
    Join Date
    Jul 2012
    Location
    Ireland
    Posts
    815
    Provided Answers: 17
    The clone record does not have the option of a popup window whereas the add record does
    True, but there's a “Popup Records” action you can run after the record has been cloned.

    When you clone a record it gets added to whatever folder you choose as the last record in that folder. So it's possible open that record up in a popup by simply assigning the last record of the folder to a variable and using the “Popup Records” action to call that record up in a popup.

    Regards
    James

  3. #3
    Join Date
    Jul 2014
    Posts
    20
    Provided Answers: 1
    This is one script that I have tried. The broker and symbols do not get the data. It appears that the for next does not affect the pop up adding record form.
    I have tried both Y and N for relational field question of the Add Record.

    1 [$ybroker] = [Broker] (for Purchases)
    2 [$ysymbol] = [Symbol] (for Purchases)
    3 [$test_five] = Add Record (Purchases, Purchases, No, Create using popup form)
    4 For Each Record From [$test_five]
    5 Change relational field value (Purchases: Broker, [$ybroker], Add records to the field)
    6 Change relational field value (Purchases: Symbol, [$ysymbol], Add records to the field)
    7 Next Item

    Is there a way to define the $test_five:broker and $test_five:symbol?

  4. #4
    Join Date
    Jul 2012
    Location
    Ireland
    Posts
    815
    Provided Answers: 17
    Have you tried to create the record normally and at the end only then have it displayed in a popup?

    For example, set a variable that remembers the current record selected. Then run all 7 lines of your code only for line 3 don't have it set to create using a popup.

    When the “Next” loop is finish, use the variable you originally set at the start to jump to the original record that was selected, and then have the new record displayed as a popup.

    Regards
    James.

  5. #5
    Join Date
    Jul 2014
    Posts
    20
    Provided Answers: 1
    Thank you for the suggestions.

    This scripts works when you are in one folder and want to add records to another folder:

    1 [$symbol_two] = Current record (Securities)
    2 [$broker_three] = Records from Field("Securities: Broker", "All records in the field")
    3 [$xtestrec] = Add Record (Purchases, Purchases, Yes, Just create new record)
    4 For Each Record From [$xtestrec]
    5 Change relational field value (Purchases: Broker, [$broker_three], Add records to the field)
    6 Change relational field value (Purchases: Symbol, [$symbol_two], Add records to the field)
    7 Next Item
    8 Popup Record(s) ([$xtestrec], , )

    This script works when your working in only one folder:

    1 [$test_one] = Purchases: Broker (Brokers)
    2 [$test_two] = Purchases: Symbol (Securities)
    3 [$record_test] = Add Record (Purchases, Purchases, Yes, Just create new record)
    4 For Each Record From [$record_test]
    5 Change relational field value (Purchases: Broker, [$test_one], Add records to the field)
    6 Change relational field value (Purchases: Symbol, [$test_two], Add records to the field)
    7 Next Item
    8 Popup Record(s) ([$record_test], , )

    Bill

  6. #6
    Join Date
    Jul 2012
    Location
    Ireland
    Posts
    815
    Provided Answers: 17
    Looks pretty darn good to me. Nice work.
    So everything is as you need it now?

    Regards
    James

  7. #7
    Join Date
    Jul 2014
    Posts
    20
    Provided Answers: 1
    I now understand the add record and change relation field. The mistake was creating a text variable rather than a recordset variable.

    I will continue experimenting with the add record and popup to see if I can do it that way.

    The main reason is that I like being able to complete the record and then deciding whether to add to the database.

    I am exploring sheets and how they work.

  8. #8
    Join Date
    Jul 2014
    Posts
    20
    Provided Answers: 1
    I found a solution to what I wanted to do:

    In the security database, click on button to create these two global variables:

    1 [$brk_global] = [Broker] (for Securities)
    2 [$sym_global] = [Symbol] (for Securities)

    Then when you select New Purchases - the purchase window will open to add the record and you click on the button set broker/symbol which executes this script:

    1 [$purchase_rec] = Current record (Purchases)
    2 [$broker_text] = [$brk_global] (for Purchases)
    3 [$symbol_text] = [$sym_global] (for Purchases)
    4 [$broker_find] = Records from Query("xfindbroker")
    5 [$symbol_find] = Records from Query("xfindsymbol")
    6 For Each Record From [$purchase_rec]
    7 Change relational field value (Purchases: Broker, [$broker_find], Add records to the field)
    8 Change relational field value (Purchases: Symbol, [$symbol_find], Add records to the field)
    9 NextItem

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •