Inheritance modeling in Dynamics CRM

We model self-regulatory objects in MS Dynamics CRM 2015. One example is buildings and part of buildings (Building complex ==> Individual building ==> Entrance ==> Floor ==> Flat).

There are fields such as costcode or the owner of the building. If you have a building with 300 apartments, the whole building can belong to one company, or each apartment belongs to individuals.

What we are looking for is some kind of inheritance of the field values. Thus, for the Owner field, the user should be able to check the box that the "owner" inherits from him the parent record.

We have 20 or 30 fields that can be inherited.

We want to copy the value from the parent because it simplifies the definition of views and reports.

Questions: This has been done before, are there any best practices or a ready-made plugin somewhere?

If I do this, the solution will be like this:

  • For each inherited field, create a xx_myfield_inherit boolean field
  • Check the box and the field is always together on the form.
  • Create some Javascript magicians and plugins:
    • If the checkbox is checked, put the field in readonly mode and copy the value from the parent
    • If the value is changed, check if there are children with a set of inheritance (if this is done using the onchange trigger, which will probably work recursively out of the box)
    • ...

, ( , , , , ).

, , , .

+4
1

30 - "inherit" . .

, () , .

:

  • .
  • .
  • , . ( .)
  • , , . ( , , .)
  • , :
    • , (v.v.).
    • .
    • .

:

  • :
    • PreValidate synchronous create: .
    • PreValidate : , , "inherit" .
    • PostUpdate: .
  • Javascript :
    • / OnChange "inherit" .
    • , .

- , , , CRM 8 ( ).

, , ( CRM Online), 2 . , .

, , . .

+5

Source: https://habr.com/ru/post/1629672/


All Articles