I want to build a database-oriented SaS.
One of the main functions will be to create names of objects in a standardised form. I've looked at all sorts of options for technology to do this, but have found nothing that will do this without charging end-users a monthly fee that would be prohibitive for this app. Then I recalled the latest updates in Toolset - advanced post-relationships and drag-and-drop form editor : things that are at the core of what I'll need.
So now I'm checking out the feasibility of using Toolset.
I know I'll be able to achieve anything I want in terms of the look and feel of the app. What I need to be sure of is that I can do the basic "database" work relatively easily. (Shockingly, this is where even MS Access let me down!) So here is a simple example of what I need to achieve.
I have two post types -
Topics: with fields TopicName and Topic
Brands: with field Brand
I created a one-many relationship between Topics and Brands so every Topic can have one Brand. Easy!
I have a "New Topic" form showing two fields:
Topic (enter value) - mandatory
Brand (lookup from post-type Brand) - optional
So, finally, here is my question. What is the best way to achieve the following?
I want to add code somewhere to auto-calculate the value of TopicName (in the Topics post type) as follows:
If there is no Brand selected, then
TopicName = Topic
Else
TopicName = Brand "|" Topic
At its core, my app will have a lot of relationships and 'calculated fields' like this (usually more complex).
So I'm looking for advice on the best way to go about this. (Quite possibly I'm overlooking the glaringly obvious and that this is very easy. I hope so...)
Unless it gets a lot more complicated, I'd prefer to do it without modifying the form code so that I can preserve the very nice drag-and-drop capabilities for future enhancements. But actually ANY solution would be good!
I'm really hoping there's a good answer to this because I'm running out of options. On the other hand, I know that if I CAN do the DB stuff in Toolset without it being overly clunky, I'll be able to make use of the rest of Toolset's awesome features to make this into EXACTLY what I wanted, and probably more than I originally envisioned!
(I may have a follow-up question about doing something at the next level of complexity - which is where MS Access let me down.)