Dynamically adding variables to a request item

Whatever your reasons may be, there may come a time when you need to dynamically add an additional variable to a request item after the original request has been entered by the user.  This could be for populating additional information that is not available at the time the request is made or if you are breaking up a single request that contains a list into multiple individual requests that can be operated on individually.

The challenge with doing this is that there is a relationship between four different tables that needs to be setup to ensure that the variable is associated with the request properly.  At the top is the Request Item table itself (sc_req_item).  Ultimately, this is where the variables will be referenced  on any subsequent form displays.  The other three tables create the relationship between the request item, the questions and the answers.  These other tables are sc_item_option_mtom, item_option_new and sc_item_option.

Continue reading