• Kiran R
  • NEWBIE
  • 35 Points
  • Member since 2014

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 1
    Likes Given
  • 0
    Questions
  • 19
    Replies
How can a scheduled action be automatically stopped (process builder) when the value of a field changes?
  • April 06, 2016
  • Like
  • 0
Hi Experts, I am a beginner. Please help me to do the following.
I have to Create a VF Page to display the related Contacts of the Related Account of an Opportunity. It should be displayed on each opportunity page.
Any help will be appreciated
I am working on a custom app that has a Table with Cost Centers (3 digit codes assigned to G/L Accounts) and another table with G/L Accounts..

I need to be able to grant users access to only certain Cost Centers throughout the entire app, for example:

Users: Mike, Mary
Cost Centers 100, 200, 300, 400
G/L Accts: 100-600000, 200-600000, 200-601000, 300-600000, 400-600000

User Mike should be able to see only those G/L Accounts with Cost Centers 100 & 200
User Mary should be able to see only those G/L Accounts with Cost Centers 300 & 400

Mike can see G/L Accts: 100-600000, 200-600000, 200-601000
Mary can see G/L Accts: 300-600000, 400-600000

This should work in any Form or Report. What is the best way to implement this?

This may require custom programming and I am OK with that if anyone can suggest how to do it.

 
I have to say there are a lot of things I do not like about the Dev Console (or any javascript page).  For one thing, you can't do simple operations like copy and paste from it.

I see the coverage stats in the lower left and I really want to copy them and put them in an email.  But there's no way to copy-and-paste.  It seems inane that I'd have to re-key that stuff. 

Does anyone know if you can still get the coverage % by module, and even better the blue/red line coverage in the good old HTTP web page setup pages?
 
OK my fellow Admins, I need some help.

I have a standard object (Task) with a custom field called 'Notify'. It is a lookup field from the USERS object. What I need to happen is when that 'Notify' field is NOT NULL, I need an email to go to that person.
I thought about doing a formula, but can't get it to work so I'm turning to APEX (Which I know nothing about).

All I need, is if that field is filled out, take the inserted user, get the email address, and send them an email with the link to the task.

Any thoughts????

Brandon
Hello,

I'm looking for a way to update a checkbox field on the Case (Tax_Task_Completed__c) when a task opened against the case is completed. I've looked to do this declaratively, but I don't believe there's a way to do this... Any ideas on a simple trigger that might do the trick?  
When creating a Work Order from the Opportunity object, the flow process correctly updating 2 fileds automatically. 

User-added image

When creating a Work Order from the Account object I get the following email however there is nothing that need to be updated. 

Flow Details
Flow Name: Work_Order_Field_Update
Type: Workflow
Version: 1
Status: Active
Flow Interview Details
Interview Label: Work_Order_Field_Update-1_WorkOrder
Current User: Synthia Beauvais (00518000000iFjU)
Start time: 4/6/2016 10:57 AM
Duration: 0 seconds
How the Interview Started
Synthia Beauvais (00518000000iFjU) started the flow interview.
Some of this flow's variables were set when the interview started.
myVariable_old = 0WO180000008PV4GAM
myVariable_current = 0WO180000008PV4GAM
ASSIGNMENT: myVariable_waitStartTimeAssignment
{!myVariable_waitStartTimeVariable} Equals {!Flow.CurrentDateTime}
Result
{!myVariable_waitStartTimeVariable} = "4/6/2016 10:57 AM"
DECISION: myDecision
Executed this outcome: myRule_1
Outcome conditions: and
1. {!formula_myRule_1} (true) Equals true
Logic: All conditions must be true (AND)

How can I correct this?

Thanks in advance! 
How can a scheduled action be automatically stopped (process builder) when the value of a field changes?
  • April 06, 2016
  • Like
  • 0
Hi,

I am trying to send an email to the users of a queue, depending on the criteria  I have to send the email, I have a trigger which send it rightly to the queue and a workflow which (email Alert)

I see that the order is reversed, i.e. workflow going first and then trigger thereby not sending the email, If I manually route it works

Please assist!
 I need to create a formula to get difference (Minutes) between between created date and the current time excluding weekends.

Thanks in advance

Hey there,

I have a site which is used to automatically send a link to a client at certain times and then once submitted automatically attach to the clients account. This all works fine, I am just having one problem with attaching it to another custom object called "office__c".


This is the url that is sent in the automatic email. http://destinyliveoffice.force.com/DestinySurvey?acct={!Account.Id}&Off={!Account.OfficeId__c}&Sur=120DAIPC

However, upon clicking the url....the account ID is filled with the correct ID, however the officeID for some reason will show the office name.
E.G. http://destinyliveoffice.force.com/DestinySurvey?acct={!Account.Id}&Off=Sydney&Sur=120DAIPC

This is preventing the survey upon being submitted from being added to both the account and the office. What could be causing this? please help?

My class and VF page are as below:

 

public class extDestinySurvey
{
    public Destiny_Survey__c Dess {get;set;}

    private Id AccountId
    {
        get
        {
            if ( AccountId == null )
            {
                String acctParam = ApexPages.currentPage().getParameters().get( 'acct' );
                try
                {
                    if ( !String.isBlank( acctParam ) ) AccountId = Id.valueOf( acctParam );
                }
                catch ( Exception e ) {}
            }
            return AccountId;
        }
        private set;
    }
    
    Private Id OfficeId
    {
        get
        {
            if ( OfficeId == null )
            {
                String OffParam = ApexPages.currentPage().getParameters().get( 'Off' );
                try
                {
                    if ( !String.isBlank( OffParam ) ) OfficeId = Id.valueOf( OffParam );
                }
                catch ( Exception e ) {}
            }
            return OfficeId;
        }
        Private set;
    }
    
 


    
    public extDestinySurvey(ApexPages.StandardController controller)
    {
        Dess = (Destiny_Survey__c)controller.getRecord();
         Dess = (Destiny_Survey__c) controller.getRecord();
        Dess.Survey_Code__c = ApexPages.currentPage().getParameters().get('Sur');
    }

    public PageReference saveDestinySurvey()
    {
        Dess.Account__c = AccountId;
        Dess.Office__c = OfficeId;

        
        upsert Dess;
      

        // Send the user to the detail page for the new account.
        return new PageReference('/apex/Destiny_Survey_Thank_You');
    }
}
and

<apex:page standardController="Destiny_Survey__c" extensions="extDestinySurvey" showHeader="false" >

  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" type="text/javascript"></script>
    <script src="{!URLFOR($Resource.charCounter)}" type="text/javascript"></script>
    <script type="text/javascript">
      $(document).ready(function(){
        $('.countable1').jqEasyCounter({
          'maxChars': 250,
          'maxCharsWarning': 40,
          'msgFontSize': '12px',
          'msgFontColor': '#000',
          'msgFontFamily': 'Verdana',
          'msgTextAlign': 'left',
          'msgWarningColor': '#F00',
          'msgAppendMethod': 'insertAfter'               
        });
      });
    </script>
    <style type="text/css">
      body {
        font-family: "Arial", "Helvetica", "Verdana", "Sans-Serif";
        margin: 0px;
        padding: 12px;
      }
      img {
        border: 0px none #ffffff;
        margin: 0px;
        padding: 0px;
      }
      [id*=SurveyTitle] {
        font-size: 24px;
      }
      [id*=ProductServiceSection] {
        font-size: 12px;
      }
      [id*=FeedbackSection] {
        font-size: 12px;
      }
      [id*=Buttons] {
        font-size: 12px;
      }
    </style>
  </head>

  <img alt="" src="{!$Resource.Destiny_Logo}" />
  <br />
  <br />
  <apex:form id="myForm">
    <apex:pageBlock id="SurveyTitle" title="Destiny Survey" mode="edit">
      

      <apex:pageBlockSection id="FeedbackSection" title="Feedback" columns="1">
        <apex:InputField id="Rating" label="Out of 10 how likely are you to refer Destiny to a friend or colleague?"  value="{!Destiny_Survey__c.How_likely_are_you_to_refer_Destiny__c}" />
        <apex:pageBlockSectionItem >
          <apex:outputlabel value="" />
            <c:flexslidercomponent minSliderValue="0" maxSliderValue="10"
              startSliderValue="{!Destiny_Survey__c.How_likely_are_you_to_refer_Destiny__c}"
              boundDomId="{!$Component.FeedbackSection.Rating}"
              width="180" />
        </apex:pageBlockSectionItem>
        <apex:inputTextarea id="Explanation" label="Please explain why you gave your rating." StyleClass="countable1" value="{!Destiny_Survey__c.Explain_why_you_gave_your_rating__c}" rows="5" cols="100"/>
      </apex:pageBlockSection>

      <apex:pageBlockButtons id="Buttons" location="bottom">
        <apex:commandButton value="Submit" action="{!saveDestinySurvey}"/>
      </apex:pageBlockButtons>
    </apex:pageBlock>

  </apex:form>
</apex:page>


 

Hello... Extremely new to Apex code here. Found this online and modified it to work for what I need, but I am missing a date component. I'd like the Class to only count activities that have occurred within the last 90 days, and if there are none reset the count to zero.

Here's what I have so far:

public with sharing class AccountActivityCount {
    public static Boolean didRun = false;
    public static String acctPrefix =  Account.sObjectType.getDescribe().getKeyPrefix();
    public static void updateAccountCounts(Set<ID> acctIds) {
        if (didRun == false) {
            didRun = true;
            List<Account> accts = [SELECT ID, activity_count__c, (SELECT ID FROM Tasks), (SELECT ID FROM Events) FROM Account WHERE ID IN :acctIds];
            List<Account> updateAccts = new List<Account>();
            for (Account o : accts) {
                Integer count = o.tasks.size() + o.events.size();
                if (o.activity_count__c != count) {
                    o.activity_count__c = count;
                    updateAccts.add(o);
                }
            }
            try {
                update updateAccts;
            } catch (Exception e) {
            }
        }
    }
    /*
    * Test method for this class and TaskUpdateOpportunity and EventUpdateOpportunity
    */
    public static testMethod void testCountTask() {
        Account a = new Account(name='Test');
        insert a;
        Task t = new Task(subject='Test Activity', whatId = a.id);
        insert t;
        a = [SELECT ID, activity_count__c FROM Account WHERE ID = :a.id];
        System.assertEquals(1,a.activity_count__c);
        didRun = false; //Reset
        t.whatId = null;
        update t;
        a = [SELECT ID, activity_count__c FROM Account WHERE ID = :a.id];
        System.assertEquals(0,a.activity_count__c);
        didRun = false; //Reset
        Event e = new Event(subject='Test Event', whatId = a.id, startDateTime = System.Now(), endDateTime = System.now());
        insert e;
        a = [SELECT ID, activity_count__c FROM Account WHERE ID = :a.id];
        System.assertEquals(1,a.activity_count__c);
        didRun = false; //Reset
        t.whatId = a.id;
        update t;
        a = [SELECT ID, activity_count__c FROM Account WHERE ID = :a.id];
        System.assertEquals(2,a.activity_count__c);
        didRun = false; //Reset
        e.whatId = null;
        update e;
        a = [SELECT ID, activity_count__c FROM Account WHERE ID = :a.id];
        System.assertEquals(1,a.activity_count__c);
        didRun = false; //reset
        delete t;
        a = [SELECT ID, activity_count__c FROM Account WHERE ID = :a.id];
        System.assertEquals(0,a.activity_count__c);       
    }
}

Thanks in advance, any help is greatly appreciated!
Brian
  • September 30, 2014
  • Like
  • 0
We have 3 managers that need to approve opps based on a custom formula field (Product_Sub_Type__c) we've added to the opp prod object, but the approval process workflows/rules don't allow fields from the opp prod object to be used. Is there a trigger I could create to help create an approval process that would allow us to send to an approver based on the product sub types in an opp? I was informed by Salesforce Helpdesk that a trigger could be the answer, but I don't know where to start, so if you could point me in the right direction or provide an example of a trigger that could work, that would be very much appreciated. Thanks!

When someone takes the time/effort to repspond to your question, you should take the time/effort to either mark the question as "Solved", or post a Follow-Up with addtional information.  

 

That way people with a similar question can find the Solution without having to re-post the same question again and again. And the people who reply to your post know that the issue has been resolved and they can stop working on it. 

When someone takes the time/effort to repspond to your question, you should take the time/effort to either mark the question as "Solved", or post a Follow-Up with addtional information.  

 

That way people with a similar question can find the Solution without having to re-post the same question again and again. And the people who reply to your post know that the issue has been resolved and they can stop working on it.