on 04-01-2014 3:19 PM
Hi Experts,
I am using agentry editor and I need some suggestions for the follwoing scenario :
I have 2 objects Employee Details and Departments with collections EmployeeCollection and DeptCollection respectively. Employee details object has a property DeptName which is empty. I want to fill the employee collection with the department name data and display it in a list tile view. The list tile view carries the Employee collection.
I tried to use a sub action which would loop over the department collection and tried to fill department names into the employee collection but was unsuccessful. How can get the value from deptcollection and fill it into the employee collection?.(Is it possible to obtain values from one collection and use them in another.)
p.s. Both the objects have deptName property, other than that there is no connection between the two.
Please provide some suggestions on how to go about this.
Thanks in advance
Amitoj Singh
Amitoj,
If both objects have only a deptName property in common and the employee deptName is always blank to begin, then I don't see how you would know which department names belong to each employee? It seems you would need a department number in both that is populated. Then you could loop over employees in a sub-action and look up the correct department record (based on department number key) and retrieve the department name to store in the employee. Does this sound right to you?
Jason Latko - Senior Product Developer at SAP
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Jason,
Thanks for the reply.
What if my employee collection is empty? In that case can I fill the empty collection property with the department names??
The problem I'm facing is that one of the collections is empty and i want to be able to fetch particular values into the empty collection from another collection property.
Thanks
Amitoj
Amitoj,
Yes that is a common and easy task, but what good is an empty employees collection? Where will the employee names, etc.. come from? Anyway, here is how to accomplish it:
Create a new action LoopOverDepartments.
Loop over your Departments collection in a sub-action step, then finish the LoopOverDepartments with a single Apply that will commit all the added records.
Tie the AddEmployee action to the sub-action.
AddEmployee runs the AddEmployee transaction. This transaction adds a new record to your collection target.
For your deptName property, set initial value to: "From Other Object Property". Then set the other property field using the object browser to "Department Object -> deptName property". This will use the value from the current Department record that we are looping over.
You will also need to provide a unique value for the key property of each record in the Employee collection.
Jason Latko - Senior Product Developer at SAP
User | Count |
---|---|
78 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.