Custom module: Dynamic logic

Kurt Muller asked on August 18, 2020 17:38

Hi all

I've built a custom module that I am using for custom site settings, and need a dynamic value added based on a macro condition. How do I get this done? Hope this makes sense

Kurt

Recent Answers


Trevor Fayas answered on August 18, 2020 23:33

Settings are usually not dynamic, by their nature they are things that are "set", you may want to leverage a macro method instead that gets the value based on some conditions. Can you outline what dynamic logic you are looking to accomplish?

0 votesVote for this answer Mark as a Correct answer

Brenden Kehren answered on August 20, 2020 07:03

If the value that is dynamic is a custom setting then you should be able to call the API to update that setting key during your custom event. It's not impossible but as Trevor stated, it's not a common practice.

0 votesVote for this answer Mark as a Correct answer

Trevor Fayas answered on August 20, 2020 14:23

Bk is right that you can use the API to set a new value, is that what you are trying to do? I read it you want the setting itself to be a dynamic value, which it doesn't support. But there may be other options depending on what you are trying to accomplish.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.