• johnc82
  • NEWBIE
  • 25 Points
  • Member since 2011

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 9
    Questions
  • 19
    Replies

Hello,

 

I'd like to create a formula for a new custom field titled "Launch Date." This formula must populate a date that is exactly 21 weeks past a date I am manually entering into a different custom field titled "Due Date."

 

For example: I enter 5/22/12 as the Due Date and my Launch Date field automatically fills in with 10/16/12.

 

I've never worked with Salesforce formulas before and will appreciate any help given.

 

Best,

Mallory

When a user is created, we have a trigger that creates a record in another object with some user info.  The ID of that new record created is also updated back to the user record in a custom text field to hold for reference.  I'm trying to do a trigger to update a lookup field with that ID that I'm pulling from the text field on the user record.   The trigger is running but the field is not updating.  I assume it's because I'm trying to place a text value in an ID field?

 

Anyone have ideas?

 

trigger UpdateAccountNewLookupField on Opportunity (after update) {
    List<Account> accountList= new List<Account>();
    List<User> userList= new List<User>();
    
    Set<Id> closedOpp= new set<Id>();
    
    for (Opportunity opp: Trigger.new) {
        if(Trigger.oldMap.get(opp.Id).StageName != 'Closed Won' && opp.StageName == 'Closed Won') {

                closedOpp.add(opp.AccountId);
       
        }
    }

for (Account acc: [select Id, Owner.Textfield__c, NewLookupFieldToPopulate__c from Account where Id IN :closedOpp]) {

        if(acc.NewLookupFieldToPopulate__c == ''){
            acc.NewLookupFieldToPopulate__c = acc.Owner.Split_Sales_Rep_ID__c;
        }
    update acc;
    }
}

 

I'm pretty certain this isn't possible within Salesforce.com, but I need to verify.  Is it possible to have a user redirected based on profile, or even placing a url on the users record so that they are redirected there after logging in to Salesforce?

 

For example, I want them to go right to a queue after logging in.  I can take that url and bookmark it and after logging in, it will take me to that queue view.  Can I place a text field on the user record and put the URL to redirect after login? Anyone know of a way to do this?

Anyone have an example of a validation on if a date field is changed, but only force the validation on if it previously had a date in the field?

Does anyone know what time zone the date/time fields are when you export with the data loader? I have a file that shows 3/1/2012 but in sfa it's showing as 2/29/2012.  I thought it was cause of the leap year, but not all records with 2/29/2012 in sfa are showing as 3/1/2012 on the file.

Will I run into any performance issue or any other problem by having the OnChange event on a lot of fields on a VF page? I'm calling a save function in my controller after a change on each field and doing a rerender of that page section.  Is this ok?

Am I doing this correctly? It works, just want to know if there are better ways of doing it.

 

<apex:pageBlockSection id="pageblock1" title="PageBlock" columns="2" rendered="{!object.field__c==true}">                
	<apex:pageBlockSectionItem id="id1" helpText="{!$ObjectType.object__c.Fields.field__c.inlineHelpText}">
	 <apex:outputLabel value="This is a long field label" for="field1" />
	  <apex:inputField id="field1" value="{!object.field1__c}" >                    
		<apex:actionSupport event="onchange" action="{!saveobject}" rerender="pageblock1" />                     
		<!-- Start Error outputPanels -->
			<!-- Check for Null -->
			   <apex:outputPanel rendered="{!object.field1__c != 'Yes' && object.field1__c != 'No'}">
			 <div class="errorMsg"><strong>Error:</strong>&nbsp;You have to select a value.</div>
			   </apex:outputPanel> 
			<!-- Other Criteria-->                   
			   <apex:outputPanel rendered="{!object.field1__c == 'No'}">
			 <div class="errorMsg"><strong>Error:</strong>&nbsp;Requires "Yes" to generate Proposal</div>
			   </apex:outputPanel>
		<!--End Error outputPanels -->                                
	  </apex:inputField>           
	</apex:pageBlockSectionItem>  
</apex:pageBlockSection> 

 

I've searched but no real luck.  Can someone tell me the differences between inputField and inputText?

I have a function in my controller that creates a new case record.  I need this to go through the assignment rules.  How can I do that with this?

 

public PageReference saveandcreateCase() {

        saveallobjects(); 

          Case c =new case();
          c.Opportunity__c=object.Opportunity__c;
          c.AccountId=object.opportunity__r.accountId;
          c.RecordTypeId='01240000000DkcD';
          c.ContactId=UserContactId;
         insert c; 
          
        object.Case__c=c.Id;

        PageReference createCaseReturntoObject= new PageReference('/apex/ObjectPage?Id=' + object.Id);         
        createCaseReturntoObject.setRedirect(true);
        return createCaseReturntoObject; 
        }

 

I have a visualforce page that I'm rendering as PDF.  I have the field set to no decimal and when viewing the actual visualforce page, there is no decimal, but when I view the page I have in PDF format, there is a decimal.  Anyone know how to remove it? Below is a line of one of the fields.

 

            <td width="10%" align="center">{!abc.Additional_Eq21__c}</td>

  • September 30, 2011
  • Like
  • 0

When a user is created, we have a trigger that creates a record in another object with some user info.  The ID of that new record created is also updated back to the user record in a custom text field to hold for reference.  I'm trying to do a trigger to update a lookup field with that ID that I'm pulling from the text field on the user record.   The trigger is running but the field is not updating.  I assume it's because I'm trying to place a text value in an ID field?

 

Anyone have ideas?

 

trigger UpdateAccountNewLookupField on Opportunity (after update) {
    List<Account> accountList= new List<Account>();
    List<User> userList= new List<User>();
    
    Set<Id> closedOpp= new set<Id>();
    
    for (Opportunity opp: Trigger.new) {
        if(Trigger.oldMap.get(opp.Id).StageName != 'Closed Won' && opp.StageName == 'Closed Won') {

                closedOpp.add(opp.AccountId);
       
        }
    }

for (Account acc: [select Id, Owner.Textfield__c, NewLookupFieldToPopulate__c from Account where Id IN :closedOpp]) {

        if(acc.NewLookupFieldToPopulate__c == ''){
            acc.NewLookupFieldToPopulate__c = acc.Owner.Split_Sales_Rep_ID__c;
        }
    update acc;
    }
}

 

Hello,

 

I'd like to create a formula for a new custom field titled "Launch Date." This formula must populate a date that is exactly 21 weeks past a date I am manually entering into a different custom field titled "Due Date."

 

For example: I enter 5/22/12 as the Due Date and my Launch Date field automatically fills in with 10/16/12.

 

I've never worked with Salesforce formulas before and will appreciate any help given.

 

Best,

Mallory

I find that little "Chat" screen on the lower right of all pages in Summer '12 wicked distracting. 

 

It also may block some stuff on the layout I actually want to see.

 

Anyone know if there is a way to turn it off? 

 

Preferably by user and if not for the whole org?

 

-Ken

 

PS

 

Note to SF, there's plenty of room in the blue banner up at the top of the page, if you are going to put it on the page, why don't you put it there where it won't be blocking other page content???

 

 

Hey Guys,

 

I have just moved a custom object from my sandbox to live site. After assigning a VisualForce page for NEW(Standard Buttons), when creating a new record... the visualforce page automatically comes up instead of the record type selection screen. Has anyone come accross this problem? If so is there a solution?

 

B

  • May 17, 2012
  • Like
  • 0

Hi All,

 

I´d highly appreciate if any of you could help me on this...

 

I would like to know if there is a validation rule to prevent users to create an account with a specified type.

 

The reason for this is that that type of account ( lets call it master account type) should be unique by country.

 

So the rule should include, the type and the country whenever the account already exists.

 

Thanks in advance :)

 

Cheers.

Hi Everyone,

 

Could somebody give me an idea on how can automatically pass a product to an opportunity created thru lead conversion.

Currently, I am passing or mapping some values from the lead to the opportunity.

 

i.e. When I converted a lead to account (and at the same time create an opportunity) the address values indicated in my leads will also be captured to the address fields of the opportunity. My problem now is: is it possible to automatically pass a product to the opportunity upon lead conversion? can someone pls help me. :(

 

Thanks in advance.

 

 

Del

I have 2 record types which i have set to different profiles.

A  restricted user creates a record and saves it. When a super user logs in he should be able to see the new created record with the record types assigned to super user and not that or restricted user.

Restricted user has a picklist with 3 values Super user has the same picklist with 6 values.

is it possible when the super user open the record to view craeted by restricted user he be able to see all the picklist values.

  • May 17, 2012
  • Like
  • 0
I want to use the Contacts standard object in a custom app, but I have no need for the Accounts object. How can I overcome having to specify an Account record on the Contacts object every time I create a contact record. Thx
  • May 16, 2012
  • Like
  • 0

In a scenario where I have a field that is required if another is a certain value, is there any way to have the record save in the background without reloading and the user noticing anything? I'm asking cause I want to include the required with an if statement on the other field.

I have a visualforce page that shows fields from multiple objects.  I noticed that when I try to save, it is not saving to the other child objects.  Anyone know how to make this happen?

Below is the error we receive via email.    We are using a web to lead contact form through the salesforce API.

 

The issue is sometimes the web form posts to salesforce, and sometimes the same data on the form doesnt post and we receive this error message. Does anyone know what the issue could be?

----

 

Alert: Salesforce.com experienced the following problem creating the lead below:

Reason: java.sql.SQLException: ORA-20096:
ORA-06512: at "BASHFUL.CUSER", line 2957
ORA-06512: at "BASHFUL.SLEAD", line 1589
ORA-06512: at line 1
: {call sLead.update_leads(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)})}
   Lead Capture Page: Not available.