0

Is there a way I can lookup an User based on Id/ name I want to achieve the following

1) Object A has User lookup when the User lookup changes I am using a formula on related object to Object A to populate the ID/name of the lookup

2) I do not want to use a trigger. I want to associate the lookup populate on the object B based on Object A lookup changes.

Please point me if there is a simple solution,

I tried to trigger a workflow based on formula change. (bummer can't do this, still tried for nothing)

  • I know this is easy to do using a trigger,but the problem is I will have to run into synch/asynch considerations.As well I am trying to minimize apex as much possible – Rao Oct 3 '12 at 16:45
  • Don't think there's an option that doesn't result in apex code – Salesforce Wizard Oct 3 '12 at 16:46
  • @SalesforceWizard :((tears as usual) – Rao Oct 3 '12 at 16:47
  • You can use @future and avoid mixed dml .Even i am sure no other go than trigger – Mohith Shrivastava Oct 3 '12 at 18:04
0

If you don't need the dependent field to be a lookup but can satisfy your need by using a cross object formula to display the information then your best doing that. Otherwise it will have to be a really simple trigger I'm afraid. What are your specific resevations about a trigger. Is having a filtered lookup to get the user to select the second lookup an option at all?

  • The problem with trigger is 1) The user may have 1000's of object A related records (which pushes me to asynch jobs) and there is already an asynch job thats getting kicked off of the object A. (run into limits) 2) Trying to see if there is any way to populate lookup on object A based on lookup B. Formulas are not helpful cos I cannot created a lookup on formulas. Easy and simple solution I want is to know if there is any way to copy on change lookup A on object A to lookup B on object B related to A on change – Rao Oct 3 '12 at 20:12
  • What I was trying to get at is do you really need it to be a lookup on Object B. or can it just be a plain cross object formula field If all you want to do is display a value. – techtrekker Oct 3 '12 at 20:42
  • The other end of the spectrum If you think you're going to break limits is to write an apex batch class which processes object b to update the lookup periodically. – techtrekker Oct 3 '12 at 20:44
  • It needs to be a lookup. :(. writing code is always an option. was curious if it could be done otherwise – Rao Oct 3 '12 at 20:45
1

Unfortunately you can't trigger a workflow rule unless the record is saved. Formulas change dynamically and do not require a save.

Are you able to use "Reevaluate workflow Criteria" and use a checkbox to act as a switch so to speak? you could use a regular text field rather than a formula as well.

Run an export of all the records that are of the object with the formula. Change it to a text.

Set a Workflow Rule to update the text field with the same information the formula was using. It will also check a checkbox that's not visible on the page layout. This will reevaluate workflow criteria. Then set a workflow that the requirement is that checkbox is true. It does the other action and also sets the checkbox to false.

Run the import. be careful how many workflow rules you're goign to trigger, my recommendation is if it's going to be a lot on the import, turn off any email notifications, etc. and run the import in smaller batches.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.