Показать сообщение отдельно
Старый 13.04.2018, 09:11   #1  
Blog bot is offline
Blog bot
Участник
 
25,475 / 846 (79) +++++++
Регистрация: 28.10.2006
crmtipoftheday: Tip #1104: If without if
Источник: https://crmtipoftheday.com/1104/if-without-if/
==============

(The chart fortnight by Ulrik “CRM Chart Guy” Carlsson is over but I’m sure he’ll be back! – t.j.)

Sometimes we need to set the value for a field but only if it does not exist, e.g. user did not bother entering it. Like topic for a lead. I’ve seen the implementations where business asked to make it optional and set default to the lead name.

The first instinct is to do something conditional like:

if lead topic does not have value then update lead with a made up topic
Stacked approach works quite well in this scenario as “if without if”, i.e. update topic to itself otherwise use made up default:

The update is now can be bundled with some other manipulations, saving an extra update call but one thing to be aware of that it is unconditional and will trigger both workflows and plugins if any are registered on update of the field (topic in our sample).



Источник: https://crmtipoftheday.com/1104/if-without-if/
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.