Showing results for 
Search instead for 
Do you mean 
Community Home Request Access Read Blogs Share Your Ideas Search Community View My Settings
New Idea
0 Kudos

Hi,

 

A scenario I've come across several times in different customers is that there might be conditional logic that must be triggered in a quickform based on the state of different controls.

 

For example, lets say that you want to take a specific action based on values of the account status, type, telephone, and webaddress controls. Like "display a survey form if the account status is active, the type is customer, and either the telephone or webaddress are non empty".

 

This is what I would currently do:

 

- Wire up events for the OnChange event of 4 controls: Account Status, Account Type, Account Telephone, Account Webaddress.

-In each of those OnChange events repeat the same logic that checks whether to launch the survey form or not, and code the display of it. If at any point the requirement changes, I have to modify each of the OnChange events code.

 

This is what I would like to do:

 

-Create a new quickform-level function or method, lets call it "LaunchSurveyFormIfRequired". This function checks whether the condition is met, and displays the survey form accordingly.

-In each of the OnChange events for Status, Type, Telephone and WebAddress, I just invoke the LaunchSurveyFormIfRequired method. No need for logic duplication. If at any point the requirement changes, I have to modify just one function.

 

It seems like a natural thing to do. In fact, this is the way I would solve this propblem in a regular ASP.NET form where the same logic must be invoked from several different events.

 

Of course, there might be scenarios where this can be solved with entity-level business rules, but that only works if what you are doing only refers to the entity itself, not when you need to do manipulation of UI-level objects, which is what I'm proposing here.

 

I hope this makes sense, and resonates with the community.

 

We want to hear your cool ideas for enhancing Saleslogix products and services. So add your own ideas or kudo (vote) on the ideas of others here! Watch the most valuable bubble to the top!

I have an idea! How do I get started?

One
Read our submission guidelines.

Two
Search for your idea. If you don't see it, submit a new one!

Three
Provide feedback on the ideas of others by voting with kudos and adding comments.
For more information about using ideas, read this thread.

Four
Track your ideas and those you like. Once you've posted or kudoed and idea, subscribe to be notified via email of the latest updates to the idea. From within the idea, click "Idea Options" which appears above the idea title and choose, "Subscribe to this idea".

Be sure to check back from time to time to see new ideas and status updates!

Here is a quick list of the recent ideas for speedy browsing!
Labels