• OcoBri
  • NEWBIE
  • 25 Points
  • Member since 2012

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 1
    Likes Given
  • 16
    Questions
  • 11
    Replies
I know this is an option, but the only documentation I could find (https://help.salesforce.com/HTViewHelpDoc?id=vpm_designer_elements_action_submit.htm) seems incorrect or out of date.  Does anyone know of an example of a flow using "Submit for Approval"?  I want to know how it is supposed to behave.

Thank you
How can I remove the "Action" column from a related list on a visualforce page rendered as pdf?
Lightning is advertised as a modular system to quickly build apps by combining pre-built components, but every single demo or webinar I've watched starts from scratch.  Where can I find pre-built copmonents?
  • February 15, 2015
  • Like
  • 0
Hello,

I'm not sure how to set this up.

I have a custom Allocation object with fields for Cost Center, Effective Date, and Percentage.

An Employee could be 50% Dept A, 50% Dept B.


This part is fine.

However, there are now nested allocations, wherein a Cost Center could be a basket ("Basket 1") of 25% Dept A, 75% Dept B.  
An an employee could be 50% Dept C, 50% Basket 1, which should evaluate to 50% C, 12.5% A, 37.5% B.
And the ratios in the Basket could change every quarter.

How can I set this up?  
I was thinking of using a Custom Setting to store the percentages within the baskets, but not sure how that would work in practice.

I'm not even sure what to Google for.

Any help would be appreciated.

Thank you,
Brian
 
  • February 03, 2015
  • Like
  • 0
I understand this is not possible using the standard data export tool, but can it be easily accomplished with Visualforce or Apex?

Thank you
  • January 15, 2015
  • Like
  • 0
Hello,
This is more of a poll than a straight question per se.
I'm developing an app for non-profits to use, and I'm not sure which object to use to store employees in a lookup field: Contact, User, or a custom object?
My non-profit has approx. 1500 employees, about half of them full-time, and about a third of them in office jobs with company email. Until recently, we only had about 30 Salesforce Users, so it made sense to store employee info as contacts.  We have now installed an HR system that runs on Salesforce, which included Platform licenses for all full-time employees, even those without company email addresses.  Therefore we now have a Contact, User, and Worker__c record for all full-time employees.  

In developing for other (perhaps smaller) non-profit organizations, however, I'm curious which would have broader appeal: User records, with added functionality such as email alerts, or Contacts, which are probably being used already and are free, or a Custom Object which would have more functionality than Contacts, but would require more ongoing maintenance (double data entry).  I'm even toying with the idea of having lookup fields to User and Contact, with instructions to the Administrator to hide whichever fields they won't be using.

Thanks for any input!
  • November 11, 2014
  • Like
  • 0
Hi,

I've writen a trigger and test class that work well in the Sandbox, but when I attempt to deploy in Production, the test fails.
Whenever a "Worker" (custom object) is created, I need to also create a matching Contact.  I'm not concerned with creating duplicates at this point.  We use the Nonprofit Starter Pack.

Trigger:
trigger NewContactforWorker on VanaHCM__Worker__c (after insert) {
	List<Contact> conList = new List<Contact>();
    for (VanaHCM__Worker__c wkr : trigger.new) {
        Contact a = new Contact(
            Worker__c = wkr.Id, 
            FirstName = wkr.VanaHCM__First_Name__c,
            LastName = wkr.VanaHCM__Last_Name__c, 
            QSAC_external_id__c = wkr.VanaHCM__External_Worker_ID__c,
            npe01__Preferred_Email__c = 'Personal',
            npe01__PreferredPhone__c = 'Home', 
            npe01__Primary_Address_Type__c = 'Home');
        conList.add(a);
    }
    if(conlist.size()>0){
try{
    insert conList;
    system.debug('inserted new contact');
}catch(DMLException e){
System.debug('Error trying to insert new contact(s). Alert the media!');
}
}
}
And the test class:
@istest public class WorkerToContactTestClass {
    private static testmethod void TestWorkerToContact(){
        VanaHCM__Worker__c testwrkr = new VanaHCM__Worker__c(VanaHCM__First_Name__c = 'Flip', 
                                                             VanaHCM__Last_Name__c = 'Nahasapeemapetalan', 
                                                             VanaHCM__External_Worker_ID__c = 'X1');
        insert testwrkr;
        
        list<contact> foundWorkers = [SELECT Id FROM Contact WHERE QSAC_external_id__c = 'X1'];
        system.assertEquals(foundWorkers.size()>0, TRUE);
    }

Can anyone help?

Thank you

  • October 07, 2014
  • Like
  • 0
Following Knowledge Article Number: 000006188 (https://help.salesforce.com/apex/HTViewSolution?id=000006188&language=en_US)

I am trying to delete an old trigger in my production org which no longer passes code coverage tests, so I can't use any change sets.  
I installed Java, Eclipse, Force IDE, etc.  When I get to the second to last line, "Select Force.com > Deploy to server." is greyed out for me.  
What am I doing wrong?

Thanks.
  • September 29, 2014
  • Like
  • 0
Contacts have a lookup relationship to a custom Worker__c object.

Whenever a new Worker__c record is created, I want to create an associated (child) Contact.

My code is as follows:

trigger NewContactforWorker on Worker__c (after insert) {
	List<Contact> conList = new List<Contact>;
    for (Worker__c wkr : trigger.new) {
        a = new Contact(Worker__c = wkr.Id, FirstName = wkr.First_Name__c, 
                        LastName = wkr.Last_Name__c, QSAC_external_id__c = wkr.Worker_External_ID__c);
        conList.add(a);
    }
    insert conList;
}

But I get an error in between the second and third lines.  Can anyone help?

Thank you.
  • September 23, 2014
  • Like
  • 0
In a managed package, there is a custom object for Address which is a text area.  I need to create formula fields that will yield the Street, City, etc.  In the managed field, they are separated by line breaks.  How can I search for the line break character using a formula to separate it?
Thank you
  • September 10, 2014
  • Like
  • 0
I have a VF page for a custom object, using standard controller.  I have a related list of another custom object.  The related list should contain a name, year, and twelve checkboxes for each month.  How can I override the related list layout from the standard page layout to include more than ten columns?

Thanks
  • August 11, 2014
  • Like
  • 0
I have a custom object with activities (events or tasks; they confuse me) to record hours worked (start datetime and end datetime). How can I sum the hours worked both on the activity, and on the custom object for all activities?
I could also use another custom object instead of Activities.
Thank you.
  • August 04, 2014
  • Like
  • 0
I'm trying to copy some custom objects out of a developer org and into my Production org.  In order to do so I read that I have to use the IDE.

I just installed the latest versions of Java Runtime Environment and Eclipse and then installed the Force IDE inside that (huge pain in the ass btw).  When I try to make a new Force.com project, I enter my login credentials, but get this error:

User-added image


I've tried resetting my security token, checked my user permissions, combining password with token, etc, but always get the same error.  The development org was created less than a month ago.  I saw a few similar topics but none of them were answered satisfactorily.

How can I connect?
Thanks
I'm writing a trigger that will:

Every time a new contact is created, of Record Type 'Consumer', I want to create a corresponding record in the master-detail custom object Compliance2__c.  The only field that needs to be passed is the lookup value.  The other fields on Compiance2__c are formulas.  
The error I'm getting is: "Error: Compile Error: unexpected token: 'for' at line 5 column 4"

My code is:
trigger createCompliance on Contact (after insert) {
    
    List <Compliance2__c> compToInsert = new List <Compliance2__c>
    
    for (Contact c : Trigger.new) {
        
        //check if this is a Consumer being created
        if (c.RecordType.Name = 'Consumer') {
            //create a new Compliance for each new Consumer
            Compliance2__c i = new Compliance2__c ();
            i.Consumer__c = c.Id;
            //add to the list of Compliances to insert
            compToInsert.add(i);
        } //end if
    } //end for c
    //after loop, insert new Compliances
    insert complianceToInsert;  
}

Any help is appreciated.
Thank you!

I'm new to VF.

 

This page will display information for a student in case of emergency.  They may or may not have two parents and 3 other emergency contacts.

How can I change this page to remove sections where the person is null?  Thank you.

 

<apex:page renderAs="pdf" standardController="Contact" sidebar="false" showheader="false">
  <div align="center"><h1><p style="font-family: times, serif; font-size:16pt">
  {!Contact.FirstName} {!Contact.Middle_Name__c} {!Contact.LastName}<br></br>
  <apex:outputText value="{0, number, 00}"><apex:param value="{!Contact.Age__c}" /></apex:outputText>-year old {!Contact.QSAC_Race__c} {!Contact.QSAC_Gender__c}
  <br></br>{!Contact.Alerts__c}</p></h1>
  <img src="{!Contact.Image_URL__c}" alt="{!Contact.FirstName}\'s picture"/>
  <table border="1" align="center">
  <tr><td align="left"><b>{!Contact.Primary_Parent_Guardian_Type__c}:</b> {!Contact.Primary_Parent_Guardian__r.FirstName} {!Contact.Primary_Parent_Guardian__r.LastName}</td>
  <td align="left"><b>{!Contact.Secondary_Parent_Guardian_Type__c}:</b> {!Contact.Secondary_Parent_Guardian__r.FirstName} {!Contact.Secondary_Parent_Guardian__r.LastName}</td></tr>
  <tr><td align="left">{!Contact.Primary_Parent_Guardian__r.MailingStreet}</td>
  <td align="left">{!Contact.Secondary_Parent_Guardian__r.MailingStreet}</td></tr>
  <tr><td align="left">{!Contact.Primary_Parent_Guardian__r.MailingCity} {!Contact.Primary_Parent_Guardian__r.MailingState} {!Contact.Primary_Parent_Guardian__r.MailingPostalCode}</td>
  <td align="left">{!Contact.Secondary_Parent_Guardian__r.MailingCity} {!Contact.Secondary_Parent_Guardian__r.MailingState} {!Contact.Secondary_Parent_Guardian__r.MailingPostalCode}</td></tr>
  <tr><td align="left"><b>Home:</b> {!Contact.Primary_Parent_Guardian__r.HomePhone}</td><td align="left"><b>Home:</b> {!Contact.Secondary_Parent_Guardian__r.HomePhone}</td></tr>
  <tr><td align="left"><b>Mobile:</b> {!Contact.Primary_Parent_Guardian__r.MobilePhone}</td><td align="left"><b>Mobile:</b> {!Contact.Secondary_Parent_Guardian__r.MobilePhone}</td></tr>
  <tr><td align="left"><b>Work:</b> {!Contact.Primary_Parent_Guardian__r.npe01__WorkPhone__c}</td><td align="left"><b>Work:</b> {!Contact.Secondary_Parent_Guardian__r.npe01__WorkPhone__c}</td></tr>
  </table>
  <table border="1" align="center">
  <caption>Other Emergency Contacts</caption>
  <thead>
  <tr>
  <th>Name</th>
  <th>Phone</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>{!Contact.Emergency_Contact_1__r.FirstName} {!Contact.Emergency_Contact_1__r.LastName}</td>
  <td>{!Contact.Emergency_Contact_1_Phone__c}</td>
  </tr>
  <tr>
  <td>{!Contact.Emergency_Contact_2__r.FirstName} {!Contact.Emergency_Contact_2__r.LastName}</td>
  <td>{!Contact.Emergency_Contact_2_Phone__c}</td>
  </tr>
  <tr>
  <td>{!Contact.Emergency_Contact_3__r.FirstName} {!Contact.Emergency_Contact_3__r.LastName}</td>
  <td>{!Contact.Emergency_Contact_3_Phone__c}</td>
  </tr>
  </tbody>
  </table>
  </div>
</apex:page>

 

  • August 23, 2013
  • Like
  • 0

Hello,

I am new to coding on the force platform.  I am using the Enterprise Edition with Non-Profit Starter Pack.

I've written a trigger in my Sandbox:

 

 

 

trigger MakeParentsActiveTrigger on Contact (after insert, after update) {

//Get list of Consumer IDs that the trigger is acting upon
List<ID> consumerids = New List<ID>();
List<ID> ParentIds = New List<ID>();
for(Contact o : Trigger.new) {

//Add Parents Ids to a list if the contact is an active consumer
if(o.QSAC_active__c == TRUE && o.RecordTypeID == '012A000000179ETIAY') {
ParentIds.add(o.Primary_Parent_Guardian__c);
ParentIds.add(o.Secondary_Parent_Guardian__c);
}
}

//Retrieve Parents Active status
List<Contact> ParentInfo = [SELECT id, QSAC_active__c FROM Contact WHERE id in :ParentIds];

//Update the Parents Active status
for(integer i = 0 ; i < ParentInfo.size(); i++){
ParentInfo[i].QSAC_active__c = FALSE;
}
update ParentInfo;
}

 

 

But I have no idea how to tell if it is working, or if it is ever called.  Furthermore, I'm not sure if I need a class when it seems the trigger should be able to stand alone.  I'm also confused about "reaching 75%" of something before I can copy it into my production database.  Any help would be appreciated.

 

  • August 24, 2012
  • Like
  • 0
Hi,

I've writen a trigger and test class that work well in the Sandbox, but when I attempt to deploy in Production, the test fails.
Whenever a "Worker" (custom object) is created, I need to also create a matching Contact.  I'm not concerned with creating duplicates at this point.  We use the Nonprofit Starter Pack.

Trigger:
trigger NewContactforWorker on VanaHCM__Worker__c (after insert) {
	List<Contact> conList = new List<Contact>();
    for (VanaHCM__Worker__c wkr : trigger.new) {
        Contact a = new Contact(
            Worker__c = wkr.Id, 
            FirstName = wkr.VanaHCM__First_Name__c,
            LastName = wkr.VanaHCM__Last_Name__c, 
            QSAC_external_id__c = wkr.VanaHCM__External_Worker_ID__c,
            npe01__Preferred_Email__c = 'Personal',
            npe01__PreferredPhone__c = 'Home', 
            npe01__Primary_Address_Type__c = 'Home');
        conList.add(a);
    }
    if(conlist.size()>0){
try{
    insert conList;
    system.debug('inserted new contact');
}catch(DMLException e){
System.debug('Error trying to insert new contact(s). Alert the media!');
}
}
}
And the test class:
@istest public class WorkerToContactTestClass {
    private static testmethod void TestWorkerToContact(){
        VanaHCM__Worker__c testwrkr = new VanaHCM__Worker__c(VanaHCM__First_Name__c = 'Flip', 
                                                             VanaHCM__Last_Name__c = 'Nahasapeemapetalan', 
                                                             VanaHCM__External_Worker_ID__c = 'X1');
        insert testwrkr;
        
        list<contact> foundWorkers = [SELECT Id FROM Contact WHERE QSAC_external_id__c = 'X1'];
        system.assertEquals(foundWorkers.size()>0, TRUE);
    }

Can anyone help?

Thank you

  • October 07, 2014
  • Like
  • 0
Following Knowledge Article Number: 000006188 (https://help.salesforce.com/apex/HTViewSolution?id=000006188&language=en_US)

I am trying to delete an old trigger in my production org which no longer passes code coverage tests, so I can't use any change sets.  
I installed Java, Eclipse, Force IDE, etc.  When I get to the second to last line, "Select Force.com > Deploy to server." is greyed out for me.  
What am I doing wrong?

Thanks.
  • September 29, 2014
  • Like
  • 0
Contacts have a lookup relationship to a custom Worker__c object.

Whenever a new Worker__c record is created, I want to create an associated (child) Contact.

My code is as follows:

trigger NewContactforWorker on Worker__c (after insert) {
	List<Contact> conList = new List<Contact>;
    for (Worker__c wkr : trigger.new) {
        a = new Contact(Worker__c = wkr.Id, FirstName = wkr.First_Name__c, 
                        LastName = wkr.Last_Name__c, QSAC_external_id__c = wkr.Worker_External_ID__c);
        conList.add(a);
    }
    insert conList;
}

But I get an error in between the second and third lines.  Can anyone help?

Thank you.
  • September 23, 2014
  • Like
  • 0
In a managed package, there is a custom object for Address which is a text area.  I need to create formula fields that will yield the Street, City, etc.  In the managed field, they are separated by line breaks.  How can I search for the line break character using a formula to separate it?
Thank you
  • September 10, 2014
  • Like
  • 0
I'm trying to copy some custom objects out of a developer org and into my Production org.  In order to do so I read that I have to use the IDE.

I just installed the latest versions of Java Runtime Environment and Eclipse and then installed the Force IDE inside that (huge pain in the ass btw).  When I try to make a new Force.com project, I enter my login credentials, but get this error:

User-added image


I've tried resetting my security token, checked my user permissions, combining password with token, etc, but always get the same error.  The development org was created less than a month ago.  I saw a few similar topics but none of them were answered satisfactorily.

How can I connect?
Thanks
I'm writing a trigger that will:

Every time a new contact is created, of Record Type 'Consumer', I want to create a corresponding record in the master-detail custom object Compliance2__c.  The only field that needs to be passed is the lookup value.  The other fields on Compiance2__c are formulas.  
The error I'm getting is: "Error: Compile Error: unexpected token: 'for' at line 5 column 4"

My code is:
trigger createCompliance on Contact (after insert) {
    
    List <Compliance2__c> compToInsert = new List <Compliance2__c>
    
    for (Contact c : Trigger.new) {
        
        //check if this is a Consumer being created
        if (c.RecordType.Name = 'Consumer') {
            //create a new Compliance for each new Consumer
            Compliance2__c i = new Compliance2__c ();
            i.Consumer__c = c.Id;
            //add to the list of Compliances to insert
            compToInsert.add(i);
        } //end if
    } //end for c
    //after loop, insert new Compliances
    insert complianceToInsert;  
}

Any help is appreciated.
Thank you!

I am trying to understand standard controllers vs. custom--and how they can be used with Custom Objects?

 

Most of the code samples I have found all use the standard Account or Contact as the example like...

 

<apex:page standardController="Account" showHeader="true"  tabStyle="Account" > 

 

I have several Custom Objects that I have created---and have trying to create a simple Tabbed view of the object detail and related lists instead of the typical list view--using VF.

 

I am just starting on VF...

 

>Do standard controllers get 'auto-created' for each custom object?--assume so and thats how the display using standard SF look?

 

> When I try starting my VF page to be used on my Custom Object with...

 

 

<apex:page standardController="ThenameIusedtocreatetheobject_c" showHeader="true"  tabStyle="ThenameIusedtocreatetheobject_c"" > 

 

 

I get errors - ThenameIusedtocreatetheobject_c Does not Exist, etc.

 

 

What am I missing about standard controllers on custom objects?  Do all custom objects require a custom controller to be coded?

 

Thanks for the assistance...

 

KS

I am playing with the translation workbench and a managed package.

 

It seems that you cannot rename the "Tab Name" and "Display Name" for a custom object when you install the package in an org where the translation workbench is enabled.

 

It works for any other field but not this one, the edit link is not displayed.

 

Is there a reason for this or did I miss something ?

 

Thanks

The subject basically says it all.  Is there a way to do this?  I need to display the elements in my table in a specific sort order.

I am trying to understand standard controllers vs. custom--and how they can be used with Custom Objects?

 

Most of the code samples I have found all use the standard Account or Contact as the example like...

 

<apex:page standardController="Account" showHeader="true"  tabStyle="Account" > 

 

I have several Custom Objects that I have created---and have trying to create a simple Tabbed view of the object detail and related lists instead of the typical list view--using VF.

 

I am just starting on VF...

 

>Do standard controllers get 'auto-created' for each custom object?--assume so and thats how the display using standard SF look?

 

> When I try starting my VF page to be used on my Custom Object with...

 

 

<apex:page standardController="ThenameIusedtocreatetheobject_c" showHeader="true"  tabStyle="ThenameIusedtocreatetheobject_c"" > 

 

 

I get errors - ThenameIusedtocreatetheobject_c Does not Exist, etc.

 

 

What am I missing about standard controllers on custom objects?  Do all custom objects require a custom controller to be coded?

 

Thanks for the assistance...

 

KS