You need to sign in to do that
Don't have an account?

Custom Button - passing parameters - What am I doing wrong?
a1O/e?
CF00NC00000052E9C={!Quote.Name}&
CF00NC00000052E9C={!Quote.Id}&
CF00NC00000052E4q={!QuoteLineItem.LineNumber}&
CF00NC00000052E4q={!QuoteLineItem.Id}&
CF00NC00000052E68={!Quote.End_User__c}&
CF00NC00000052E68={!Quote.End_UserId__c}&
save=x
This is my custom button, but only the Quote Line Item lookup is populating. I am stumped as to what I am doing wrong.
CF00NC00000052E9C={!Quote.Name}&
CF00NC00000052E9C={!Quote.Id}&
CF00NC00000052E4q={!QuoteLineItem.LineNumber}&
CF00NC00000052E4q={!QuoteLineItem.Id}&
CF00NC00000052E68={!Quote.End_User__c}&
CF00NC00000052E68={!Quote.End_UserId__c}&
save=x
This is my custom button, but only the Quote Line Item lookup is populating. I am stumped as to what I am doing wrong.
Clarification (14 minutes ago)
Right, it's a little tedious to do each one, I won't neccessarily need a custom object on every line item within a quote. That's why I thought this button would do the trick and enough information could be pre-populated then it would lessen the tedious work. I changed the a1O/e? to /a1O/e?retURL={!QuoteLineItem.Id}& but it didn't make a difference. Would it matter that the look up on the quote line item is Master-Detail and on the Custom object is just a lookup? That's the only difference I can find between my Contact-Account/Custom Object example and this current example. |
Clarification (28 minutes ago)
But the quote line item has the Quote lookup on it's record (it's a Master-Detail). So the last situtation where I did this was on a Contact record, I am pulling Contact and Account fields and lookup to a custom object. Isn't that the same thing? |
Clarification (50 minutes ago)
Of course, sorry about that! We use the out-of-the-box quotes and quote line items that Salesforce provides. I have created a custom object that I want to create off of the quote line item record. So this custom button resides within the Quote Line Item object. In my custom object, I have three lookups - Account, Quote & Quote Line Item. All three of these lookups are also either on the Quote Line Item or Quote page, so I thought I could pull them through easy. I thought I had done something similar to this recently on a different object. |
HELP!
Q. Are you trying to prefil fields in this custom object using a custom button?
Yes I would like to prepopulate my fields in the custom object. I have three lookup fields on the custom object that match to the quote and quote line items lookups and I want to pull in that information and populate the fields. The only one I have working is the quote line item lookup.
Ok I understand. It may be easier to use apex here. Yes I thinked it not possible to pull information through which is not directly related.
What version of SFDC are you using?
The problem is I'm more of a button-click developer/admin :). I want to learn the Apex, but that will take me a few months and I need a solution today.
I did something similar with a Contact record, where I put a button on the Contact record, and when the button is clicked it creates a new custom object record which populates with Contact and Account data. Why is it working for me in that situation but not in this one/
Does it make a difference that the Quote to Quote Line Item relationship is Master-Detail where as the Contact to Account is not?
Oh ... to your question, we are on Enterprise. Is that what you were asking?
Just setting this up in dev
Custom Object with Master-detail > Quote?
ignore that - I see from a previous post
My custom object does not have any Master Detail relationships, although I could probably change that if necessary.
I can't get any other parameters to pass other than the quote line item look up. I tried to pass a formula text field into the Record Name and it's not working either.
Can you post your button code please
This is my original code:
a1O/e?
CF00NC00000052E9C={!Quote.Name}&
CF00NC00000052E9C={!Quote.Id}&
CF00NC00000052E4q={!QuoteLineItem.LineNumber}&
CF00NC00000052E4q={!QuoteLineItem.Id}&
CF00NC00000052E68={!Quote.End_User__c}&
CF00NC00000052E68={!Quote.End_UserId__c}&
save=x
Line 2 & 3 was supposed to fill in the Quote Lookup, line 4 & 5 was supposed to fill in the Quote Line Item lookup (this works) and line 6 & 7 was supposed to fill in the Account lookup, which is only available on the Quote page which may be part of my problem. But again my Account-Contact example worked, so it seems like I should be able to at least fill in the Quote and Quote Line Item lookup.
Still here- just playing with this to work within your use case
I hate to be completely ignorant, but can you explain what you posted to me?
I am still working from several different angles on my end for this too, but utilizing the "new custom button" section and trying to pass parameters, nothing is working.
Hey laura, We worked on this issue before. I have a sample of a code we worked on before. use this.
Need to put CF before any look up field & for the _lkid need to use the look up ID field. :))))
For more info you can check this post.
http://boards.developerforce.com/t5/General-Development/custom-button-look-up-issues/m-p/312131/highlight/false#M58098
Let me know if this helps.
Ok, this works for me. (You will need your field names)
You still need to add Account into the mix.
Create the button in the normal way
With Behavior = Execute Javascript
Content Source = JavaScript
Sorry it took so long, I have never done this before. Actually very flexible. I think you should be able to traverse master-detail relationships...
M
Wow, thank you for spending so much time on this. Will you walk me through it a little bit?
Would this be where I would change your code to reflect my custom object?
var qd = new sforce.SObject("CA__Quote_Details__c" );
qd.CA__Quote__c = QuoteId;
qd. CA__Quote_Line_Item__c = QuoteLineId
BTW - the quote is nasty, no natural link to account from it (could be me)
Anyway the up shot is if you can get everything you need onto the object where the button is, then you can query the values and populate your custom object.
I can live without the Account lookup if I can get the quote AND quote line item lookup working. I'll try this is just a bit and see if I can get it working with my changes. Thanks again so much! I need a Java coach to live in my office until I can learn these things :)
This works great for creating a task but can it be modified to actually open the window to record the task rather than creating an open task. I have tried creating the url with the related to prepopulated with a custom object id and I keep getting an error that the url no longer exists. It works fine with your script to create the open activity, but for some reason if I just try to create the url I get nowhere and it is driving me crazy. I would appreciate any help.
This is half way, it creates the tasks and then redirects you to that task.
I'm guessing you probably want to redirect to a new task record?
This is good enough.
Ideally it would just open the page in a simlar way that the "Log a Call" Button does but just prepopulates the fields I need it to.
Thanks for your help.
Create the following new custom buttons under Task Buttons & Links.
for Account records:
/00T/e?title=Phone Call&what_id={!Account.Id}&followup=1&tsk5=Phone Call&retURL=%2F{!Account.Id}
for Contact records:
/00T/e?who_id={!Contact.Id}&followup=1&tsk5=Phone Call&retURL=%2F{!Contact.Id}
Then you should be able to add more parameters that you want to pass through with an "&"