+ Start a Discussion
Jamie Marshall 4Jamie Marshall 4 

URL Hack - unrelated fields

id hack - pull fields from child for new parent recordMy organization sells cars.

After an opportunity has been won, a child record called "Lease Returns" is created from a related list to track the customer. When the lease is up we need to create a new opportunity and we do so from the opportunities related list on the Lease Returns Object. So there is a 1-1 relationship between this parent and child.

New Opportunity -> New Lease Return -> New Opportnity -> New Lease return -> New Opportunity -> New Lease Return -> etc......

When I create a New lease return I pull info from the preceeding opportunity using formula fields. However when I create a new opportunity everything is blank. 

I've been trying to use URL hacking to prepopulate the New opportunity fields but the child records fields arent reconized. What is the way to do this?

I'm using professional edition
YuchenYuchen
So you have two Objects here, Opportunity and Lease Return, and Lease Return looks up Opportunity and at the same time Opportunity looks up Lease Return?

You are saying that "However when I create a new opportunity everything is blank", are you creating the Opportunity from the related list in Lease Return? If you are, I think you can do the same thing as what you did for "pull info from the preceeding opportunity using formula fields", so you can create some formula fields in Opportunity to pull information from its parent Lease Return.
Jamie Marshall 4Jamie Marshall 4
Thanks for the reply Yuchen. Yes, we are creating the opportunity from the related list. However that doesn't mean the opportunity is a child of the lease return (as far as the model structure is concerned). Formula's arn't a great solution here because opportunities are also created in other ways, but I tried them anyway to see what happened and...  nothing. I think you are assuming a relationship like this:

Opporunity (Parent) -> Lease Return (Child) -> Opportunity (Grand Child) ...

However, I do not believe opportunities can be a child. So the relation ship would be more like this

Opportunity (Parent) -> Lease Return (Child)
New Unrelated Opportunity (Parent) -> Empty Lease Return Record (Child)

In other words I belive the Lease return creates a new opportunity that is an unrelated object. Am I wrong?
How do you reference unrelated material, or performa work around?

I think the answer is a URL Hack, but I don't know much about those formulas
YuchenYuchen
In fact, if you want to make it a chain, you can create a Lookup field on Opportunity and lookup Lease Return, this way you can see the Opportunity related list on the Lease Return Page Layout. So it will look like Opportunity is a child of Lease Return. If you do it this way, you should be able to pick up value from the Position and set it on Opportunity since now they are related.

If you do not want to do it this way, URL Hack may be a choice, you can refer to the following link:
http://raydehler.com/cloud/clod/salesforce-url-hacking-to-prepopulate-fields-on-a-standard-page-layout.html

Or, you can also consider using some custom JavaScript logic or Apex logic to accomplish the requirement.
Jamie Marshall 4Jamie Marshall 4
Thanks for the reply,

1. JavaScript or Apex are out because we are on Professional Edition.
2. I've set the lookup fields like a chain, but the opportunity never behaves like a child. 
3. I've read over that link about URL Hacks, but it doesn't contain anything about unrelated objects. For instance:
     {!Opportunity.Lease_Returns__r.Account_Name__c} will not return a value because it is looking for a child record that does not exist (the lease return child that will be created for that opportunity in the future) not the Lease return record that is spawning this new opportunity. These runtime formulas draw from related records, they don't reconize what spawned the record.... as far as I can tell.

How do these records relate? That is the big question. I cannot seem to pull information from a Lease Return for a new Opportunity. My quesiton is Why?.... and what is the work around?