function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
jbardetjbardet 

pre-populating Quote Name / overriding button question

I'd like to override the new button on Salesforce to pass in text to the standard Quote Name field. Right now we manually type in pretty Quote Names (text field), ie CustomerName-001, and this requires us to manually search our database for the next sequential number to use.

 

I found this blog post which is the basic principle of what I'm trying to do...

<!-- This example helps you out to pre-populate the account field in the new contact creation -->
<html>
<script type="text/javascript" src="/soap/ajax/15.0/connection.js" > </script> 
<script type="text/javascript" src="/js/functions.js"></script>
<script type="text/javascript">
function LoadingA()
{
try{
var returnURL = '{!$Request.retURL}';
var f= parent.document.createElement('form');
f.method='post';
f.target='_top';
var ch=parent.document.createElement('input');
ch.id='accid'; //This is the id of that component
ch.name='accid';
ch.value='0015000000Upz3h';//This is the real value which you would like to populate on the account lookup
f.appendChild(ch);
parent.document.body.appendChild(f);
f.submit();
}catch(error){
alert('error :'+error);
}
}
</script>
<html>
<body id="thisBody" onload=LoadingA();>
<body>
</html>
I'm interested in doing something like the above post, but instead auto populate the Quote Name, but obviously instead of hard coding it like the code above, we will pull info from the contact record as well as an auto-number field on the quote record. 
(and of course, we'll need the current standard functionality that brings over the opp's primary contact role as the Quote To contact.
So it would look like:  Contact_Field__c--Auto_Number =  ContactText--0237 
help would be very much appreciated!! thanks all, you guys rock.
SFDCDevQASFDCDevQA

Did you ever get an answer on this?  Or figure this out?  I'm interested in doing something like this as well. I've done other custom buttons but I can't find any documentation on the coding behind the quote fields.

jbardetjbardet

Yeah I did actually! A developer I worked with gave me everything I needed.

 

Feel free to get in touch with me on gmail. jbardet@gmail.com

 

I'll provide code and we can talk about it. It has saved our sales team lots of time and eliminated stress and confusion!