locked
Changing two fields but just one available on the plugin RRS feed

  • Question

  • Hi all

    here an unexpected situation. CRM 2013. I have created a PreUpdate plugin for a given entity. I need to check the value of two fields to perform a validation, These fields can be changed together, so I need to inspect if current entity has this two values. I have made a test changing both values together, and just one is there, not the other, so the validation fails. Any ideas about why is this happening? I have verified filtering attributes and all seems to be ok,

    Thanks in advance

    Tuesday, March 11, 2014 7:29 AM

All replies

  • Hi Gabriel,

    For the two attribute values to be available in the plugin context, it's necessary that they both have some values assigned to them; meaning if you change a value to null (or blank), you won't get that in the plugin context. In your case, is any of the values blank (after changing)?


    Admin QuikView Solution for CRM 2013

    Tuesday, March 11, 2014 9:34 AM
  • This happens in both scenarios.
    Wednesday, March 19, 2014 11:04 AM
  • Don't forget that autosave can gum up the works here as well, if you have not already disabled it. (user could change one of your fields, then autosave triggers, then you change the other field) Plugin logic needs to be as granular as possible with auto-save. Changes to combinations of dependent fields may sometimes be better validated in the UI nowadays.
    Wednesday, March 19, 2014 3:47 PM
  • Hi,

    First condition is that both fields should contains the value and you can use PreImage for it.

    Thursday, March 20, 2014 4:03 AM