• Shannon Andreas 21
  • NEWBIE
  • 50 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 15
    Questions
  • 23
    Replies
Hello!

would appreicate some guidance here. I have two custom buttons which pretty much do the same thing. One is on the Case object and one is on the Task object. Both buttons pre-populate information. The problem is the task button creates the tasks before save as well as on cancel. The case button throws an error (see below. I tried new code to see if I could correct the save issue).


Case Javascript button. Results insert task regardless of save or cancel.

{!REQUIRESCRIPT("/soap/ajax/28.0/connection.js")} 
try{ 
var task = new sforce.SObject("Task"); 
task.Id = "{!Task.Id}"; 
task.Status = "Closed"; 
task.RecordTypeId = "01260000000Q7kI"; 
task.WhoId ="{!Case.ContactId}"; 
task.WhatId="{!Case.Id}"; 
task.OwnerId = "{!Case.OwnerId}"; 
task.Priority ="Normal"; 
task.ActivityDate = new Date("{!TODAY()}"); 
task.Subject ="VOC VEP Case Assigned to You for Account {!Case.Account__c}"; 
task.Description="Please click" 

var resultTask = sforce.connection.update([task]); 

if(resultTask[0].success=="true"){ 

var qr = sforce.connection.query("SELECT Id, WhatId, WhoId FROM Task where Id='" + "{!Task.Id}" + "'"); 
var records = qr.getArray("records"); 
window.location = "/00T/e?who_id="+records[0].WhoId + "&what_id="+records[0].WhatId + "&retURL=%2F" + records[0].WhatId; 

catch(e){ 
alert("An Error has Occured. Error: " + e); 
}

Task Javascript button. Results in error: An Error has Occured. Error: TypeError: Cannot read property 'WhoId' of undefined

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

var tskObj = new sforce.SObject("Task"); 
tskObj.Status = "Not Started"; 
tskObj.RecordTypeId ="012Q0000000DIKh"; 
tskObj.WhoId ="{!Case.ContactId}"; 
tskObj.WhatId="{!Case.Id}"; 
tskObj.Priority ="Normal"; 
tskObj.Subject ="VOC VEP Follow Up Request"; 
tskObj.Description="Enter Issue Identification and Delivery Solution details in this section." 

var result = sforce.connection.create([tskObj]); 

if (result[0].success=="false") { 
alert(result[0].errors.message); 
} else { 
var newURL = "/" + result[0].id + "/e?retURL=%2F{!Case.Id} "; 
window.top.location = newURL; 
}

Thanks for your help!

Shannon

Hello Friends!

I am in need of some help. I have been wracking my brains trying to figure out how to create a validation rule that will work for the below scenario.

Desired steps and outcome:

1. Enters new oppty & saves.
2. Enters products (w pricing) using Products related list.
3. Amount field (on Oppty in $) auto-calculated based on products and pricing entered.
4. Contract Terms entered into related object called Contract Terms.
5. Contract Terms Total field (Rollup Summary on Oppty in $) auto-calculated based on Terms entered.
6. If Contract Terms Total does not equal Amount, validation rule should trigger.

Sounds like it should be easy, but it is not because the error would continue to fire every time I add another Term. Unless the Term equaled the amount on the Contract Term entry.

NOTE: There can be multiple Contract Terms that should all roll up into the Contract Terms Total field.

I hope this makes sense? Please let me know if you can help.

Thanks!


Shannon

Hello Friends!

I need your help! I have scoured through all of the posts regarding Date/Time conversion to Time plus Daylight Savings Time/Standard Time. I can't find a formula that fits my situation. These are the fields:

Start Date/Time: 08/16/2017 3:00 PM 
New Custom Field: 3:00 PM (would this be Date/Time formula field or text field?)

The formula will have to consider DST, in this case, Central Daylight Time as well as Central Standard Time.

The difference between GMT and CDT is -5
The difference between GMT and CST is -6

I would prefer a formula field if I could, but if someone has apex code and that is the only solution, then I would be happy with that as well.

Thanks in advance for your help,

Shannon
Our company currently has several businesses utilizing one Salesforce org. Most need to have the reference Id placed in the Subject and Body; which is how it is globally setup. We have one business that would like to utilize Email to Case, but cannot because they DO NOT want the reference Id in the subject line; they mainly deal with customers regarding sales questions.

Is there a way, declaratively or programmatically to remove the subject reference id or "hide" it based on a profile or email template?

The option to make the change globally is off the table.

Thanks for your help!

Shannon
Hello Friends!

I created a javascript button that is supposed to create a case and fill in certain fields. All fields fill in EXCEPT for the subject field (see highlighted below).

I checked field level and view accessibility, all seems to be fine. What am I missing? Subject is a standard field does that have anything to do with it?

Thanks!!

Opportunity Custom Button or Link: Request Sell2Lease Offer ~ Salesforce - Unlimited Editionwindow.location ="/500/e"
+ "?retURL=%2F500%2Fo"
+ "&def_account_id={!Account.Id}"
+ "&nooverride=1"
+ "&RecordType=012m00000004mnb"
+ "&ent=Case"
+ "&Subject='Sell2Lease Offer Request'"

+ "&00Nm00000014qnb={!Account.Lease_Customer_or_Prospect__c }"
+ "&00Nm00000014qtZ={!Opportunity.Type}"
+ "&00Nm00000014qtj={!Opportunity.Lease_Type__c}"
+ "&00Nm00000014wre={!Account.Main_Lease_Contact__c}"
So...I created a checkbox formula field on a case that clicks true if the following criteria are met:

IF( (TODAY()> Contact_Cust_Identify_Issues__c ) && ISBLANK(Contacted_Customer_Date__c) 
,true,false)

I then created a workflow that SHOULD trigger an email and create a completed task that states the email was sent. I chose to have the workflow evaulate each time the case meets criteria. The workflow is not firing. 

Here is the workflow rule:
(Case: Case Record TypeEQUALSCase; VOC Response Plan) AND (Case: > 2 DaysEQUALSTrue) AND (Case: StatusEQUALSNew)

Is the formula field update not considered an edit? What am I doing wrong here? I feel dumb because this seems so simple.

Please help,

Shannon
Hello!

Here is the formula I am using:

"$" & IF( 
  Lease_PB_Total_Price__c >= 1000000, 
  TEXT(FLOOR( Lease_PB_Total_Price__c  / 1000000)) & ",", 
  "") & 
IF( 
  Lease_PB_Total_Price__c >= 1000, 
  RIGHT(TEXT(FLOOR(Lease_PB_Total_Price__c / 1000)), 3) & ",", 
  "") &
RIGHT(TEXT(FLOOR(Lease_PB_Total_Price__c)), 3) & "." &

IF( 
  MOD(Lease_PB_Total_Price__c , 1) * 100 < 10, 
  "0" & TEXT(ROUND(MOD(Lease_PB_Total_Price__c , 1), 2) * 100), 
  TEXT(MIN(ROUND(MOD(Lease_PB_Total_Price__c , 1), 2) * 100, 99)) 
)

Here is the result:

$30,628.00

I want to lose the ".00"

I tried rounding but do not think I can round with text?

Please help and thanks!

Shannon

 
Hello Friends!

How would I edit this formula to reflect a date of 10 days days after created date? It currently covers 48 hours or 2 business days.

CASE( MOD( DATEVALUE( CreatedDate ) - DATE( 1900, 1, 7 ), 7 ),
  0, CreatedDate + 1 + 2, /* Sun: CreatedDate + 1 wknd day + 2 days */
  4, CreatedDate + 2 + 2, /* Thurs: CreatedDate + 2 wknd days + 2 days */
  5, CreatedDate + 2 + 2, /* Fri: CreatedDate + 2 wknd days + 2 days */
  6, CreatedDate + 2 + 2, /* Sat: CreatedDate + 2 wknd days + 2 days */
  CreatedDate + 2 /* Default (Mon/Tue/Wed): CreatedDate + 2 days */
)

Thanks!!!
Hi,
I'd like to set up the email notification for the task update. Once the Comments or Status field in the existing task has been updated by someone else, it can trigger the email notification to send to the task owner. Can it be done by the Apex Coding? 

I've created a VF page to replace the standard case detail page that uses tabs to show related records from related objects (Assets, Service__c).  I would like to show the case team on it's own tab but I can't seem to get the relationship name.  Everything I try returns the dreaded "'XXXXXX' is not a valid child relationship name for entity Case".

 

My code is pretty simple:

 

		<apex:tab label="Team" name="TeamList" id="tabTeamList">
			<apex:relatedList subject="{!thisCase}" list="TeamMembers" />
		</apex:tab>	

 I used Eclipse schema browser to get to relationship name "TeamMembers", I also tried the child relationship "TeamTemplateRecords" but get the same error. 

 

I did search the forums and about the only suggestion was to ensure the related list is present on the standard detail page which I've done.

 

Does anyone know what relationship name to use?

Hi,

I had EmployeeBefore and EmployeeAfter triggers. I deleted them from Eclipse but how do I get rid of it in SF. I created a new trigger called EmployeeTrigger. When I run tests it is still executing those two deleted triggers along with Employee Trigger. So for some reason I need to delete it from Salesforce. Under src, I right clicked on Triggers and said save to server but it is still executing both before and after triggers.


Quick help would be appreciated.

thanks in advance,
kathyani