• samsafin42
  • NEWBIE
  • 20 Points
  • Member since 2015
  • Marketing Data & Systems Analyst


  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 3
    Replies
Background:

We have a looong list of status and sub-status fields. For the sake of ease, we'll say we have four statuses: Intro, In Progress, Pass, and Fail. Within each of those, of course we have sub-statuses, and they are assigned via standard Field Dependancies functions.

Here's what I need to do:

Certain sub-statuses related to the the "Fail" status should only be available when the previous Status was "Intro", where as others can only be selected when the previous Status was "In Progress." I've been able to do it with a single value, but when I throw OR into the mix, it starts to fall apart.

I am so close to getting this, but it doesn't pass both positive and negative tests, and I'm now confusing myself. I've done a few different things, but this is the closest I've gotten:

PRIORVALUE(Status__c)<> "In Progress" 
&& 
ISPICKVAL(Status__c,'FAIL') 
&& 
NOT(
OR(
ISPICKVAL(Substatus__c,'1'),
ISPICKVAL(Substatus__c,'2'),
ISPICKVAL(Substatus__c,'3')
)
)

I've also tried adding "ISCHANGED" for the Status field...and switching out what is NOT or NOT EQUALS...I honestly don't know how many versions I've gone through.

So what am I missing?
Greetings (and May the 4th be with you!)

I'm not writing code in its entirety yet because I want to ensure I'm thinking this through all the way before I do that.

Use case: We provide training on the software that we provide to companies, and we will soon be certifying users as well. Accordingly, our training team wants to begin tracking these classes and certifications in Salesforce. They have just switched to using Citrix GoToTraining to provide their training and exams, and we are going to integrate the systems at some point in the future. We want to track classes, registrants, exams, test-takers, and certifications. We also want to provide visibility to account manageres to both an individual's class and exam history and the Account's history of classes and exams. 

The hiccup: The only fields we are able to gather today via GoTo are First Name, Last Name, Email, and Class (or Exam) they registered for.

My proposed solution:
Using an After Trigger, we pull the email address from the registrant record and perform a SOQL query to check for a matching email. If it exists, we pull the Contact Id and populate that in the Lookup field on the Registrant record. If the email does not exist, we perform a second SOQL query looking for Accounts with Contacts that have similar email formats. If we find an Account with the same email format, we add the new Contact, related to the Account, and we pull the new Id to populate the Lookup field on the Registrant record. If we do NOT find a matching Account, we still create a Contact, but we house it under a default Account called "Training," which will belong to the training group, who will monitor those Contacts and re-assign them as necessary.

It seems overly complicated, but I can't determine how to trim this down any more, if at all. Thoughts?
I have done some searching, and I am fairly well stumped. I am making a pretty simple Visualforce page on a custom object, nothing more than some fields and report charts. However, my formula fields (of which there are three) are not appearing at all. I thought perhaps it was only because, during build, I didn't assign a record. After selecting a record, it still is not rendering them. Here's the VF:
 
<apex:page sidebar="false" showheader="false" standardcontroller="Weekly_Metrics__c">
  <br></br>
  <center><h1>Welcome, {! $user.lastname}
  <br/>You are viewing metrics for the week of {!Weekly_Metrics__c.name}.
  </h1></center>
  <apex:pageBlock title="Opportunity (D) Pipeline">
      <apex:pageBlockSection title="This week's metrics">
      <apex:outputField value="{!Weekly_Metrics__c.Opportunity_Target__c}"/>
      <apex:outputField value="{!Weekly_Metrics__c.Opportunity_Actual__c}"/>
      <apex.outputField value="{!Weekly_Metrics__c.Opportunity_Percent_to_Target__c}"/>
      </apex:pageBlockSection>
      <apex:pageBlockSection title="Changes this Quarter">
      <analytics:reportChart reportId="00Oj00000047r9p"></analytics:reportChart>
      </apex:pageBlockSection>
      </apex:pageBlock>
    <apex:pageBlock title="Proposal (C) Pipeline">
      <apex:pageBlockSection title="This week's metrics">
      <apex:outputField value="{!Weekly_Metrics__c.Proposal_Target__c}"/>
      <apex:outputField value="{!Weekly_Metrics__c.Proposal_Actual__c}"/>
      <apex.outputField value="{!Weekly_Metrics__c.Proposal_Percent_to_Target__c}"/>
      </apex:pageBlockSection>
      <apex:pageBlockSection title="Changes this Quarter">
      <analytics:reportChart reportId="00Oj00000047rAd"></analytics:reportChart>
      </apex:pageBlockSection>
  </apex:pageBlock>
   <apex:pageBlock title="Contract (A) Pipeline">
      <apex:pageBlockSection title="This week's metrics">
      <apex:outputField value="{!Weekly_Metrics__c.Contract_Target__c}"/>
      <apex:outputField value="{!Weekly_Metrics__c.Contract_Actual__c}"/>
      <apex.outputField value="{!Weekly_Metrics__c.Contract_Percent_to_Target__c}"/>
      </apex:pageBlockSection>
      <apex:pageBlockSection title="Changes this Quarter">
      <analytics:reportChart reportId="00Oj00000047rAs"></analytics:reportChart>
      </apex:pageBlockSection>
  </apex:pageBlock>
  </apex:page>
The missing fields are all of the "Percent to Target" fields - third ones down in each block section. 

The formulas themselves are rather simple - literally just (X_Actual__c/X_Target__c).

I could not find anything saying that this type of formula could not be used with outputField - did I miss some huge piece of the puzzle?


 
Hi All,

I need to create a trigger that "rolls up" the field Amount__c from a custom object Sessions to a custom object called Session_Invoice to a field called Invoice_Amount - I can't use a rollup summary field unfortunately as it's just a lookup relationship.

I'm quite new to Salesforce and Coding, so struggling where to start!

Any help would be much appreciated
 
trigger SessionAmountRollup on Session__c (after insert, after update, after delete, after undelete) {
  
}

 
Hi,

I am working on a workflow tha does not seem to be working and I think, I should go for it with a trigger, but not sure.

So this is the scenario:

ObjectP__c
Has a picklist field called State__c

ObjectE__c 
-​Has a formula field called State__c that just adds the value of the State__c field in ObjectP
-Has a text field called State2__c (which populates value of State__c on same object with a workflow update rule every time it edits), so I can use it as a condition I need in a rollup summary field on ObjectO__c (since formula fields are not available for conditioning when creating rollup summary fields).
-Has a Master-Detail relationship to ObjectO__c

ObjectO__c
I have a rollup summary field called Amount__c which basically needs to count the related ObjectE__c child records, with the condition that it will count only the ones with the State2__c with value "Active" (that at the end is coming from State__c field in ObjectE__c)

The Problem
So my issue here is that if the field State__c value of ObjectP__c changes to a different value, for example "Inactive", the State__c of ObjectE__c will also change, however, the field State2__c will remain with the old value "Active" (since it will only change if I edit the ObjectE__c record to trigger the workflow), giving me an incorrect Count of "Active" child records on the rollup summary field on ObjectO__c.

It is not an option for the customer, that every time he changes the State on the ObjectP__c record, to make a second step and update the ObjectE__c record, so the value on State2__c will be same as in ObjectP__c to count correctly the records on ObjectO__c

So my question is, how can I achive this? With a Trigger? if so, can you provide an example? or there another option for achiving this? I may think of a trigger that every time ObjectP__c State__c changes to change the value automatically on State2__c field on ObjectE__c, with out having to edit the record and save it. I need the value of field State2__c field on ObjectE__c to always have the same value of State__c on ObjectP__c.

Thanks and any help is greatly appreciated. I am working on a school project and no way to find this.

Danny



 
I have done some searching, and I am fairly well stumped. I am making a pretty simple Visualforce page on a custom object, nothing more than some fields and report charts. However, my formula fields (of which there are three) are not appearing at all. I thought perhaps it was only because, during build, I didn't assign a record. After selecting a record, it still is not rendering them. Here's the VF:
 
<apex:page sidebar="false" showheader="false" standardcontroller="Weekly_Metrics__c">
  <br></br>
  <center><h1>Welcome, {! $user.lastname}
  <br/>You are viewing metrics for the week of {!Weekly_Metrics__c.name}.
  </h1></center>
  <apex:pageBlock title="Opportunity (D) Pipeline">
      <apex:pageBlockSection title="This week's metrics">
      <apex:outputField value="{!Weekly_Metrics__c.Opportunity_Target__c}"/>
      <apex:outputField value="{!Weekly_Metrics__c.Opportunity_Actual__c}"/>
      <apex.outputField value="{!Weekly_Metrics__c.Opportunity_Percent_to_Target__c}"/>
      </apex:pageBlockSection>
      <apex:pageBlockSection title="Changes this Quarter">
      <analytics:reportChart reportId="00Oj00000047r9p"></analytics:reportChart>
      </apex:pageBlockSection>
      </apex:pageBlock>
    <apex:pageBlock title="Proposal (C) Pipeline">
      <apex:pageBlockSection title="This week's metrics">
      <apex:outputField value="{!Weekly_Metrics__c.Proposal_Target__c}"/>
      <apex:outputField value="{!Weekly_Metrics__c.Proposal_Actual__c}"/>
      <apex.outputField value="{!Weekly_Metrics__c.Proposal_Percent_to_Target__c}"/>
      </apex:pageBlockSection>
      <apex:pageBlockSection title="Changes this Quarter">
      <analytics:reportChart reportId="00Oj00000047rAd"></analytics:reportChart>
      </apex:pageBlockSection>
  </apex:pageBlock>
   <apex:pageBlock title="Contract (A) Pipeline">
      <apex:pageBlockSection title="This week's metrics">
      <apex:outputField value="{!Weekly_Metrics__c.Contract_Target__c}"/>
      <apex:outputField value="{!Weekly_Metrics__c.Contract_Actual__c}"/>
      <apex.outputField value="{!Weekly_Metrics__c.Contract_Percent_to_Target__c}"/>
      </apex:pageBlockSection>
      <apex:pageBlockSection title="Changes this Quarter">
      <analytics:reportChart reportId="00Oj00000047rAs"></analytics:reportChart>
      </apex:pageBlockSection>
  </apex:pageBlock>
  </apex:page>
The missing fields are all of the "Percent to Target" fields - third ones down in each block section. 

The formulas themselves are rather simple - literally just (X_Actual__c/X_Target__c).

I could not find anything saying that this type of formula could not be used with outputField - did I miss some huge piece of the puzzle?