• kjun
  • NEWBIE
  • 110 Points
  • Member since 2015
  • Salesforce Admin

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 5
    Likes Given
  • 11
    Questions
  • 10
    Replies
I am trying to apply a style in the <apex:outputText> but it doesn't work.
Below is the code:
<apex:outputText  value="Please refer this link for more information <a href =https://www.w3schools.com/>https://www.w3schools.com</a>"/>

So now i wanted to give some css touch to the above hyperlink by changing the
<apex:outputText  value="Please refer this link for more information <a style=color:antiquewhite;text-decoration:underline;padding:42px; href =https://www.w3schools.com/>https://www.w3schools.com</a>"/> etc... but when i try to put the style in the <a> tag it is not working. Can anyone help me on this. 

Thanks 
Hello, 
We had a developer write some code but noticed he left code for the same object in all sorts of places. Wondering if anyone can please let me know what this Apex Trigger is meant to do? 
trigger OpportunityStageTrigger on Opportunity (before insert, before update, before delete, after insert, after update, after delete, after undelete) {
   OpportunityStageTriggerhandler handler = new OpportunityStageTriggerhandler(trigger.new, trigger.old, trigger.newMap, trigger.oldMap, trigger.isInsert,trigger.isUpdate, trigger.isDelete, trigger.isUndelete);
    
    if(trigger.isAfter){
         if(trigger.isUpdate){
            handler.AfterUpdateEvent();
        }
    }
}

 
  • November 13, 2019
  • Like
  • 0
Hello, 

I'm trying to modify the "To" drop down menu that would allow me to choose groups. But not sure if I'm able to add new group to this drop down menu. 

Please let me know if there is. 

Thank you!

User-added image
  • November 02, 2019
  • Like
  • 0
Is it possible to create a formula in process builder where: 

Criteria: 
 
[Lead].IsConverted = False (Boolean)
and
[Lead].ActionOne__c = 1
or
[Lead].ActionTwo__c = 2
or
[Lead].ActionThree__c = 3

Action: 
MyAction__c = False (Boolean)
I'm looking for the criteria formula part. 

Please let me know. 

Thanks!

 
  • October 29, 2019
  • Like
  • 0
I have a check box, Validate__c, that should not be true if the lender__c picklist value = Homes. 

Can someone help me with the format of the validation rule? 
  • October 18, 2019
  • Like
  • 0
I'm trying to prevent an opportunity from saving when StageName = Verification but picklist named Client equals No or is blank. The picklist value must equal Yes. 

Validation rule allows opportunity record to save if picklist value = No or if picklist value is blank. Can someone help me with this? thx
AND(
ISPICKVAL( StageName, 'Verification)'),
ISPICKVAL( Client_Verified__c, 'Yes'))

 
  • October 15, 2019
  • Like
  • 0
Hello, 

I have 5 text fields that are required to be completed when a certain picklist value is chosen. 

The picklist api field name and value are: 

present__c, Yes

the 5 text field api field names are: 

choice_A__c
choice_B__c
choice_C__c
choice_D__c
choice_D__c

Any suggestions or knowledge article I can be referenced to would be great too!
  • September 20, 2019
  • Like
  • 0
Hello, 

I have a validation rule where the Picklist value = Yes, the text area field Assets Items should not be blank. The below VR is prompting that "Data Missing" Asset items are missing! when I complete the Assets Items field. 
Any idea how to modify the VR? 
Thank you!
 
AND(
    ISPICKVAL( Assets__c , 'Yes'),
    ISBLANK( Asset_Items__c )
)


 
  • September 16, 2019
  • Like
  • 0
Hello, 

Trying to retrieve a contact name using a formula from a custom object. 

Custom object api name: TFF__c
Custom Formula Field Name: Spouse

In the custom object custom formula field type, I've named it Spouse. 

Trying to retrieve the Spouse name from the contact record. However, I have setup two contact record types: Primary and Spouse. 

I'm trying to retrieve the Spouse full name which is located in the Spouse record type. 

My formula below only gets me the record type name. 

Can someone help me retrieve the Spouse full name which is located on the contact record but also listed in its own record type? 
 
Client_Name__r.RecordType.Name

 
  • August 29, 2019
  • Like
  • 0
I have this validation rule that works when a user follows a linear approach, however, if the user decides to skip the stage listed in the VR, they will bypass this VR and will be able to skip this stage. 

Any idea on how I can improve this VR so that the user doesn't have the ability to skip stages in an opportunity when saving the record? 

This VR prompts the user to enter a value in the Resolution_Type__c picklist when saving the record. However, if a user skips this stage and selects the stage afterwards, named Secondary, the record will save and the Resolution_Type__c picklist will remain blank. 

I am trying to avoid the Resolution_Type__c  picklist from being left blank. 

The additional stages after Ti In Progress are:

Primary__c
Secondary__c
Qualfied__c


 
AND( 
ISPICKVAL( StageName, 'Ti In Progress'),
RecordType.Name="Personal",
ISBLANK(TEXT( Resolution_Type__c))
)

Thank you!
  • June 29, 2019
  • Like
  • 0
Hello, 

Validation Rule to stop record from saving when a picklist value is blank fires, but not on the correct stage selection.

Use case:

Opportunity Object, has 6 record types (Group, Branch, Vendor, Client, Guest, Ti In Progress)

If the Opportunity RecordTypeId is “0122E000000iFFKQA2”
and the StageName Picklist is “Ti In Progress", a value from the picklist named, Resolution Type, must have a value selected prior to saving the record. If the Resolution Type picklist is left blank, the validation rule should error out the save attempt.

The VR I created is firing but not when the stage = Ti In Progress. I can select a different stage, prior to reaching Ti In Progress and the record errors out. . 

I created this VR, tested it, and found not syntax errors. I was able to save the record even when the Resolution Type picklist was left blank. It should have prompted me to select a value from the picklist. 

Any help on this would be appreciated!
Thanks

 
1AND( 
2ISPICKVAL( StageName, 'Ti In Progress'), 
3RecordTypeId="0122E000000iFFKQA2", 
4ISBLANK(TEXT( Resolution_Type__c)) 
5)

 
  • June 27, 2019
  • Like
  • 0
Created a custom quick action button and visual force page for SF1, I want to add a picklist to my form, how can I achieve this? 

Does this syntax look correct for creating a picklist onto my form using the Account "RecordTypeId" label? 

Also what is the syntax to place the picklist onto the form, I have the syntax for the Account Name correct (<input type="text" id="accountName"/>), but I can't figure out the syntax for a picklist.
<apex:remoteObjects >
        <apex:remoteObjectModel name="Account" fields="Id,RecordTypeId,Name"/>
    </apex:remoteObjects>
    
    <div class="mypage">
        Account Name:
        <input type="text" id="accountName"/>
         <button onclick="createAccount()">Create Account</button>
    </div>
Here's a screenshot of the rendered page within SF1: 

Screenshot of Salesforce 1 Quick Action

This is my entire VF code in case you need to review it. 
<apex:page docType="html-5.0" title="Create Account">

<style>
    .mypage {
        font-family: "ProximaNovaSoft-Regular", Calibri; 
        font-size: 110%;
        padding-top: 12px;
        width: 100%;
    }
    .mypage input[type=text] {
        width: 100%;
        height: 35px;
        -webkit-appearance: none;
        padding: 0 8px;
        margin: 4px 0;
        line-height: 21px;
        background-color: #fff;
        border: 1px solid #ddd;
        border-radius: 3px;
        outline: none;
    }
    .mypage button {
        -webkit-appearance: button;
        border-radius: 3px;
        display: block;
        padding: 12px;
        margin: 4px 0;
        width: 100%;
        background: #eee;
        border: solid 1px #ccc;
    }
</style>
    
    <apex:remoteObjects >
        <apex:remoteObjectModel name="Account" fields="Id,RecordTypeId,Name"/>
    </apex:remoteObjects>
    
    <div class="mypage">
        Account Name:
        <input type="text" id="accountName"/>
         <button onclick="createAccount()">Create Account</button>
    </div>
    
    <script>
        function createAccount() {
            var accountName = document.getElementById("accountName").value;
            var account = new SObjectModel.Account();
            account.create({Name: accountName}, function(error, records) {
                if (error) {
                    alert(error.message);
                } else {
                   sforce.one.navigateToSObject(records[0]);
                }
            });
        }
    </script>
    
</apex:page>

Thank you in advance!
  • April 03, 2016
  • Like
  • 0
Is it possible to create a formula in process builder where: 

Criteria: 
 
[Lead].IsConverted = False (Boolean)
and
[Lead].ActionOne__c = 1
or
[Lead].ActionTwo__c = 2
or
[Lead].ActionThree__c = 3

Action: 
MyAction__c = False (Boolean)
I'm looking for the criteria formula part. 

Please let me know. 

Thanks!

 
  • October 29, 2019
  • Like
  • 0
I'm trying to prevent an opportunity from saving when StageName = Verification but picklist named Client equals No or is blank. The picklist value must equal Yes. 

Validation rule allows opportunity record to save if picklist value = No or if picklist value is blank. Can someone help me with this? thx
AND(
ISPICKVAL( StageName, 'Verification)'),
ISPICKVAL( Client_Verified__c, 'Yes'))

 
  • October 15, 2019
  • Like
  • 0
Hello, 

I have 5 text fields that are required to be completed when a certain picklist value is chosen. 

The picklist api field name and value are: 

present__c, Yes

the 5 text field api field names are: 

choice_A__c
choice_B__c
choice_C__c
choice_D__c
choice_D__c

Any suggestions or knowledge article I can be referenced to would be great too!
  • September 20, 2019
  • Like
  • 0
I am trying to apply a style in the <apex:outputText> but it doesn't work.
Below is the code:
<apex:outputText  value="Please refer this link for more information <a href =https://www.w3schools.com/>https://www.w3schools.com</a>"/>

So now i wanted to give some css touch to the above hyperlink by changing the
<apex:outputText  value="Please refer this link for more information <a style=color:antiquewhite;text-decoration:underline;padding:42px; href =https://www.w3schools.com/>https://www.w3schools.com</a>"/> etc... but when i try to put the style in the <a> tag it is not working. Can anyone help me on this. 

Thanks 
Hello, 

Validation Rule to stop record from saving when a picklist value is blank fires, but not on the correct stage selection.

Use case:

Opportunity Object, has 6 record types (Group, Branch, Vendor, Client, Guest, Ti In Progress)

If the Opportunity RecordTypeId is “0122E000000iFFKQA2”
and the StageName Picklist is “Ti In Progress", a value from the picklist named, Resolution Type, must have a value selected prior to saving the record. If the Resolution Type picklist is left blank, the validation rule should error out the save attempt.

The VR I created is firing but not when the stage = Ti In Progress. I can select a different stage, prior to reaching Ti In Progress and the record errors out. . 

I created this VR, tested it, and found not syntax errors. I was able to save the record even when the Resolution Type picklist was left blank. It should have prompted me to select a value from the picklist. 

Any help on this would be appreciated!
Thanks

 
1AND( 
2ISPICKVAL( StageName, 'Ti In Progress'), 
3RecordTypeId="0122E000000iFFKQA2", 
4ISBLANK(TEXT( Resolution_Type__c)) 
5)

 
  • June 27, 2019
  • Like
  • 0
Hello, 

I'm trying to add additional user ids to the end of this VR:
IF(Op_Assignment__c , true, false)&& 
(NOT($User.Id="005A0000000EcVf"))

I'd like to add these User Ids but not sure the correct syntax without repeating the NOT formula. 
005A0000005MNBy
005A0000004nNCy
 
I am trying to write a validation rule to prevent the stages of an opportunity from being changed, but when the stagename Verified is selected, a picklist field named Client__c is enabled for user to make a selection.

The Client__c field is then disabled (or ability for user not to edit and save record, when the StageName is no longer Client__c (the stageName progresses to the next Stage). 

I'm new and any help is appreciated. 


if certain cycle time fields are blank. For example if date of request and date of approval are blank; stage can not move from prospecting
Hello, 

We have a class and trigger in place which is now producing the error listed below. It is referencing an Apex Class and an Apex Trigger of where the issue is stemming from. 

Can someone help me figure out how I can correct this? 

Thank you!
 
Apex script unhandled trigger exception by user/organization: 005A0000005XYZb/00DA0000033432M

triggerUpdAssignedLead: execution of BeforeUpdate

caused by: System.Exception: Too many SOQL queries: 101

Class.LeadTrigger.<init>: line 47, column 1
Trigger.triggerLead: line 3, column 1

Line 47  of the Class.LeadTrigger can be found in this class code below:  
for(User u : [Select Id, UserType, Contact.AccountId, Contact.Account.Member__c, Exclude_from_Zip_Placement__c From User Where isActive = true]){
 
public without sharing class LeadTrigger {
    //private static boolean alreadyExecuted = false;
    Private Set<String> OpenLeadStatus = new Set<String>{'Awaiting Decision','Initiating Contact','New', 'Quoting', 'Re-Engaged', 'Job Take'};
    Private String QuotingStatus = 'Quoting';
    Private String QuotingCampaignNumber = '34099';
    Private static String MODELER_LEAD = 'Modeler Lead';
    Private static String HOW_LEAD = 'Show Lead';
    Private static String STATUE = 'Statue';
    public static String ClosedStatus = 'Closed By EF';
    public static String ProjectDelayedStatus = 'Project Ending';
    //public static boolean isTest {get; set;}
    //public static boolean isTestUpdateLead {get; set;}
    public static boolean isUpdateLeadStatus {get; set;}
    public static boolean isUpdateHistoryLog {get; set;}
    
    //New class variable creatd for optimization - 10/2016
    //Prevent SOQL Query governor limit exception
    private Map<String,Id> recTypes = new Map<String,Id>();
    private final string queueInsideSalesId;
    private final string dummyCampaignId = null;
    private Map<Id, User> activeUsers = new Map<Id, User>();
    private Set<Id> excludedZipAssignUsers = new Set<Id>();
    
    //Creating class constructor to initialize class objects - 11/2017
    //Prevent SOQL Query governor limit exception
    public LeadTrigger(){
        //Retrieving RecordType information
        for(Schema.RecordTypeInfo rt : Lead.SObjectType.getDescribe().getRecordTypeInfos()){
            String rtName = rt.getName();
            if((rtName == MODELER_LEAD)||(rtName == SHOW_LEAD)){ 
                recTypes.put(rtName, rt.getRecordTypeId());
            }
        }
        
        //Retrieving values for the Lead Assignment - AssignLeads() method
        //Retrieving the default owner (Inside Sales Queue)
        for(QueueSobject queue : [Select QueueId From QueueSobject Where SobjectType = 'Assigned_Lead__c' and Queue.Name = 'Inside Sales']){
            queueInsideSalesId = queue.QueueId;
        }
        
        //Retrieving Dummy Campaign ID for Assigning New Leads to a Campaign
        for(Campaign c : [Select Id, Campaign_Number__c From Campaign Where Name Like '%Dummy%' Limit 1]){
            dummyCampaignId = c.Id;
        }
        
        // Retrieving Active Users List for Lead Assignment
        for(User u : [Select Id, UserType, Contact.AccountId, Contact.Account.Member__c, Exclude_from_Zip_Placement__c From User Where isActive = true]){
            //Retrieving Users excluded by Zip Assignment
            if(u.Exclude_from_Zip_Placement__c ==  true){
                excludedZipPlaceUsers.add(u.Id);
            }else{
                activeUsers.put(u.Id, u);
            }
        }
    }


This is the ApexTrigger code named referenced in the apex error code: 
Trigger.triggerLead: line 3, column 1
 
trigger triggerLead on Lead (after insert, before insert, before update, after update) {

    LeadTrigger lt = new LeadTrigger();
    if (Trigger.isInsert)
        lt.LeadInsertion(Trigger.New, Trigger.isBefore, Trigger.isAfter);
    else if (Trigger.isBefore)
        lt.LeadUpdate(Trigger.New, Trigger.old, Trigger.isBefore);
    
    if (Trigger.isAfter) {
      lt.ReassignALOnClosedLeads(Trigger.New, Trigger.old, null);
      lt.AddToCampaign(Trigger.New, Trigger.oldMap);
      lt.ProcessQuotingLeads(Trigger.New, Trigger.old);
    } else 
      lt.PopulateAmbassador(Trigger.New, Trigger.old);   
      
    
    // 10/22/2015 Ambassador enhancement Tia Xuan 
    if (Trigger.isBefore && Trigger.isUpdate){
      lt.CreateLastVisitTask(Trigger.new);
      lt.CopyHistoryLog(Trigger.new, Trigger.oldMap);   
    }
}





 
Hi, 

I created a lightning component as a quick action button. In the component, I have a cancel button that I want it closed when user clicks.
User-added image

But the problem is that I cannot find any document explain how to close the modal dialog. This is the ui code:
<aura:component controller="ContactController" implements="force:lightningQuickActionWithoutHeader,force:hasRecordId" >
    <style>
        .changeRecordTypeRow {
        margin-top: 1.5rem;
        margin-bottom: 0;
        margin-left: 0;
        margin-right: 0;
        }
        
        .changeRecordTypeLeftColumn {
        float: left;
        text-align: right;
        padding-right: 1.5rem;
        width: 35%;
        font-size: .8125rem;
        color: rgb(84, 105, 141);
        }
        
        .changeRecordTypeRightColumn {
        float: right;
        text-align: left;
        width: 65%;
        }
        
        .modal-body
        {
        	height:auto !important;
        	padding:0;
        }
        
        .forceChatterLightningComponent .bodyWrapper{height:100%;width:100%;padding:0;box-sizing:border-box}
    </style>
    <div class="modal-header slds-modal__header">
        <h2 class="title slds-text-heading--medium" >Change Contact Type</h2>
    </div>
    <div class="scrollable slds-modal__content slds-p-around--medium">
        <div class="changeRecordTypeRow">
            <fieldset class="slds-form-element">
                <div class="changeRecordTypeLeftColumn">
                    <legend class="form-element__legend slds-form-element__label">Select a record type</legend>
                </div>
                <div class="changeRecordTypeRightColumn slds-form-element__control">

                    <span class="slds-radio">
                        <input type="radio" id="radio_PrimaryContact" name="recordType" />
                        <label class="slds-radio__label" for="radio_PrimaryContact">
                            <span class="slds-radio--faux"></span>
                            <span class="slds-form-element__label">Primary Contact</span>
                        </label>
                    </span>
                    <span class="slds-radio">
                        <input type="radio" id="radio_SecondaryContact" name="recordType" />
                        <label class="slds-radio__label" for="radio_SecondaryContact">
                            <span class="slds-radio--faux"></span>
                            <span class="slds-form-element__label">Secondary Contact</span>
                        </label>
                    </span>
                </div>
            </fieldset>
        </div>
	</div>
    <div class="modal-footer slds-modal__footer">
    	<div class="forceChangeRecordTypeFooter">
        	<button type="button" class="slds-button slds-button--neutral .slds-modal__close" aura:id="btnCancel" >
            	Cancel
            </button>
            <button type="button" class="slds-button slds-button--brand" aura:id="btnSave">
            	Save
            </button>
        </div>
    </div>
</aura:component>
Does anyone have similar experience? Thanks in advance.

Salesforce1 has a great Today page which shows the users calendar mashed up with salesforce.com. It works well when the user is not using Salesforce as their primary calendar.  However many want to use Salesforce as the primary calendar.  So - How then do you display a calendar in Salesforce1?

 

This is a hack - but an easy one which works!  Here is how to add a Salesforce calendar to Salesforce1:

 

1) Create a visualforce page "My Calendar"  Be sure to make the page available for salesforce mobile apps.  The content of the page should be:

 

<apex:page showHeader="false" sidebar="false" >

<div style="overflow:scroll; width:100%; height:100%;">
    <object type="text/html" data="https://na2.salesforce.com/00U/c?isdtp=mn"
            style="overflow:scroll; width:1200px; height:2400px;">
    </object>
</div>

</apex:page>

 

2) Add a VisualForce tab for the visualforce page called my calendar.  Ensure the users can access the tab but make it hidden.  Does not need to be mobile ready as that setting is for the Classic Mobile app.

3) Under Mobile Administration / Moble Navigation add the "My Calendar" Visualforce tab to the selected Navigation menu item.

4) Login to Salesforce1 and celebrate your job well done!

 

I hope you find this as useful as I did.

 

 

 

Hello I am new to Apex / Trigger and would like to use it to update one field from another on a custom object. I know this can be done via workflow but would like to try this with  a trigger so I can start to understand more about Apex. I am in the mids of reading about apex etc but would be grateful if someone could give me a few examples.

 

What I am trying to achieve:

 

Object name = Test object

 

Field 1 = A

 

Field 2 = B

 

All I want to do is make "field A" update with "field B" value after update.

 

Thank you