• NewbyVF
  • NEWBIE
  • 10 Points
  • Member since 2013

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 5
    Questions
  • 5
    Replies
I have a button on Lead records that will create a new record and prepopulate fields from the lead to the New record in a custom object, redirect to the new record to edit and complete.  It works fine except for I want it not to automatically save the record until the user clicks save on the newly created record, because they need to be able to cancel and no record created.  Below is my current code.
var Order = new sforce.SObject('New_ad_sales__c');


Order.Name = '{!Lead.Company}';
Order.Contact_First_Name__c = '{!Lead.FirstName}';
Order.Contact_Last_Name__c = '{!Lead.LastName}';
Order.email__c = '{!Lead.Email}';
Order.Advertiser_phone__c = '{!Lead.Phone}';
Order.billing_address__c = '{!Lead.Street}';
Order.city__c = '{!Lead.City}';
Order.state__c = '{!Lead.State}';
Order.zip__c = '{!Lead.PostalCode}';
Order.cell_phone__c = '{!Lead.MobilePhone}';
Order.LeadSource__c = '{!Lead.LeadSource}';


result = sforce.connection.create([Order]); 
var newurl = window.open.href

if(result[0].getBoolean("success")){
window.location = "/" + result[0].id + "/e";
}else{
alert('Could not create record '+result);
}
I would like to not allow attachments if a field, like  "Order Status"  equals "Processed".  Is there anyway of doing this?
I have a list of contacts displaying in a pageblock table on an object.  Would like to have user select row and the one column get copied so that the user can just go to the other field and ctrl V.  Or is there another way?


I have a related object "Sales_Schedules" on the Contract object.  I would like to have a link
that would show a VF page that lists all the contacts on the Account.

 Is there any way of doing this?

I have created a custom button in by standard object that brings up a pdf (VF page).  I am in the process of creating a VF page to replace my standard object page, and want to include my custom buttons.  How do I get them on my new VF page?

  • September 18, 2013
  • Like
  • 0
I have a button on Lead records that will create a new record and prepopulate fields from the lead to the New record in a custom object, redirect to the new record to edit and complete.  It works fine except for I want it not to automatically save the record until the user clicks save on the newly created record, because they need to be able to cancel and no record created.  Below is my current code.
var Order = new sforce.SObject('New_ad_sales__c');


Order.Name = '{!Lead.Company}';
Order.Contact_First_Name__c = '{!Lead.FirstName}';
Order.Contact_Last_Name__c = '{!Lead.LastName}';
Order.email__c = '{!Lead.Email}';
Order.Advertiser_phone__c = '{!Lead.Phone}';
Order.billing_address__c = '{!Lead.Street}';
Order.city__c = '{!Lead.City}';
Order.state__c = '{!Lead.State}';
Order.zip__c = '{!Lead.PostalCode}';
Order.cell_phone__c = '{!Lead.MobilePhone}';
Order.LeadSource__c = '{!Lead.LeadSource}';


result = sforce.connection.create([Order]); 
var newurl = window.open.href

if(result[0].getBoolean("success")){
window.location = "/" + result[0].id + "/e";
}else{
alert('Could not create record '+result);
}
I have a related object "Sales_Schedules" on the Contract object.  I would like to have a link
that would show a VF page that lists all the contacts on the Account.

 Is there any way of doing this?

I have created a custom button in by standard object that brings up a pdf (VF page).  I am in the process of creating a VF page to replace my standard object page, and want to include my custom buttons.  How do I get them on my new VF page?

  • September 18, 2013
  • Like
  • 0