AnsweredAssumed Answered

set related modules relate field value to the current modules custom relate field

Question asked by Manisha narwade on Jan 28, 2020
Latest reply on Feb 11, 2020 by Manisha narwade

Hello Everyone,

 

I have a requirement, to bet related modules fields and set to the current record.

I have four modules i.e. Objects, Sub-objects, Units and Projects. I have one to many relationships are:

Objects to Sub-objects module - one to many

Sub-objects to Units - one to many

Projects to Objects - one to many

I don't have direct relationship between Units to Objects module and Units to Project module.

 

Within Objects module, have subpanel for Sub-objects

Within Sub-objects module i have two fields:

1. Objects (Lookup)

2. Project (Custom relate field)

Within Units module, have three fields:

1. Sub-objects (Lookup) 

2. Project (Custom relate field)

3. Object (Custom relate field)

 

So, My question is that, when i am going to create any record for Units module. And on selection of Sub-object (lookup), How to get auto populating value to the Project and Object fields.

 

For ex. 

Object Module have one record named as "Test object one", with selected project (Custom relate field) is "Test Project one".

"Test object one" is linked with Sub-object module record name is "Test Sub-object one".

"Test Sub-object one" is linked with Units module record named is "Test Unit one".

 

And when I open any record from Units module named as "Test Unit one".  As per above information, here is one lookup field i.e. Sub-objects which is by default selected ("Test Sub-object one")

Now i want to auto-populate value to "Project" and "Object" field(Custom)

Project field should selected value is "Test Project one"

and 

Object field should selected value is "Test object one"

because its linked with each other.

 

To achieve this functionality. I have two options i.e. Dependency and Vardefs(Populate-list)

Using vardefs populate_list related objects name is displayed but only for few seconds.

Below are my vardefs file code:

$dictionary['Units_Units']['fields']['pb_part_objects_units_units_1_name']['populate_list']['obj_objects_pb_part_objects_1_name']='objects_name'; //populate SUB OBJECT module's OBJECT field to objects_c field of Unit module

$dictionary['Units_Units']['fields']['pb_part_objects_units_units_1_name']['populate_list']['obj_objects_pb_part_objects_1_id']='objects_id';

 

pb_part_objects is my Sub-objects module

obj_objects is my Objects module

units_units is my Unit module

 

Any one have solution for this.

Thanks in advance! Francesca Shiekh#

Outcomes