Forum Discussion

JasonBowen's avatar
JasonBowen
Qrew Trainee
5 years ago

Trouble using QuickBase Automation to update a record

Hello,

I am having trouble with a Procurement Request (PR) management application generating its own PR numbers, which must be unique, and in a sequential order.

I am working on a Procurement Request (PRs) management application.

The application has users assigned as Authorized Procurement Representatives (APRs), Department Heads (DHs), and Procurement Managers. APRs and DHs have restrictions on which department(s) they may create and/or approve procurements for, based on relationships between Departments and APRs or DHs.

When a PR is initially created, it is not yet assigned a PR number. When the PR is created, it receives a [Status] of "Pending Submission". This is the equivalent of a draft. Only the user that created the PR can see it at this point. When the user is ready to actually submit the PR through the procurement process for the first time, they will click a button [formula URL] that:

  • Enters the date of today() into a field [Initial Submission Date]
  • Changes the value of [Status] to "Submitted to Department Head"
  • Assigns the next sequential PR number (i.e. 2019-0001, 2019-0002) to a text field [PR Number]

The problem is that I'm getting duplicate PR numbers when multiple APR users (which have different restrictions on which departments they have visibility on) are creating and submitting purchase requests at different times.

What I need to happen is:

WHEN a PR is being submitted for the first time, it is assigned the next sequential number for PRs for the year (fiscal year). Only PRs that have been submitted apply toward this count ("Pending Submission" PRs do not count). Because "Pending Submission" PRs don't count, the PR # can't be applied at the time the record is initially created.

PR numbers would be "yyyy - ####". Once October 1st comes around, PRs will be numbered "2020 - 0001", etc.

​​Suggestions?

Thanks,

Jason

------------------------------
Jason Bowen
------------------------------

2 Replies

  • Disregard,

    I found a related post in which a reply posed the existential question, "why does it have to be that way?"

    Upon further review, there's really no valid reason that I can't pad the record ID and use that.



    ------------------------------
    Jason Bowen
    ------------------------------
    • MarkShnier__You's avatar
      MarkShnier__You
      Qrew Champion
      That was probably my thread you found. The idea with QuickBase is to get 'er done quickly.  So it's far better to be building functionality than messing around for a whole day trying to get that auto numbering system working when there's no actual business purpose for it. 

      Zero pad and move on. Or import 9999 records and delete if you want to start numbering at 1000.

      ------------------------------
      Mark Shnier (YQC)
      markshnier2@gmail.com
      ------------------------------