• Fresh
  • NEWBIE
  • 25 Points
  • Member since 2008

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 15
    Replies
Hi All,

I apologize if my question has been asked many times. Please point me to the right article. Thanks.

I have an opportunity trigger that accepts or rejects changes (close date) based on today's date. I need to know how to temporarily set the today's date to a particular date while testing the trigger, similar to System.RunAs() method that allows me to execute codes under a certain user's profile, except this is to "pretend" the codes are executed on a particular date?. Can someone show me the trick?

Thanks.

=Alex
Hi all,

I'm new to Javascript, and I wrote a code that is creating a case, filling in fields, saving the case, and then bringing the user to the edit screen. This script works perfectly as long as I'm logged in as an Admin, works perfectly if I'm logged into a Standard User through Admin Login access, but when I actually sign out of SFDC and sign in as my test user, I'm receiving the error message:

'A Problem with the OnClick JavaScript for this button or link was encountered: 'sforce' is undefined'

The code is below:

--------------------------------------------------------------
var cCase = new sforce.SObject("Case");
cCase.AccountId = "{!Account.Id}";

//Emails
cCase.RecordTypeId = "012500000009RrS";
cCase.Ajilon_CC_Email__c = "{!Account.Ajilon_CC_Email__c}";
cCase.Ajilon_FOL_Email__c = "{!Account.Ajilon_FOL_Email__c}";
cCase.E_T_Email__c = "{!Account.ET_Email__c}";
cCase.General_Staffing_Email__c = "{!Account.General_Staffing_Email__c}";
cCase.LHH_Email__c = "{!Account.LHH_Email__c}";
cCase.Subject = "Account Team Request for {!$User.FirstName} {!$User.LastName} on {!Account.Name}";

var createResult = sforce.connection.create([cCase]);

if (createResult[0].getBoolean("success"))
{
var TheEditPage = "/" + createResult[0].id + "/e";
window.parent.location.href = TheEditPage;
}
else
{
alert("Operation Failed")
//Find a way to display error. Maybe use window.alert()
}

---------------------------------------------------------------

If anyone has run into this before, or can figure out what is causing this and how I can fix it, it would be very much appreciated.

Thanks in advance!
  • August 15, 2008
  • Like
  • 0
Hi All,

I apologize if my question has been asked many times. Please point me to the right article. Thanks.

I have an opportunity trigger that accepts or rejects changes (close date) based on today's date. I need to know how to temporarily set the today's date to a particular date while testing the trigger, similar to System.RunAs() method that allows me to execute codes under a certain user's profile, except this is to "pretend" the codes are executed on a particular date?. Can someone show me the trick?

Thanks.

=Alex
I'm new to using Saleforce. I have the Professional version and am the sole user (and administrator) at my company. I'd like to be able to add the occasional photo (mug shot) to my Leads. And ideally I'd like it to appear up top in the "Lead Detail" section, near the name. Any one know how to do that?

~Thanks~
I've been looking through some other posts but struggling with a solution for this, and I'm running short on time, so sorry if I've overlooked another post to answer this.  I'm not terribly technical, but know just enough to get myself into trouble trying.
 
I have two custom fields in our Leads tab.  Field A is a pick-list with about 15 different codes, such as AW, AIM, ATP, DC, GH, etc...  Field B I'm trying to populate automatically with specific (and of course non-variable) information related to those codes in Field A, but the information is not stored anywhere else in Salesforce. 
For example;
IF Field A=AW, then Field B= Abcdefg 
                                                123456789
                                                Abcdefg
 
We need the information to populate on up to 4 different lines in the field.  We would then include Field B to include with an extended mail merge.
 
Any help is very much appreciated.
   


Message Edited by dstonesifer on 08-20-2008 12:33 PM
Hi There,

I have a bank of images that I will be uploading to Documents in sfdc. I will then be creating a Image formula field in a Custom object, where I would like to source the correct Image based upon certain parameters. These will more than likely be based on infor captured in 2 Text fields.

Is there any way to do this without having to specify the unique URL for each seperate Image/Document in the custom formula field? Could you reference the correct image based upon the name of the Document and a keyword or similar?

Any help will be much appreciated!

Thanks

J
  • August 20, 2008
  • Like
  • 0
Hi there,
 
I have a custom field for my leads called "Email Not Valid". It is a checkbox, and when checked, it means that the email address is not valid, based on previous emails bouncing. Pretty straightforward. I also have the same field for my contacts. The problem I have is that when I convert a lead to a contact, that field does not carry over and stay checked off. Is there any way that I can link the two custom fields to carry over?
 
Thanks

I am working on another validation rule.  While no syntax errors appear I am still able to change the stage of the opportunity to Close Won without the required fields. 

 

In essence what I would like is for the following fields to be required when the opportunity stage equals Close Won.  I provided the field name in red.

1.    Primary Activity must be completed (this is a picklist value) Activity_c

2.    NAICS Code must be completed (this is a look up field) NAICS_Code_c

3.    # of Jobs must be completed (this is a number field) of_Jobs_c

4.    Amount of investment must be completed (this is a currency field) Amount

5.    The Account Name cannot be CONFIDENTAL (this is a look up text field) Account.Name

 

Currently I have the following validation rule active.  No syntax errors appear however, I don’t get the results I need.  I have omitted the investment and account name from this validation rule because when I include them I get errors.  It is as if it does not want to accept the field type in my validation rule.  Can someone please provide assistance?  I cant seem to understand what I am doing wrong here.

 

AND(
ISPICKVAL(StageName, "Close Won"),
OR(
ISPICKVAL( Activity__c , ""),
of_Jobs__c < 0,
LEN( NAICS_Code__c ) = 0
))

  • August 18, 2008
  • Like
  • 0
Hi all,

I'm new to Javascript, and I wrote a code that is creating a case, filling in fields, saving the case, and then bringing the user to the edit screen. This script works perfectly as long as I'm logged in as an Admin, works perfectly if I'm logged into a Standard User through Admin Login access, but when I actually sign out of SFDC and sign in as my test user, I'm receiving the error message:

'A Problem with the OnClick JavaScript for this button or link was encountered: 'sforce' is undefined'

The code is below:

--------------------------------------------------------------
var cCase = new sforce.SObject("Case");
cCase.AccountId = "{!Account.Id}";

//Emails
cCase.RecordTypeId = "012500000009RrS";
cCase.Ajilon_CC_Email__c = "{!Account.Ajilon_CC_Email__c}";
cCase.Ajilon_FOL_Email__c = "{!Account.Ajilon_FOL_Email__c}";
cCase.E_T_Email__c = "{!Account.ET_Email__c}";
cCase.General_Staffing_Email__c = "{!Account.General_Staffing_Email__c}";
cCase.LHH_Email__c = "{!Account.LHH_Email__c}";
cCase.Subject = "Account Team Request for {!$User.FirstName} {!$User.LastName} on {!Account.Name}";

var createResult = sforce.connection.create([cCase]);

if (createResult[0].getBoolean("success"))
{
var TheEditPage = "/" + createResult[0].id + "/e";
window.parent.location.href = TheEditPage;
}
else
{
alert("Operation Failed")
//Find a way to display error. Maybe use window.alert()
}

---------------------------------------------------------------

If anyone has run into this before, or can figure out what is causing this and how I can fix it, it would be very much appreciated.

Thanks in advance!
  • August 15, 2008
  • Like
  • 0
I'm trying to create a Workflow rule which does the following:
 
When a new record is created the workflow will search to find a previously created record which is related to the new record and then take the value in a field from the new record and update the corresponding field on the old record.
 
Or more specifically...
1) When a new Sales Order is created in my ERP system our integration tool creates a "Sales Order" record in Salesforce. We are using the Scribe integration tool and Sales Order object that they have implemented.
 
2) One of the fields on the Sales Order record is "Fulfillment Date" which comes over as blank.  Weeks later when the order actually ships the ERP creates an "Invoice" record in Salesforce in which the "Fulfillment Date" is now filled in with the shipping Date.
 
3) There is a field on both the Sales Order and Invoice record called "Master Number" which effectively ties these two records together.
 
What I want to be able to do is take the value from the "Fulfillment Date" field on the Invoice record and populate it onto the "Sales Order" record.
 
Any help or suggestions would be greatle appreciated!
 
Mike
Our reps schedule a future activity with the accounts they are working with. Sometimes they will forget to schedule a followup and they loose sight of the account and forget to follow up.
 
Do you know of a way to find accounts that do not have a future activity?
 
I now have a manual weekly audit using an export and excel spreadsheet.
 
Thanks
 
Walter Ross
Legiant
First time poster & new to SFDC.
 
For a contact I am trying to calculate the next anniversary date based on a historical registration date (which could be many years previous), to drive a workflow for a reminder e-mail and follow up task to record owner using the Time Based work flow. 
 
The formula that I have used previously, suggested in SFDC documentation (to calculate Next birthday), calculates correctly when using the standard contact Birthdate field, but when I apply the same formula to a custom date field the compilation exceeds the maximum 5000 characters (Error: Compiled formula is too big to execute (5,262 characters). Maximum size is 5,000 characters) 
 
Current formula below and any suggestions on reducing formula size or alternate approaches will be appreciated greatly.
 
IF(MONTH(AppDate__c)>MONTH(TODAY()),DATE(YEAR(TODAY()),MONTH(AppDate__c),DAY(AppDate__c)),
IF(MONTH(AppDate__c)<MONTH(TODAY()),DATE(YEAR(TODAY())+1,MONTH(AppDate__c),DAY(AppDate__c)),
IF(DAY(AppDate__c) >= (DAY(TODAY())),DATE(YEAR(TODAY()),MONTH(AppDate__c),DAY(AppDate__c)),
DATE(YEAR(TODAY())+1,MONTH(AppDate__c),DAY(AppDate__c)))))
 
Regards
 
 
Paul
Hi,
 
I have created a custom Tab called Iinvoices, where i would have multiple Invoices for a single Opportunity.
the Unique field that connects an Opportunity to an Invoice is "Purchase_Order_Number".
 
I am woundering if I can calculate the total of all the Invoices for a particular Purchase_Order_Number.
 
Please help
 
Thanks & regards,
Ganesh SN Lekshman
  • August 09, 2008
  • Like
  • 0
What I'd really like to have is the ability to define a picklist rather than an Auto-Number or a text field as the Name/ID field of a custom object. Since this currently isn't possible, the next best way is to intercept the "New Record" event, offer a page that provides the desired picklist and then populate the Name/ID field in the object's Edit page with the selected value.
 
Here are my problems:
(1) does anybody have a code snippet for creating such a page and populating a picklist with a list of values?
 
(2) does anybody know of a way to pre-populate a read-only (!) field with a customized URL? Populating an editable field in Edit mode is fairly easy, but I just can't figure this out if the field is defined as read-only on the page layout.
 
Any help is appreciated.
 
Thanks,
Erik
I have a custom object with a status field - New, Working, ECO Needed, ECO Created, ECO Released and Closed.

I want to know how long the object stayed in each status.

I am how I accomplish this. History table for this object would obviously capture when the status of the object changed.

However, I can't figure out how to create a report that would calculate the difference between these time stamps.

For example, If I go from New to Working at 10:30 today and then go from Working to ECO Needed at 2:30pm two days from now, I know that
I was in status "Working" for 2 days and 4 hrs.

Another way to do this is to create Fields called "Timestamp when Entered New", "Time Stamp When Entered Working", "Time stamp when Entered ECO Needed".

Set these fields using workflow rules as Now - i.e when object gets a status New, capture that time point.

However, I was hoping there is a more generic way - If i add a new status field, I have to add another custom field etc...

History seemed like the way to go, but seems like one can't manipulate the history table through reports or custom formula fields.





Message Edited by GoForceGo on 07-30-2008 12:54 PM