In my model-driven app I have a table with 2 related choice fields: TRL_start and TRL_end. They both use the same optionset, a 9 value, ordered list consisting of Technology readiness levels. My option set uses TRL descriptions (e.g. "System complete and qualified") rather than TRL numbers (e.g. TRL8) due to client requirements.
I need to ensure that TRL_start has a lower TRL value than TRL_end. But the business rule builder does not allow magnitude comparisons of choice field values. i.e. I can't say TRL_start < TRL_end.
Does anyone have a good approach for this kind of validation?
Solved! Go to Solution.
Hello @halifaxious,
If you want to go with OOB behavior then we need to use Multiple IF ELSE Condition in Business flow to achieve the same (that also we can go with TEXT only).
My Suggestion is to go with JavaScript.
Please mark as Answer if it is helpful and provide Kudos
Subscribe : https://www.youtube.com/channel/UCnGNN3hdlKBOr6PXotskNLA
Blog : https://microsoftcrmtechie.blogspot.com
Hello @halifaxious,
Its Simple, Create one Global Option Set Choice Field with Values
Example:
System Complete --> 100001
Qualified --> 100002
Use the same Choice Field in both TRL_start and TRL_end
then write a Simple JavaScript as
function compareStartandEnd(executionContext){
var formContext = executionContext.getFormContext();
if(formContext.getAttribute("TRL_start").getValue() < formContext.getAttribute("TRL_end").getValue()){
// do your operation
}
}
For Writing Javascript you can refer this video too https://www.youtube.com/watch?v=x8kYNCkikgs&t=8s
Please mark as Answer if it is helpful and provide Kudos
Subscribe : https://www.youtube.com/channel/UCnGNN3hdlKBOr6PXotskNLA
Blog : https://microsoftcrmtechie.blogspot.com
I already have the global optionset defined that way. My design brief is to use OOB functionality unless it is completely impossible. I take it that adding custom javascript is the only solution?
Hello @halifaxious,
If you want to go with OOB behavior then we need to use Multiple IF ELSE Condition in Business flow to achieve the same (that also we can go with TEXT only).
My Suggestion is to go with JavaScript.
Please mark as Answer if it is helpful and provide Kudos
Subscribe : https://www.youtube.com/channel/UCnGNN3hdlKBOr6PXotskNLA
Blog : https://microsoftcrmtechie.blogspot.com
User | Count |
---|---|
19 | |
9 | |
8 | |
5 | |
5 |
User | Count |
---|---|
31 | |
29 | |
18 | |
17 | |
4 |