0

I have a custom object X that stores name value pairs. I need to populate a custom object Y which has field names same as the name part of the value. Through visual flow I need to query object X to fetch all name value pair that needs to be moved to object Y. All name value pair in object X are related to through a unqiueID.

So, my thoughts are to fast lookup object X for all records that have the uniqueID. The idea is to gather the results in an Sobject collection. The second part is to do the assignment by viewing the name part of the pair and assigning it's value part to field in object Y.

Please provide suggestions to say if this is the right approach. I am just concerned about three things:

  1. How would the system know how many object X records it has to fetch
  2. Do I need to use a loop to keep searching? I suppose if the results are populated in sObject collection then looping is not required.
  3. The third challenge is assignment i.e. chec if X.name = "abc..." then abc_c=X.value

I think this would require looping for traversing through the sObject collection to populate all of the object Y field.

  • What is the relation between X and Y? Who is parent/who is child? and if they are not related like that, is there any other relationship that binds them? – Mahmood Mar 9 '17 at 11:06
  • they have a look up relationship\ – TWA Mar 9 '17 at 21:28
  • so much simpler in apex – cropredy Mar 11 '17 at 8:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.