The interesting thing was that it works in CRM 2016 Online Update 1 for legacy form rendering but fails in case of new form rendering (turbo form).
For turbo forms, we get the following objects as null
I couldn’t find any workaround of implementing the same in case of turbo forms. The only possible solution that I could think of is either using Quick View Form with Subgrid control inside it or through a html web resource.
Hope it helps..