Results 1 to 7 of 7
  1. #1
    Join Date
    Jun 2017
    Posts
    16

    Unanswered: How to a generate a serial number depending on previous record.

    Dear all,
    I need to generate a serial number depending on previous record. Suppose I give a SL No. 27 for a record, I need SL No. 28 for the next record which I can edit.
    Please, help me. Thank you.

  2. #2
    Join Date
    Jul 2014
    Posts
    24
    Provided Answers: 1
    You would have to create a global variable using the set var by math formula:

    [$Global_One] = [PlanSharesAgent] (for Purchases)

    then create a button with this script

    [$Test_three] = [Quantity] (for Purchases)

    [$test_four] = [ReinvestShares] (for Purchases)

    [$Test_total] = [$global_one] + ([$test_three] + [$test_four])

    Purchases: [PlanSharesAgent] = [$test_total]

    [$Global_One] = [PlanSharesAgent] (for Purchases)

    This is kind of convoluted and requires using the enter key on the field to seed the value.

  3. #3
    Join Date
    Jun 2017
    Posts
    16
    Can u simplify the formula? Could not understand properly. Thanks.

  4. #4
    Join Date
    Jul 2014
    Posts
    24
    Provided Answers: 1
    You could do this way:

    Create a global_variable called test_count using the set var by math.

    The only way that I know to change the value of a field is to create a button.

    The button script could be this:

    [test_count] + 1

    use the set field value script to change the value of the count field

    TestDatabase: [Count] = [$test_count]

    It is my impression that weakness of the brilliant database is the lack of an auto count field.

  5. #5
    Join Date
    Jun 2017
    Posts
    16
    Thanks for your promt reply. I used the script. But it can be used for single dataset..suppose for a single patient. It can not relate with the previous or next dataset. Thanks.

  6. #6
    Join Date
    Jul 2014
    Posts
    24
    Provided Answers: 1
    The example that I first showed is based on upon this:

    stock database
    purchase database

    I use the global variable to create a running subtotal for each stock. The trick is that when I go to next stock, I have to reset the global variable for that stock.

    The running total field requires that I go to the last entry for that stock and press enter. That gives global variable its value. When I add the purchase I click on the calculate button and it adds the new purchase entry quantity to the running total and creates a running total. As long as I am on that stock, all I have to do is click on the calculate button.

    Maybe someone with more experience can suggest a less cumbersome workaround.

  7. #7
    Join Date
    Jun 2017
    Posts
    16
    thank you.

Posting Permissions

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