This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Calculating data in templates

Looking for best practices on calculating data based on earlier data for templates. I have a customer who wants their CentralAccount to essentially be an incrementing field. The first user entered should be A1000000, then B100001, then c100002, then back to A100004. There are a few ways to accomplish this. I've written a stored procedure that will automatically fetch the next best user name. Not sure if this is the best way to accomplish this. I can use CreateCol to fetch the entire Person table, and iterate, but this is probably really inefficient. Any ideas on how to address this without killing the database?
Parents
  • Hi George,

    sounds like a use-case for DialogNextID. With its GetNextID() method you can "fetch" a new integer value. This can easily be done in the CentralAccount@Person template. The prefix (A, B, C) can then be calculated based on the value. Don't forget to unmark "Overwrites" Wink

    HTH,

     Oliver

Reply
  • Hi George,

    sounds like a use-case for DialogNextID. With its GetNextID() method you can "fetch" a new integer value. This can easily be done in the CentralAccount@Person template. The prefix (A, B, C) can then be calculated based on the value. Don't forget to unmark "Overwrites" Wink

    HTH,

     Oliver

Children
No Data