3

I have the following URL hack but it is not working any ideas? The Asset.Account is a lookup field, is that the issue?

/02i/e?CF00NW0000000mpDu={!Asset.Account}&CF00NW0000000mpDu_lkid={!Asset.AccountId}

  • 2
    What exactly do you mean by "it is not working?" Please be more specific. – Adrian Larson May 19 '15 at 14:10
  • 1
    check what the following fields are returning. {!Asset.Account} , {!Asset.AccountId} by placing them in the alert. one more correction in your URL you closed } for Asset.Account twice. try to correct it. If this answers I post it as solution let me know. – Suresh May 19 '15 at 14:11
  • Where is the button located? You are opening the Asset edit page, so this would mean that you have a button on Asset that tries to create a new Asset and puts the Asset.Account into some other custom lookup field? – Robin De Bondt May 19 '15 at 14:28
2

Looks like "{!Asset.Account}}" contains an extra "}".

Hope this is the issue.

  • Just a post copy issue there, no }} in my actual URL – BCBART May 19 '15 at 14:19
  • Where are you trying to use the URL? Can you provide more details? – Ruslan Vekua May 19 '15 at 14:30
1

You need to do a URLENCODE of Asset.Account. It is not working because your account has a White Space, ',' that the Browser can't resolve.

Your correct URL is
/02i/e?CF00NW0000000mpDu={!URLENCODE(Asset.Account)}&CF00NW0000000mpDu_lkid={!Asset.AccountId}

  • Ok here is where I am with this now, I realized I needed to make some changes to my original , The Custom Object is Deployment, I wnt to populate the Account field when I create a new Asset record which is a related list on Deployment/02i/e?CF00NW0000000mpDu={!URLENCODE (Deployment__c.Account_Name__c)}&CF00NW0000000mpDu_lkid={!Deployment__c.Account_NameId__c} – BCBART May 20 '15 at 16:40
  • you need create a cutom button in the asset object with your url => '/02i/e?CF00NW0000000mpDu={!URLENCODE (Deployment__c.Account_Name__c)}&CF00NW0000000mpDu_lkid={!Deployment__c.Account_Nam‌​eId__c}'. In the button you need specify that is a List button. After that you need modify deployment's page layout => go related list => modify and add the new button. – Torsen May 22 '15 at 9:06
  • Still having trouble the Account Field on the Assets does not populate from the Account field on Deployment when I create a new Asset record. – BCBART May 28 '15 at 18:13
1

Missed a '+' sign between the two field values. It's always encouraged to pass the field id's dynamically to avoid problem when it's moved to production.

var url="/02i/e?CF00NW0000000mpDu={!Asset.Account}"+"&CF00NW0000000mpDu_lkid={!Asset.AccountId}"

Pass lookup field Id dynamically on button click

How to get the entity ID for a custom field in Apex?1

  • 1
    You can find the difference and btw this is not from any dumps, Ask further help from experts who are here judge the answer. – SFDC Oct 24 '17 at 5:11

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.