• Tsvety
  • NEWBIE
  • 50 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 13
    Questions
  • 32
    Replies
Hi sfdc experts,

I am trying to lock the Opportunity object when a related object (Commissions) is submitted for approval. The relationship between them is a lookup relationship.
Is there a way to accomplish this without having to create a "Read only" opp. record type or writing triggers?
  • November 07, 2016
  • Like
  • 0
Hi all,

I have created a workflow thorugh the process builder and even though the criteria is not met and the actions associated with it are not created the debug log has a true value. Shuldn't it show as "WF_CRITERIA_END|false", if the criteria were not met? 

16:27:10.0 (12361757)|WF_RULE_EVAL_BEGIN|Workflow
16:27:10.0 (12390917)|WF_CRITERIA_BEGIN|[Commissions: Comp-0494 a4CP0000006Kffs]|Commission_Recipients301P0000000DfOe|01QP0000000DiZB|ON_CREATE_ONLY|0
16:27:10.0 (12568338)|WF_FORMULA|Formula:ENCODED:[treatNullAsNull]true|Values:
16:27:10.0 (12572706)|WF_CRITERIA_END|true
  • November 01, 2016
  • Like
  • 0
Hi experts,

I have an approval process where I have 3 people that can approve. The approval is set as "Approve or reject based on the FIRST response".
Once user 1 approves, I want to remove the approval request from the queue from users 2 and 3.
Is this possible?

Thank you in advance
  • February 27, 2016
  • Like
  • 0
Hi experts,

I have a custom object Submittals and an approval process built for it.

The use case is:
A record was submitted and is pending approval
If a field ("status") on the Submittal is changed to "closed" all pending submittals should be automatically rejected.

How to accomplish this?

Thank you!
  • February 19, 2016
  • Like
  • 0
Hi experts,

I built a workflow that works fine, but when I tried to re-create it using process builder it does not.
What am I doing wrong?

1) Workflow Rule Criteria

AND( 
ISPICKVAL(Location_Country__c, "USA"), 
NOW()< High_Priority_Date_Time__c +30*60/1440, 
RecordType.DeveloperName <> "Internally staffed", 
SLA_met__c = FALSE, 
ISPICKVAL( Approval_history_status__c,"Approved"), 
ISPICKVAL(ts2__Priority__c, "High"), 
ISPICKVAL(ts2__Status__c,"Open"), 
NOT(ISBLANK(ts2__Account__c)))

2) Process Builder Formula

AND( 
ISPICKVAL([ts2__Job__c].Location_Country__c , "USA"),
NOW()< [ts2__Job__c].High_Priority_Date_Time__c +30*60/1440,
[ts2__Job__c].RecordType.DeveloperName <> "Internally staffed",
[ts2__Job__c].SLA_met__c = FALSE, 
ISPICKVAL( [ts2__Job__c].Approval_history_status__c,"Approved"),
ISPICKVAL([ts2__Job__c].ts2__Priority__c,"High"), 
ISPICKVAL([ts2__Job__c].ts2__Status__c,"Open"),
NOT(ISBLANK([ts2__Job__c].ts2__Account__c)))
  • February 14, 2016
  • Like
  • 0
Hi experts,

I am trying to build the following approval processes:

1) Record is submitted for approval to a Related user 
2) Related user has 24 hours to approve/reject.
3) If the Related user does not approve in 24 hours the request goes to User A. 
(User A is the same user for all approvals. User A is not a direct manager or delegated manager of Related User)

How can this be accomplished?
  • February 11, 2016
  • Like
  • 0
Hi,

This might be something simple, but I cannot figure it out.
The below button works for some users and doesn't for others.

Here is the code:


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

if({!ts2__Offer__c.Estimated_Gross_Margin__c}<40)

alert("The margin for this Resource is less than 40%. An automatic request for approval will be sent to the executive team");} 

else{ alert ("Completed"); 
}


Here is the error I get:

User-added image
 
  • January 12, 2016
  • Like
  • 0

Hi,

I would like to create a button on list view so that when the items from the list are selected and the button is clicked, it will add the selected items to another page. On that page there should be the option to remove some of the items if needed.
How can I accomplish this?

User-added image
  • August 17, 2015
  • Like
  • 0
I am trying to create a trigger that will update a field on a Job object every time when a field on Opportunity is changed.

The field on the Job object is an email field and is called "Account Manager email". It should be populated with the Opportunity Owner's email.
(I cannot use a simple formula field for the Account Manager email, because I want to use this field in a workflow)

Will appreciate it if someone can help me write the trigger.

Thanks!
  • August 07, 2015
  • Like
  • 0
Hi Experts!

I would like to add a detail link to a page layout that will be visible/clickable when a record is created/edited. Example:

User-added image

What I tried so far:
- creating a detail page link, but it is not visible in edit mode
- simple url field that is read only, but it is not clickable.

Is there any way to accomplish this?

Thank you!
Hi everyone,

I had created a detailed page button that executes Java Scprit and now I am trying to create exactly the same button, but on a Visualforce page that I will make available for Salesforce1.
Can someone help  me write the code for the Visualforce page?

Detailed Page/JavaScript/ Custom Object - "Travel Request"

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

var tr = new sforce.SObject("Travel_Request__c"); 
tr.id = '{!Travel_Request__c.Id}'; 
tr.Approval_Status__c ='Recalled/Cancelled'; 
var result = sforce.connection.update([tr]); 

if (result[0].success == 'false') { 
alert(result[0].errors.message); 

else { 
location.reload(true); 
}
I have a custom object Offers that pulls data from the Opportunity. I have a field, Expenses covered, on Opportunity and I want to have a field on the Offer that will be updated every time the Expenses covered on the Opportunity is changed.
The problem is that the workflow doesn't trigger even though the value of the formula field is changed.

What I did so far:
Created a text field (Expenses covered new) and a formula field (Expenses covered f) on Offer.

Created a Workflow rule on Offer. 
Entry Criteria (ISCHANGED( Expenses_Covered_f__c ))
Field Update for Expenses covered new = Expenses_Covered_f__c 
Evaluation Criteria; Evaluate the rule when a record is created, and every time it’s edited

Where is the problem?
Hi guys, 
I run into the following issue.

1) I tried to move a new custom object from Sandbox to Production using the change sets
2) When validating I got 2 errors with two of Triggers that don't belong to this object.
3) Read online that the solution is to disable the triggers in Production (I did this by disabling them in sandbox, transferring them to Production using change sets)
4) Did this and with no problem the new custom object passed the test and I was able to deploy it in production
5) As a next step I wanted to activate the triggers in Production so I went to sandbox, activated them, put them in a change set and tried to move them.
Unfortunately when I try to deploy them they don't pass the validation test. 

Before deactivating them the triggers worked perfectly and I didn't touch any of the code.

Here are the errors I am getting:

Class Name: datafloTriggerTest DemoRequestTriggerTest
Method Name: datafloTriggerTest DemoRequestTriggerTest
Error Message: System.DmlException: Upsert failed. First exception on row 0 with id a1n12000000UDgCAAW; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, DemoRequestTrigger: execution of BeforeUpdate caused by: System.DmlException: Delete failed. First exception on row 0 with id 00T1200001lvs5vEAA; first error: FIELD_CUSTOM_VALIDATION_EXCEPTION, Not allowed to Delete Tasks. Please Contact an Admin to Delete.: [] Trigger.DemoRequestTrigger: line 438, column 1: [] 
Stack Trace: Class.datafloTriggerTest.DemoRequestTriggerTest: line 308, column 1

Class Name: datafloTriggerTest
Method Name: taskDeleteTriggerTest
Error Message: datafloTriggerTest taskDeleteTriggerTest System.DmlException: Delete failed. First exception on row 0 with id 00T1200001lvs5wEAA; first error: FIELD_CUSTOM_VALIDATION_EXCEPTION, Not allowed to Delete Tasks. Please Contact an Admin to Delete.: [] 
Stack Trace: Class.datafloTriggerTest.taskDeleteTriggerTest: line 193, column 1

Here is one of the Apex trigger code (datafloTriggerTest). It doesn't allow users from deleting Activities after recorded on the Contact object:

1 trigger TaskTrigger on Task (before delete, before insert) 
2{
3//** Before Insert Trigger **************************************************************//
4   if ((trigger.isBefore) && (trigger.isInsert))
5   {
6       for (Task t : trigger.new)
7        {
8            if (t.Type=='Call')
9            {
10                t.Type='Auto Dialer Call';
11            }
12            // Marketo User
13            if (t.CreatedById=='005A0000001Nrgm')
14            {
15                t.Type='Marketing';
16            }
17        }
18    }   
19    
20//** Before Delete Trigger **************************************************************//
21    if ((trigger.isBefore) && (trigger.isDelete))
22    {
23        Profile myProfile;
24        try
25        {
26            myProfile = [SELECT Id,Name
27                        FROM Profile WHERE Id=:UserInfo.getProfileId()];
28        }catch (Exception E){myProfile = new Profile();}
29        
30        for (Task t : trigger.old)
31        {
32            // Non Sys-Admins not allowed to Delete
33            if (myProfile.Name!='System Administrator')
34            {
35                t.addError('Not allowed to Delete Tasks.  Please Contact an Admin to Delete.');
36          }
37        }
38    }
39}
Hi sfdc experts,

I am trying to lock the Opportunity object when a related object (Commissions) is submitted for approval. The relationship between them is a lookup relationship.
Is there a way to accomplish this without having to create a "Read only" opp. record type or writing triggers?
  • November 07, 2016
  • Like
  • 0
Hi all,

I have created a workflow thorugh the process builder and even though the criteria is not met and the actions associated with it are not created the debug log has a true value. Shuldn't it show as "WF_CRITERIA_END|false", if the criteria were not met? 

16:27:10.0 (12361757)|WF_RULE_EVAL_BEGIN|Workflow
16:27:10.0 (12390917)|WF_CRITERIA_BEGIN|[Commissions: Comp-0494 a4CP0000006Kffs]|Commission_Recipients301P0000000DfOe|01QP0000000DiZB|ON_CREATE_ONLY|0
16:27:10.0 (12568338)|WF_FORMULA|Formula:ENCODED:[treatNullAsNull]true|Values:
16:27:10.0 (12572706)|WF_CRITERIA_END|true
  • November 01, 2016
  • Like
  • 0
Hi experts,

I have an approval process where I have 3 people that can approve. The approval is set as "Approve or reject based on the FIRST response".
Once user 1 approves, I want to remove the approval request from the queue from users 2 and 3.
Is this possible?

Thank you in advance
  • February 27, 2016
  • Like
  • 0
Hi experts,

I have a custom object Submittals and an approval process built for it.

The use case is:
A record was submitted and is pending approval
If a field ("status") on the Submittal is changed to "closed" all pending submittals should be automatically rejected.

How to accomplish this?

Thank you!
  • February 19, 2016
  • Like
  • 0
Our goal is to close cases within 48 hours.  Any idea how we can create a formula field that will incorporate weekends and holidays so reps are not penalized for closing cases that are opened on Friday evening or Holidays?

The field needs to be displayed in hours.  

Our business hours are listed below: 

SaturdayNo Hours
SundayNo Hours
Monday9:00 AM to 6:00 PM
Tuesday9:00 AM to 6:00 PM
Wednesday9:00 AM to 6:00 PM
Thursday9:00 AM to 6:00 PM
Friday9:00 AM to 6:00 PM

 
Hi experts,

I am trying to build the following approval processes:

1) Record is submitted for approval to a Related user 
2) Related user has 24 hours to approve/reject.
3) If the Related user does not approve in 24 hours the request goes to User A. 
(User A is the same user for all approvals. User A is not a direct manager or delegated manager of Related User)

How can this be accomplished?
  • February 11, 2016
  • Like
  • 0
I posted this on Stack Overflow also: http://stackoverflow.com/questions/34804072/auto-add-document-to-docusign-salesforce-using-custom-button

I'm using a DocuSign custom button. I have the document Id of the document I want added into docusign, on my object. Is there a way to automatically add the document using that Id?

The use case is, I'd like my user to hit the send via docusign button, and already have the document and the docusign envelop configured. Currently they have to search for the document, because it's not related to the source record and not in notes and attachments.
Hi,

This might be something simple, but I cannot figure it out.
The below button works for some users and doesn't for others.

Here is the code:


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

if({!ts2__Offer__c.Estimated_Gross_Margin__c}<40)

alert("The margin for this Resource is less than 40%. An automatic request for approval will be sent to the executive team");} 

else{ alert ("Completed"); 
}


Here is the error I get:

User-added image
 
  • January 12, 2016
  • Like
  • 0

Hi,

I would like to create a button on list view so that when the items from the list are selected and the button is clicked, it will add the selected items to another page. On that page there should be the option to remove some of the items if needed.
How can I accomplish this?

User-added image
  • August 17, 2015
  • Like
  • 0
I am trying to create a trigger that will update a field on a Job object every time when a field on Opportunity is changed.

The field on the Job object is an email field and is called "Account Manager email". It should be populated with the Opportunity Owner's email.
(I cannot use a simple formula field for the Account Manager email, because I want to use this field in a workflow)

Will appreciate it if someone can help me write the trigger.

Thanks!
  • August 07, 2015
  • Like
  • 0
Hello All,

I am trying to create a formula field called 'Grade__c' with return type text. Based on the Total Marks (Total__c, return type is number), the grade field should be populated with either A+, A, B+, B, C and D. Say for example, the total marks are 600 0ut of 800, then the grade should be B. Can anyone help me out with this. 

Thank you,
Satya
Hi Experts!

I would like to add a detail link to a page layout that will be visible/clickable when a record is created/edited. Example:

User-added image

What I tried so far:
- creating a detail page link, but it is not visible in edit mode
- simple url field that is read only, but it is not clickable.

Is there any way to accomplish this?

Thank you!
Hi everyone,

I had created a detailed page button that executes Java Scprit and now I am trying to create exactly the same button, but on a Visualforce page that I will make available for Salesforce1.
Can someone help  me write the code for the Visualforce page?

Detailed Page/JavaScript/ Custom Object - "Travel Request"

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

var tr = new sforce.SObject("Travel_Request__c"); 
tr.id = '{!Travel_Request__c.Id}'; 
tr.Approval_Status__c ='Recalled/Cancelled'; 
var result = sforce.connection.update([tr]); 

if (result[0].success == 'false') { 
alert(result[0].errors.message); 

else { 
location.reload(true); 
}