• William Tran
  • ALL STAR
  • 6435 Points
  • Member since 2015
  • Solution Architect
  • TranConsulting Inc (william@tranconsultinginc.com)

  • Chatter
    Feed
  • 166
    Best Answers
  • 0
    Likes Received
  • 4
    Likes Given
  • 0
    Questions
  • 912
    Replies
Hello friends,
I am on creating custom object and fields on trail head, challenge is to create custom object named Trail, field - distance etc.. but did not mention in which app i should create object???
I'm trying to complete the chatter section on Trailhead, and I'm getting the error "Challenge Not yet complete... here's what's wrong: 
No feed post was found that linked to the Trailhead URL.", and this doesn't make sense because I clearly posted the URL multiple times.

The criteria: Using the standard poll and link Chatter actions, create two posts to engage with the Chatter user community.
Create a poll post. Ask your users to rate their experience with Chatter and ask for feedback in comments.
Create a link post. Share a link with other users to http://developer.salesforce.com/trailhead - the best learning tool for Salesforce out there!


User-added image
when adding the fields to custom objects this massage came up. I do not understand how to remedy this. All the expected custom fields for the Trail__c object could not be found
Hi, I'm creating a new custom object but I can't create a master-detail relationship to an existing custom object. Can anyone explain why this might be and if there's a workaround for this? I'll explain in detail below.

We have an existing custom object called Media Cost
Media Cost has the following master-detail relationships
1.Account
2. Opportunity

I want to create a new custom object called Production that has a master-detail relationship to the Media Cost object (because 1 Media Cost object can have many Production objects)

However, when I create a master-detail field, the Media Cost object isn't in the related drop down.

Have I hit a limitation within SF? If I have, is there any suggestions on how I get around this?

Thanks
hello all,

i've been working through salesforce trialhead modules and up until the error i came across today i can usually figure out my mistake. i'm on the creating validation rules exercise which is under "formulas & validation" module. i've started over twice and continue to get this same error. can anyone enlighten me on what i'm doing wrong? Here's the error - There was an unexpected error in your org which is preventing this assessment check from completing: System.DmlException: Insert failed. First exception on row 0; first error: REQUIRED_FIELD_MISSING, Required fields are missing: [MailingPostalCode__c, ShippingPostalCode__c]: [MailingPostalCode__c, ShippingPostalCode__c]
I know im missing something simple but cannot figure out what,
I am trying to have the user select an sObject from a list and getting an error when trying to save VF -- Unknown property 'CustomPdfController.allObjectsList'

VF Code:
<apex:page controller="CustomPdfController" >
    <apex:form>
        <apex:pageblock>
            <apex:outputLabel value="Choose Object: "></apex:outputLabel>
            <apex:selectList value="{!allObjectsList}"></apex:selectList>
        </apex:pageblock>
    </apex:form>
</apex:page>


APEX Code:
public with sharing class CustomPdfController {
    public list<SelectOption> allObjectsList(){
        list<Schema.SObjectType> gd = Schema.getGlobalDescribe().Values();
        list<SelectOption> options = new list<SelectOption>();
        options.add(new SelectOption('','--SELECT--'));
        for(Schema.SObjectType gd1:gd){
            options.add(new SelectOption(gd1.getDescribe().getName(),gd1.getDescribe().getName()));
        }
        options.sort();
        return options;
    }
}
Challenge Not yet complete... here's what's wrong:
Executing the 'generateStringArray' method failed. Either the method does not exist, is not static, or does not return the proper number of strings.

the exercise was complete and ran and followed the instructions why were the points not awarded?
Challenge : https://developer.salesforce.com/trailhead/force_com_dev_beginner/business_process_automation/approvals

I have Followed the steps as given in the challenge but I am getting error as "Challenge Not yet complete... here's what's wrong: 
Account setup for challenge incomplete. Please add 'Prospect', 'Customer' and 'Pending' picklist values to the Account 'Type' field", but I have added the field Type with above values to Account and here is the screenshot

Account Object Field "Type"
what am i doing wrong?

Thanks In advance
Anusha
Hey there,

Here's my concern: I'm creating objects from a web app (node js using nforce). I get a response object with a 18 digit Id, cool!
If I paste this id in the search field in salesforce: no match found... Of course I get an error if I try requesting the object through the web app... 
So I do a little test like: I go to a salesforce record page, I copy the record id from the adress bar, paste it in the search field... no match found!
Am I crazy? Is there something like an index somewhere that could be broken ?
Thanks in advance.

 
Hi,

I am new to developing so I am not sure how to approach this task. I created a custom lookup field in my Accounts object called Relationship Manager. This field is manually populated with a user name. I also addes the same Relationship Manager field into my Opportunity object and would like that field to auto-populate the user name based on the Account name entered.

Here is my attempt at creating the apex trigger below. I am getting an error message that states:
Error: Compile Error: unexpected token: '<EOF>' at line 6 column 0

trigger RelationshipManager on Opportunity (before insert) {

    for (Opportunity o = Trigger.new; 
        o.AccountId = true;
        )
    
I appreciate any assistance I can get.

Thanks     
 
Hi, 

My name is Hanna, I just started the  Admin Beginner  Salesforce Platform BasicsGetting Started with the Platform session. I think I am following consciously every steps but still not working....

Could you help me please 

Many thanks 
 
OR( ISCHANGED(Contact), ISCHANGED(Report_Broker) ) AND ( ISBLANK(Report_Level_c))

I'm Receiving this  Extra AND error, how do i get my syntax to be correct?

I'm in need of help creating a Validation rule that does the following task: Field Report level must be completed if Contact or Report Broker fields are updated.
Hi All- as part of the challenge on the 'Creating Validation Rules' module, I created the following Validation Rule on the Contact Object, and confirmed that it indeed is working by creating a few test records.

However when clicking the 'Check Challenge' button, I get the following error.  Any ideas on how to resolve?

Validation Rule:
AND 
( NOT(ISBLANK(MailingPostalCode)), 
NOT(MailingPostalCode = Account.ShippingPostalCode) )
Error:
Challenge Not yet complete... here's what's wrong: 
There was an unexpected error in your org which is preventing this assessment check from completing: System.DmlException: Insert failed. First exception on row 0; first error: FIELD_CUSTOM_VALIDATION_EXCEPTION, Zip Code must match that of the Account. Please correct and save.: [MailingPostalCode]
Thank you in advance for any assistance!
 
Hi

I have a account object which contains 100000 records in it,if i want to write a SOQL query to fetch only 50000 records in it, how to achieve it..

As per governer limit we can retrieve max 50000 records for each SOQL query, is there any possibilities in trigger i can fetch  more than 50000 records, if yes how?

Thanks
Vijay S

Thanks
Vijay S
 
Can anyone tell me when creating an App there is a drop down list asking for the Gender? Can anyone put me an example of use?

Thanks, 

Bea 
We have a visualforce page for building opportunity products.
There's a button - "Save & Exit", which calls the controller method to save the selected products and returns the pagereference - "new PageReference('/' + ApexPages.currentPage().getParameters().get('Id'));"
Basically, it tells the page to go back to the opportunity page. This works perfectly in the classic view. But in lightning, sometimes, after clicking the button, the page goes to a blank page with only lightning sidebar & top bar rather than back to the opportunity page.
Can anyone provide any thoughts on this issue?

Hello Community,

I am a grad student working with Salesforce for the first time and need some assistance.  I apologize for this obviously played out error, but my situation wasn't able to be remedied quickly.  Therefore I am hoping someone can guide/direct me to a solution.  Below is my VF and Controller code.  Thank you in advance!

VF Page:


<apex:page standardController="Lead" extensions="LeadIntakeController" title="Lead Intake Form" showHeader="false">

<apex:form >

<apex:pageBlock title="Critical Needs Form ">

<apex:pageBlockSection title="Lead" columns="1">

<apex:pageBlockSection columns="2">

<apex:outputText escape="false" value="<b>Lead Details</b>" style="sample"/>

<apex:outputText escape="false" style="sample"/> <apex:inputField value="{!lead.FirstName}"/>

....

</apex:pageBlockSection>

<apex:pageBlockSection columns="2">

<apex:outputText escape="false" value="<b>Dependent Information</b>" style="sample"/>

<apex:outputText escape="false" style="sample"/>

<apex:inputField value="{!dependent.Name}" />

<apex:inputField value="{!dependent.Gender__c}" />

.....

</apex:pageBlockSection>

</apex:pageBlockSection>

<apex:pageBlockButtons >

<apex:commandButton value="Save" action="{!save}" />

</apex:pageBlockButtons>

</apex:pageBlock>

</apex:form>

</apex:page>
 

 

Controller: 

public class Lead_Intake_Controller {

   public Lead lead {get;set;}

   public Lead_Intake_Controller(ApexPages.StandardController controller) 
   {
       lead = (Lead)controller.getRecord();
   }
   
   public PageReference save()
   {

        if(lead!=null)
        {
            Datetime bday = lead.Birthdate__c;
            if(bday.Date().daysBetween(System.now().Date()) > 23709)
            {
                lead.Over_65__c = true;
            }
        
        lead.Recipient__c = true;
        lead.Company = 'Self';

        insert lead;
        
        Dependent__c newDependent = new Dependent__c();
        newDependent.Name = 'value';
        newDependent.Parent_Lead__c = lead.Id;
        newDependent.Contact__c = 'someValue';
        newDependent.Birth_Year__c = 'anotherValue';
        
        insert newDependent;
        }
        
        PageReference pageRef = new PageReference('/apex/Lead_Registration_Complete');
        pageRef.setRedirect(true);
        return pageRef;
   }
   }

 

I have a trigger that I need to find a specific role name if the account contact role name is 
"Primary Service Contact" the trigger will inserted or update the field named (
Account_Case_Contact__c with the account contact role name. I tried added this code to my Where statement, but it obvioysly didn't work. Can anyone help me?
)
trigger Trigger_CasePrimaryContact on Account (before insert, before update) {


   for (Account a : Trigger.new) {
   // a.NextStep = 'DEBUG: Running function...';



       AccountContactRole[] contactRoleArray =
       [select ContactID, Role from AccountContactRole where AccountId = :a.id && Role='Primary Service Contact' ORDER BY Role DESC, createdDate];
       if (contactRoleArray.size() > 0) {
         
         
           a.Account_Case_Contact__c = contactRoleArray[0].ContactID;
          
       }else{
      
           // IF NO CONTACT ROLES EXIST RETURN NULL...
           a.Account_Case_Contact__c = null;
           // a.NextStep = 'DEBUG; CONTACT = null ';
       }
   }
    


}
  • November 25, 2015
  • Like
  • 0

We have a large enterprise with a number of different unrelated business units. We are looking to do a smaller Salesforce implementation with some of the smaller business units but would like to keep the enterprise in mind. Everyone is coming from the same domain and will likely use Single Sign On federated through active directory.

Is it possible to delegate admins and developers for apps only? I may have business unit A that has a development staff of 4 and 25 users but what happens when I want to bring on business unit B that has 8 developers and 2000 users?

Do developers have access to all Apex classes in the Org or is there a way those can be partitioned off between business units. I don't want developer in unit A to be able to mess with Developer B's apex class. Nor do I want developer in Unit A to query Unit B's data.

How can an enterprise limit their developer and admin permissions to the app level and have everyone under the same Org? Or is that completely impractical.

Thanks,
Joe

Hi

How to get the value for an field from the keySet().
I don't want the value for all fields but  value for some fields in the object.
And I have to store the selected key and value to another map
Provided the limitation that 'Export Reports' option is not availbale with Lightning, can i open only the Reports tab in a salesforce classic view and all others in the lightning UI? I would basically like to know if i could use a combination on both?
I am referring to the page 214 on apex dev guide and confused with the table as such , am okay with first and second column of it ,but did not get what below meant ? can someone pls explain me 
  • Can update original object using an update DML operation
  • Can delete original object using a delete DML operation
I have field called adjuster history with record 'rocky-1,james-2,John-3'  for getting first string record  used formula as"LEFT(Cust_field__c, FIND("-", Cust_field__c)-1)" but if i removed rocky from database then adjuster history is like ',james-2,John-3' and i get result as ",James-2 " how do i remove unwanted comma from the result.??????
 
Most of the limits I am aware of are around number of workflows on an object, number of field updates per workflow, etc.

if I have a workflow rule fire 3-4 updates every time the record is edited (no time based workflows) and an integration job updates 1M rows of data will Salesforce have any issue with processing 3-4 million field updates as a result? Woukd I expect any time delays?
Hi experts,

I would like to get all fields API names on specific page layout and use the fields in SOQL. Then I want to display the query results on Visualforce page.

I asked Salesforce Support for help but they cannot answer this question so I searched on Discussion Forums and found some articles about DescribeLayoutResult.
https://developer.salesforce.com/forums/?id=906F0000000AG13IAG

I read links for references but I'm just confused and not sure what to do.

Does anyone provide me simple but complete code to display field details on Visualforce page so that I can amend it for my use.
It would be nice if you can use Lead object and Name field.

Thank you in advance.


 
  • March 29, 2016
  • Like
  • 0
The objective of this formula is to calculate the number of days to apply a rebate to based on the billing Period Start Date & Period End Date.

Need help fixing the formula - I am using a text formula field and get error message: - [Syntax error. Extra ',' (Related field: Formula)]  , I am lost on where this extra "," is.  I get a similar error message if I chage formula field type to number formula field.
 
Period_Start_Date__c and Period_End_Date__c. are date format fields 
I am trying to get the formula to check if the period is in Q1 of a leap year so the added day is considered in the final calculation if both criteria are true.
 

text(If(And
 (OR(MOD( YEAR(Period_Start_Date__c), 400 ) = 0, 
  AND(MOD( YEAR(Period_Start_Date__c), 4 ) = 0,
    MOD( YEAR(Period_Start_Date__c), 100 ) != 0)
   ),
      CEILING( MONTH (Period_Start_Date__c) / 3  =  1)),
 
(Period_End_Date__c  - Period_Start_Date__c) + 1)),(Period_End_Date__c  - Period_Start_Date__c ))
Hi, 
I'm trying to see the total revenue of a revenue report on the mobile app, but all I can see are the 2000 rows of data. Is there any way I can create a report page that shows the total revenue of the report. 
In other words, is there any way to create a custom report view with custom fields? 

Thanks!
Alex
Context: We have a custom object called Projects, which sinks to a system called Harvest. The projects have a child object called Time Entries, which stores start time, end time, and duration. Every night, Harvest syncs to these objects and adds new time entires. Every time entry lives on a parent Project. There are two Projects per client account, one for Client Relations, and the other for Development.

What I want: I want a roll up summary field on the Account object that sums the total Dev and CR time from the sum of time entries in the past twelve months. Unfortunately, it is my understanding that you cannot use the Today() formula on rollup summary objects.

I'm new to SFDC development but have been an admin for four years. My theoretical appraoch would be to have a trigger that runs every night on the Time Entries object and says is the date of the entry in the last 12 months, if so, check yes, if not, check no. Because the TODAY() formula will be running in the back end, I can then use that check box to create rollup summary fields and don't need to over complicate it. 

Problem: I've never written code. 

Any help here would be really really appreciated. We have a full sandbox, but no development resources currently, so I'm just trying to get started. 
I realise this question has been asked a few times already but couldn't find any suggested solution that worked for me, so here goes.....

I am currently trying to complete the 'Using Expressions' challenge on the Trailhead Lightning site, and keep getting the same error.

Code
 Component
<aura:component >
    <aura:attribute name="IsSunday" type="Boolean" default="false"/>
    <aura:attribute name="IsMonday" type="Boolean" default="false"/>
    <aura:attribute name="IsTuesday" type="Boolean" default="false"/>
    <aura:attribute name="IsWednesday" type="Boolean" default="false"/>
    <aura:attribute name="IsThursday" type="Boolean" default="false"/>
    <aura:attribute name="IsFriday" type="Boolean" default="false"/>
    <aura:attribute name="IsSaturday" type="Boolean" default="false"/>
    
    <aura:handler name="init" value="{!this}" action="{!c.doInit}"/>
    
    <aura:if isTrue="{!v.IsSunday}">
    <p>Today is Sunday</p>
   </aura:if>
   <aura:if isTrue="{!v.IsMonday}">
    <p>Today is Monday</p>
    </aura:if>
    <aura:if isTrue="{!v.IsTuesday}">
    <p>Today is Tuesday</p>
    </aura:if>
    <aura:if isTrue="{!v.IsWednesday}">
    <p>Today is Wednesday</p>
    </aura:if>
    <aura:if isTrue="{!v.IsThursday}">
    <p>Today is Thursday</p>
    </aura:if>
    <aura:if isTrue="{!v.IsFriday}">
    <p>Today is Friday</p>
    </aura:if>
    <aura:if isTrue="{!v.IsSaturday}">
    <p>Today is Saturday</p>
    </aura:if>
</aura:component>

CONTROLLER
({
    doInit : function(component) {
        var theDate = new Date();
        if (theDate.getDay()==0) {component.set("v.IsSunday", true);}
        if (theDate.getDay()==1) {component.set("v.IsMonday", true);}
        if (theDate.getDay()==2) {component.set("v.IsTuesday", true);}
        if (theDate.getDay()==3) {component.set("v.IsWednesday", true);}
        if (theDate.getDay()==4) {component.set("v.IsThursday", true);}
        if (theDate.getDay()==5) {component.set("v.IsFriday", true);}
        if (theDate.getDay()==6) {component.set("v.IsSaturday", true);}
    }
})

ERROR
Challenge not yet complete... here's what's wrong: 
There was an unexpected error while verifying this challenge. Usually this is due to some pre-existing configuration or code in the challenge Org. We recommend using a new Developer Edition (DE) to check this challenge. If you're using a new DE and seeing this error, please post to the developer forums and reference error id: ZPWCUPZG

I tried creating a new Developer edition, as per a suggestion on another thread, but got the same error (albeit with a different error id).

I went back to my original developer edition and tried another suggestion - modifying the code in my component to have only one <aura:if> statement and one <aura:set attribute....> tag, as shown below:

<aura:component >
    <aura:attribute name="IsSunday" type="Boolean" default="false"/>
    <aura:attribute name="IsMonday" type="Boolean" default="false"/>
    <aura:attribute name="IsTuesday" type="Boolean" default="false"/>
    <aura:attribute name="IsWednesday" type="Boolean" default="false"/>
    <aura:attribute name="IsThursday" type="Boolean" default="false"/>
    <aura:attribute name="IsFriday" type="Boolean" default="false"/>
    <aura:attribute name="IsSaturday" type="Boolean" default="false"/>
    
    <aura:handler name="init" value="{!this}" action="{!c.doInit}"/>
    
    <aura:if isTrue="{!v.IsSunday}">
    <p>Today is Sunday</p>
        <aura:set attribute="else">
                Today is not Sunday
        </aura:set>
    </aura:if>

<!-- Commented out code -->
    <!-- <aura:if isTrue="{!v.IsMonday}">
    <p>Today is Monday</p>
    </aura:if>
    <aura:if isTrue="{!v.IsTuesday}">
    <p>Today is Tuesday</p>
    </aura:if>
    <aura:if isTrue="{!v.IsWednesday}">
    <p>Today is Wednesday</p>
    </aura:if>
    <aura:if isTrue="{!v.IsThursday}">
    <p>Today is Thursday</p>
    </aura:if>
    <aura:if isTrue="{!v.IsFriday}">
    <p>Today is Friday</p>
    </aura:if>
    <aura:if isTrue="{!v.IsSaturday}">
    <p>Today is Saturday</p>
    </aura:if> -->
<!-- Commented out code -->

</aura:component>

Same end result:
Challenge not yet complete... here's what's wrong: 
There was an unexpected error while verifying this challenge. Usually this is due to some pre-existing configuration or code in the challenge Org. We recommend using a new Developer Edition (DE) to check this challenge. If you're using a new DE and seeing this error, please post to the developer forums and reference error id: MEEOAPTN

Any help would be appreciated. have spent quite a lot of time on this already!
Having a challenging day with all of my Trailhead exercises today, All 3 have not gone well, I guess this is a learning experience

Ok, here is the error I'm receiving for his challenge. 
Challenge not yet complete... here's what's wrong: 
A Visualforce page named 'FlowPage' was not found.

I will add the screenshots below:
1. New Customer Flow
New Customer Flow
2. FlowScreen
2. FlowScreen

3. Account Creation
Account Creation
3. Contact Creation

4. Contact Creation
Opportunity Creation

4. Opportunity


I will add the screenshots for the Visual Force Pages on part II of this
We have two Salesforce appexchange product for developers. We need sharp developers on a part-time basis. You will spend 3-4 hours everyday responding to customer requests.

It is okay to have another job.

We are looking for A players. If you are just starting out with Salesforce, please feel free to pass this offer.
Your main task will be:
1. Test our product
2. Respond to customer support requests.

You will not be responsible for development.

We need someone with the following qualities:
1. You are a fast learner.
2. You must have good communication skills.
3. You are great at Salesforce.
Hello SalesForce Developers! :)
I'm looking for SalesForce Developer - this is the best offer in Europe! :) My client from Warsaw needs people with experience, and I think this is good proposal for you.
This is fully remote job, so you can work at home! What do you think about it? :)
 
Regards,
Please contact me on: karolina.grunwald@seargin.com
We are looking for a full time remote Salesforce Developer for a well respected Salesforce partner. Excellent compensation and work/life balance. Please email phil@tech2resources if interested.
I am copying my contacts roles of old opportunity to new opportunit and also copying contact roles of opportunity to contact roles of newly created contract. Now how to wite test class for this ?
String theId = ApexPages.currentPage().getParameters().get('id');
List<OpportunityContactRole> oppRoles;
oppRoles = [SELECT Id, OpportunityID, ContactID, IsPrimary, Role FROM OpportunityContactRole WHERE OpportunityId = :theId LIMIT 10000];
            
//copying contact roles of old opportunity to new opportunity

if ( ! oppRoles.isEmpty()){
                    List<ContractContactRole> conRoles = new List<ContractContactRole>();
                      
                      for (OpportunityContactRole oppRole : oppRoles)
                        { 
                             conRoles.add(new ContractContactRole(
                             ContactId = oppRole.ContactId,
                             IsPrimary = oppRole.IsPrimary,
                             Role = oppRole.Role,
                             ContractId = myContract[0].Id));                       
                         }
                         insert conRoles;
              }
// myContract[0] is also defined and working fine,  code will become long so  here not mentioned, 
/// also copying the contact roles of opportunity to newly created contract

if ( ! oppRoles.isEmpty()){
                    List<ContractContactRole> conRoles = new List<ContractContactRole>();
                      
                      for (OpportunityContactRole oppRole : oppRoles)
                        { 
                             conRoles.add(new ContractContactRole(
                             ContactId = oppRole.ContactId,
                             IsPrimary = oppRole.IsPrimary,
                             Role = oppRole.Role,
                             ContractId = myContract[0].Id));                       
                         }
                         insert conRoles;
              }

Guys any help ?