What are the Slack Archives?

It’s a history of our time together in the Slack Community! There’s a ton of knowledge in here, so feel free to search through the archives for a possible answer to your question.

Because this space is not active, you won’t be able to create a new post or comment here. If you have a question or want to start a discussion about something, head over to our categories and pick one to post in! You can always refer back to a post from Slack Archives if needed; just copy the link to use it as a reference..

Hi, we want to implement a toggle to activate/deactivate a step in oms by clicking a checkbox in bac

U01967XD72P
U01967XD72P Posts: 3 🧑🏻‍🚀 - Cadet

Hi, we want to implement a toggle to activate/deactivate a step in oms by clicking a checkbox in backoffice and save to database. In which table would you save this information? It’s just a boolean is_active true or false. Depending on this state the step in oms would be executed or not. Thanks in advance for your suggestens 🙂

Comments

  • U04FXCTCWPP
    U04FXCTCWPP Posts: 91 🧑🏻‍🚀 - Cadet
    edited December 2022

    Maybe you could create a new table for similar changeable config settings (because if you're making one now, you'll probably be making more later, too). It could have:

    id_setting (int, primary key)
    name (varchar(255))
    fk_type (foreign key to another table that's just a table of an id and a type column, listing anything you use, like 'bool', 'string', 'int', etc.)
    value (varchar(255))
    

    And there you can then conveniently store anything like this. This setting then could look like this:

    1,'is_active',1,'true'
    

    (in the other table of types, 1 would then obviously be the id for the 'bool' type)

  • U01967XD72P
    U01967XD72P Posts: 3 🧑🏻‍🚀 - Cadet

    Thanks for your answer! Sounds like a good idea

  • U04FXCTCWPP
    U04FXCTCWPP Posts: 91 🧑🏻‍🚀 - Cadet

    You're welcome 👍