• Ben4817
  • NEWBIE
  • 80 Points
  • Member since 2008

  • Chatter
    Feed
  • 3
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 7
    Questions
  • 14
    Replies
I want to add my own logic to the existing save button functionality.  I have task like, after saving the record I want redirect to another page. 
Scenario:  When we create a contact from account page, after saving the contact we will be redirected to newly created contact screen. But I want it to redirect to contact's account screen.
 
any kind of help is appreciated.
  • August 04, 2008
  • Like
  • 0
I'm making a multi-page wizard for people to apply to participate in a program.  I need to track the people that apply through campaigns.  I have run into some strange errors trying to work with the campaign members.  The easiest example that hopefully will represent a larger solution is as follows: 

CampaignMember tempMember = new CampaignMember();

tempMember.CampaignId = PossibleBucket;

 PossibleBucket is a string that is the Id of the campaign to which I want to attach them.  When I try to save this code, I get an unknown Error in Eclipse.  The error message is: "Save error: Unable to perform save on all files: An unexpected error has occurred. Please try again, or check the log file for details."  I've tried to find the error log (Window>Show View>Other>PDE Runtime>Error Log), but I am not finding anything helpful.  Maybe I'm looking in the wrong place.  Does anyone know what the error could be and how I should be doing this?  Thanks in advance.

Message Edited by Ben4817 on 03-28-2009 08:14 PM

I have an s-control for a contact that needs to grab related objects.  It works great on Contacts, but I need it to work on Person Accounts as well.  The API states that the contact Id for the Person Account is stored in the Account.PersonContactId field, but the s-control says that field does not exist.  I need the following to work:

 

var result = sforce.connection.query("Select Id, Name from CustomObject__c where Contact__c = '"+"{!Account.PersonContactId}"' ");

 

I've tried using the account id as was suggested in another thread, but that did not work.  Any help would be appreciated.  Thanks! 

I'm trying to do some updates when a lead is converted.  I have a custom object that is related to a lead, and when the lead is converted, I want my custom object to be related to the new account that is created, or the account to which it is merged.  As I've searched the documentation, all I can find are references explaining how to code the actual conversion, but I just want to do some updates when that happens.  Does anyone have ideas how to do this?  Thanks!
I have written a Visualforce page for support reps to verify basic account info before creating a case.  It is essentially the account edit page with only a few fields visible.  When the rep clicks Save, I want to create a new case with a few values being passed in the URL.  I can do it just fine with a controller, but I have discovered that with Enterprise edition, since we have purchased it and are not using a trial, we can only write controllers in a Sandbox, not our production environment.  Does anyone know how I could make the Save button perform a standard save action and then redirect to a new URL strictly in the Visualforce page?  Please see my code below:

<apex:page standardcontroller="Account" tabStyle="Case">
  <apex:form >
    <apex:pageBlock title="Hello {!$User.FirstName}!" mode="edit">
        Please verify the following information with {!Account.Name}. <br/> <br/>
        <apex:pageMessages />
    </apex:pageBlock>
    <apex:pageBlock >
        <apex:pageBlockSection title="Contact details for {!Account.name}" columns="2">
            <apex:inputField value="{!Account.name}" required="false"/>
            <apex:inputField value="{!Account.phone}" required="true"/>
        </apex:pageBlockSection>
        <apex:pageBlockSection columns="1">
            <apex:inputField value="{!Account.BillingStreet}"/>
            <apex:inputField value="{!Account.BillingCity}"/>           
            <apex:inputField value="{!Account.BillingState}"/>    
            <apex:inputField value="{!Account.BillingPostalCode}"/>   
            <apex:inputField value="{!Account.BillingCountry}"/>                                                  
        </apex:pageBlockSection>
        <apex:pageBlockButtons location="bottom">
            <apex:commandButton value="Verified" action="{!save}"/>
        </apex:pageBlockButtons>
    </apex:pageBlock>
  </apex:form>
</apex:page>

I am trying to write some simple s-controls to override standard buttons.  In my contract, I have added a field for a Contact.  When I am creating a contract from a Person Account, I want to be able to set the Contact through the URL.  I can do a report and see the Contact ID for the Person Account, and I know the field to which it needs to map, but I can't get the field name to be able to assign it.  Does anyone know what to use?  I have tried {!Account.PersonContactId}, {!Account.ContactId}, etc. to no avail.  Thanks in advance!
I am trying to write some simple s-controls to override standard buttons.  In my contract, I have added a field for a Contact.  When I am creating a contract from a Person Account, I want to be able to set the Contact through the URL.  I can do a report and see the Contact ID for the Person Account, and I know the field to which it needs to map, but I can't get the field name to be able to assign it.  Does anyone know what to use?  I have tried {!Account.PersonContactId}, {!Account.ContactId}, etc. to no avail.  Thanks in advance!

This will reflect my novice status, but I am just trying to build a button that will update the Serial Number on an Asset.  I've tried looking for examples and can't find anything that solves my problem.  The button Executes JavaScript and the Content Source is OnClick JavaScript.  Following is the code that I am using, but when I click the button, I get a syntax error:

{!REQUIRESCRIPT("/soap/ajax/8.0/connection.js")}

function updateSerial()
{
var record = new sforce.SObject("Asset");
var newRecords = [ ]; 

record.SerialNumber = {!Account.Product_ID__c};

newRecord.push(c);

result = sforce.connection.update(newRecord);

window.location.reload();
}

I'm sure that once I get this figured out, I'll be able to do most of the rest of what I need to do.  Thanks in advance for any help!

I'm making a multi-page wizard for people to apply to participate in a program.  I need to track the people that apply through campaigns.  I have run into some strange errors trying to work with the campaign members.  The easiest example that hopefully will represent a larger solution is as follows: 

CampaignMember tempMember = new CampaignMember();

tempMember.CampaignId = PossibleBucket;

 PossibleBucket is a string that is the Id of the campaign to which I want to attach them.  When I try to save this code, I get an unknown Error in Eclipse.  The error message is: "Save error: Unable to perform save on all files: An unexpected error has occurred. Please try again, or check the log file for details."  I've tried to find the error log (Window>Show View>Other>PDE Runtime>Error Log), but I am not finding anything helpful.  Maybe I'm looking in the wrong place.  Does anyone know what the error could be and how I should be doing this?  Thanks in advance.

Message Edited by Ben4817 on 03-28-2009 08:14 PM

I have an s-control for a contact that needs to grab related objects.  It works great on Contacts, but I need it to work on Person Accounts as well.  The API states that the contact Id for the Person Account is stored in the Account.PersonContactId field, but the s-control says that field does not exist.  I need the following to work:

 

var result = sforce.connection.query("Select Id, Name from CustomObject__c where Contact__c = '"+"{!Account.PersonContactId}"' ");

 

I've tried using the account id as was suggested in another thread, but that did not work.  Any help would be appreciated.  Thanks! 

I want to convert DateTime Value to Date Value , Please help me out ????????????
I'm trying to do some updates when a lead is converted.  I have a custom object that is related to a lead, and when the lead is converted, I want my custom object to be related to the new account that is created, or the account to which it is merged.  As I've searched the documentation, all I can find are references explaining how to code the actual conversion, but I just want to do some updates when that happens.  Does anyone have ideas how to do this?  Thanks!
I want to add my own logic to the existing save button functionality.  I have task like, after saving the record I want redirect to another page. 
Scenario:  When we create a contact from account page, after saving the contact we will be redirected to newly created contact screen. But I want it to redirect to contact's account screen.
 
any kind of help is appreciated.
  • August 04, 2008
  • Like
  • 0
I have written a Visualforce page for support reps to verify basic account info before creating a case.  It is essentially the account edit page with only a few fields visible.  When the rep clicks Save, I want to create a new case with a few values being passed in the URL.  I can do it just fine with a controller, but I have discovered that with Enterprise edition, since we have purchased it and are not using a trial, we can only write controllers in a Sandbox, not our production environment.  Does anyone know how I could make the Save button perform a standard save action and then redirect to a new URL strictly in the Visualforce page?  Please see my code below:

<apex:page standardcontroller="Account" tabStyle="Case">
  <apex:form >
    <apex:pageBlock title="Hello {!$User.FirstName}!" mode="edit">
        Please verify the following information with {!Account.Name}. <br/> <br/>
        <apex:pageMessages />
    </apex:pageBlock>
    <apex:pageBlock >
        <apex:pageBlockSection title="Contact details for {!Account.name}" columns="2">
            <apex:inputField value="{!Account.name}" required="false"/>
            <apex:inputField value="{!Account.phone}" required="true"/>
        </apex:pageBlockSection>
        <apex:pageBlockSection columns="1">
            <apex:inputField value="{!Account.BillingStreet}"/>
            <apex:inputField value="{!Account.BillingCity}"/>           
            <apex:inputField value="{!Account.BillingState}"/>    
            <apex:inputField value="{!Account.BillingPostalCode}"/>   
            <apex:inputField value="{!Account.BillingCountry}"/>                                                  
        </apex:pageBlockSection>
        <apex:pageBlockButtons location="bottom">
            <apex:commandButton value="Verified" action="{!save}"/>
        </apex:pageBlockButtons>
    </apex:pageBlock>
  </apex:form>
</apex:page>

I am trying to write some simple s-controls to override standard buttons.  In my contract, I have added a field for a Contact.  When I am creating a contract from a Person Account, I want to be able to set the Contact through the URL.  I can do a report and see the Contact ID for the Person Account, and I know the field to which it needs to map, but I can't get the field name to be able to assign it.  Does anyone know what to use?  I have tried {!Account.PersonContactId}, {!Account.ContactId}, etc. to no avail.  Thanks in advance!

This will reflect my novice status, but I am just trying to build a button that will update the Serial Number on an Asset.  I've tried looking for examples and can't find anything that solves my problem.  The button Executes JavaScript and the Content Source is OnClick JavaScript.  Following is the code that I am using, but when I click the button, I get a syntax error:

{!REQUIRESCRIPT("/soap/ajax/8.0/connection.js")}

function updateSerial()
{
var record = new sforce.SObject("Asset");
var newRecords = [ ]; 

record.SerialNumber = {!Account.Product_ID__c};

newRecord.push(c);

result = sforce.connection.update(newRecord);

window.location.reload();
}

I'm sure that once I get this figured out, I'll be able to do most of the rest of what I need to do.  Thanks in advance for any help!