DQ Issues powered by formscripting

I had an interesting discussion with a customer lately, which triggered a discussion on dataquality with a friend of mine:

How do you ensure dataquality? Are you aware of some subtle issues on dataquality when using formscripting?

What is the challenge? The customer had a request, that an entity should carry an account, something like a budget and sometimes a person who could help influencing the decisionmakers. This person is not required below a certain amount of budget, but required, when the budget is above.
So, for demopurposes, i created an entity with an account, a budget (attributename clz_budget) and an influencer (clz_decisiondriverid), which is a reference to a contact. Additionally, i added a changeevent to the budgetattribute on the form: when teh budget is above 1000, the influencer is mandantory, else use the formdefault for the requiredlevel.

So, the form looks like this:

classification_after_wf_detail_edited

and the formcode is something like that:

Everything is fine on the form, as you can see. If the budgetvalue is above 1000, the decisioninfluencer is mandantory. Now the problem: if you leave the budgetvalue below 1000, save the data and let the budgetvalue be set by a workflow to 2000, the rule of the mandantory decisioninfluencer will be disobeyed and you loose dataquality.
see here before and after workflow:
classification_b4_wf_edited

classification_after_wf_edited
Even worse: if you open the record with the budgetvalue of 2000, the decisioninfluencer is marked as mandantory and you are able to close the form without a hint (because no data was changed…)
So, where does the problem reside: the problem is caused by programatically setting the requiredlevel. You could introduce a plugin, which prevents that situation, but the message from the plugin will will rise on a strange moment while saving the form or nearly nothing will happen in case of the execution of the workflow. And what happens, if you think you have to change the threshold from 1000 to 500 by changing the script?

This is definitely a scenario, where you should carefully thing about when designing your solution. I will keep it in mind and think about new strategies to deal with that kind of problems.

No comments yet.

Leave a Reply