• 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!

Need help with this button. Keeps returning me to the Home tab. How can I make it return to the case where the button began?

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

var tskObj = new sforce.SObject("Task");
tskObj.Status = "Not Started"; 
tskObj.RecordTypeId ="012Q0000000DIKh"; 
tskObj.OwnerId ="{!$User.Id}"; 
tskObj.WhoId ="{!Case.ContactId}";
tskObj.WhatId="{!Case.Id}";
tskObj.Priority ="Normal"; 
tskObj.Subject ="VOC VEP Follow Up Request"; 

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

if (result[0].success=="false") { 
alert(result[0].errors.message); 
} else { 
var newURL = "/" + result[0].id + "/e"; 
window.top.location = newURL; 
}

Thank you!!

Shannon
Hello!

I have created an approval process on the case object as well as a process builder to automatically submit for approval.

User creates and saves the case (Status = New)
Process Builder should kick off and submit for approval.

The approval process has the following criteria:

RecordType = "Tour"; Status = New

Process builder uses the same criteria. The action is Submit for Approval, Does not override entry criteria.

When I save the case record, the process does not kick off with the above criteria.

Now, if I change the process builder to ignore the entry criteria, the process builder kicks off. However, I get tons of flow errors on cases that it should not have run for! I am assuming it is because there is no criteria being checked for record type. I do have this criteria, but chose to ignore. What is going on??

Thanks,

Shannon
 
Does anyone here have experience with SalesforceIQ CRM reporting? If so, can you tell me how I would "build" a report and save it? From what I have read, it looks like you have to use the pre-built reports onscreen. I have a request from a client to build certain reports such as total revenue MTD, QTD, YTD and number of tickets per region per day, etc. 

Is there a way to save multiple reports?

Hopefully someone here is familiar!

Thanks in advance for your help!

Shannon
Hello!

Does anyone have experience with Chatter Blacklist app? I am getting an error (never got it before) that states, Apex Trigger exception: String Too Long. All it is is a cut and paste message from Word to Chatter post (that has been done several times previously). Now we are getting this error? 

Any help would be appreciated?
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!!!
I have this lovely formula field:

"$" & if(TotalPrice<1000,text(round(TotalPrice,2)), 
text(floor(TotalPrice/1000))&","&right(text(floor(TotalPrice)),3))

That does a great job. It takes a number value and makes it text. It also adds a "," and a "$". It works great for any "numbers" from 1000 to 999999. Over a million, not so much. We obviously have to add another ",".

My thought is that we need another if statement, but I cannot seem to get one to work. Can anyone assist?

The end result is anything from 1000-999999 we need one comma. Anything over 1000000, we need two.

Thanks a million!

Shanno9n
Hello friends!

I need your assistance asap. I am trying to write a workflow rule (or trigger, or process flow,etc.).

I need a workflow that recognizes a change in a field on a Customer Account record and depending on the change, updates the account type to Prospect.

The scenario is this:

1.) There is a nightly batch job that runs and feeds 3 fields on the account record with a number. There is also a formula field that sums these 3 fields called Total Fleet#. This field is the one I will be using for this scenario.
2.) Before the batch job runs, there is another job that zeroes out the fields. So the Fleet Total# before job = 7, Fleet Total# after job = 0.
3.) The next batch job then fills in the values again.
4.) If the new values equal 0 after the batch job and had a non-zero value originally, we need the workflow to update the account type to Prospect.

So basically, when the fleet total field is 0, the account is a prospect. 

The problem is that all of the accounts will turn to 0 because of the first batch job. So I need a way to flag these accounts and have the workflow kicks in AFTER the second batch job.

I hope you can follow this! If not, let me know and I will try to explain in another way.

Thanks so much for your help!

Shannon
 
I need help. Not very good at javascript...yet.

I need a button that will reference a URL that is located within the Account record. Sounds simple right? Maybe it is, but it complicates things for me because of the way that it is constructed.

We have two fields on the record: RRID# and RRID URL. The RRID# is a specific number that we need to assign through dataloader (e.g. 12345). The RRID URL is a complex formula field that refers tot eh RRID#:

"https://prod.vendor.com/Report/Index/?rrid="& text(RRID__c) &"&hash=" &
text(CASE(month(today()), 1, 49*1, 2, 48*2, 3, 50*3, 4, 57*4, 5, 50*5, 6, 48*6, 7, 49*7, 8, 53*8, 9, 80*9, 10, 101*10, 11, 110*11, 12, 115*12, 0) + DAY(today()) + mod( RRID__c , DAY(today())))
&"&partnerkey=1234567PenYs"

So basically, the URL would end up looking something like this:

https://prod.vendor.com/Report/Index/?rrid=15&hash=93&partnerkey=1234567PenYs (https://prod.vendor.com/Report/Index/?rrid=15&hash=93&partnerkey=1234567PenYs)

We want users to be able to click a button as opposed to the link in the body of the record. How would I accomplish this?

Thanks in advance for your help!

Shannon
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?

  • August 04, 2011
  • Like
  • 0
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