• Suraj Tripathi 47
  • ALL STAR
  • 6804 Points
  • Member since 2020
  • Salesforce Application Architect
  • Cloud Analogy


  • Chatter
    Feed
  • 210
    Best Answers
  • 0
    Likes Received
  • 7
    Likes Given
  • 0
    Questions
  • 1783
    Replies
Hi, 

I am new to salesforce development.
How to write helper class for below apex trigger.
the handler class should have same logic. 

trigger DefaultEntitlement on Case (Before Insert, Before Update) { Set<Id> contactIds = new Set<Id>();
Set<Id> acctIds = new Set<Id>();
for (Case c : Trigger.new) {
  contactIds.add(c.ContactId);
  acctIds.add(c.AccountId);
}
List <EntitlementContact> entlContacts =
[Select e.EntitlementId,e.ContactId,e.Entitlement.AssetId
From EntitlementContact e
Where e.ContactId in :contactIds
And e.Entitlement.EndDate >= Today
And e.Entitlement.StartDate <= Today];
if(entlContacts.isEmpty()==false){
for(Case c : Trigger.new){
if(c.EntitlementId == null && c.ContactId != null){
for(EntitlementContact ec:entlContacts){
if(ec.ContactId==c.ContactId){
c.EntitlementId = ec.EntitlementId;
if(c.AssetId==null && ec.Entitlement.AssetId!=null) c.AssetId=ec.Entitlement.AssetId;
break;
        }
   }
 }
}
} else{
List <Entitlement> entls = [Select e.StartDate, e.Id, e.EndDate,
e.AccountId, e.AssetId
From Entitlement e
Where e.AccountId in :acctIds And e.EndDate >= Today
And e.StartDate <= Today];
if(entls.isEmpty()==false){
for(Case c : Trigger.new){
if(c.EntitlementId == null && c.AccountId != null){
for(Entitlement e:entls){
if(e.AccountId==c.AccountId){
c.EntitlementId = e.Id;
if(c.AssetId==null && e.AssetId!=null)
c.AssetId=e.AssetId; break;
         }
     }
   }
}
}
}
}
<apex:page showHeader="false" sidebar="false" renderAs="pdf" applyBodyTag="false"  standardStylesheets="false">
    <head>
        <style>  
        </style>
    </head>
    <apex:form >
        <body data-new-gr-c-s-loaded="14.991.0" spellcheck="false">
            <p style="text-align: center;"><strong>Test Pdf </strong><br /><strong>INFORMATION </strong></p>
            <div style="{!IF((1==1), 'display:block', 'display:none')}">
                <p>TO:&nbsp; <strong>Moblee, LLC</strong><br /><strong>&nbsp; &nbsp; &nbsp; &nbsp; There is </strong><br /><strong>&nbsp; &nbsp; &nbsp; &nbsp; Mount BSR</strong></p>
            </div>
            
            <div style="{!IF((1==2), 'display:block', 'display:none')}">
                <p>TO:&nbsp; <strong>Task, LLC</strong><br /><strong>&nbsp; &nbsp; &nbsp; &nbsp; PO 538643254</strong><br /><strong>&nbsp; &nbsp; &nbsp; &nbsp; hostel</strong></p>
            </div>
            
            <p>RE:<span style="white-space:pre;">&nbsp; &nbsp;&nbsp;</span>Patient Name: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</p>
            <p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Date of Birth: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Number: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</p>
            <p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;I authorize and request the disclosure of all protected information for the purpose of review and evaluation in connection with a legal claim. I expressly request that the designated record custodian or agent of the covered  under entity identified above disclose full and complete protected medical information including the following:</p>
            
            <p>I love the feel of wood curls flying off the lathe as I begin to shape the log in front of me. The sound of scraping changes based on the wetness of the wood, the speed at which the lathe is turning, and the type of cut I am making. The smell and feel of wet wood being turned are unique. The water is sprayed out as I cut through the different layers of wood. A log can turn into anything one's imagination can think of with the right set of hands-on tools. I have those hands and imagination. I use all of my senses and intuition to create a beautiful object. That is why I enjoy turning wood.</p>
            <p>Twenty-five stars were neatly placed on the piece of paper. There was room for five more stars but they would be difficult ones to earn. It had taken years to earn the first twenty-five, and they were considered the "easy" ones.</p>
            <p>______________________________________________________________________________<br />Name</p>
            <p>______________________________________________________________________________<br />Law </p>
            <p>______________________________________________________________________________<br />Street Address<br /></p>
            <p>The alarm went off at exactly 6:00 AM as it had every morning for the past five years. Barbara began her morning and was ready to eat breakfast by 7:00 AM. The day appeared to be as normal as any other, but that was about to change. In fact, it was going to change at exactly 7:23 AM.</p>
            <ul>
                <li>I have a right to revoke .</li>
                <li>The information released in response </li>
                <li>My treatment in payment for my treatment.</li>
            </ul>
            <p>Then came the night of the first falling star. It was seen early in the morning, rushing over Winchester eastward, a line of flame high in the atmosphere. Hundreds must have seen it and taken it for an ordinary falling star. It seemed that it fell to earth about one hundred miles east of him.</p>
            <p>Signature of Patient / Legally Authorized Representative<span style="white-space:pre;">&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</span>Date</p>
            <p>Signature<span style="white-space:pre;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp;</span>Date</p>
        </body>
    </apex:form>
</apex:page>Here is Pdf
I want to create an aura component to display the account details page and its related contacts.

Thanks
Whenever I update the Account Phone , Then please,  update it's Related Contact Phone Number If  related Contact Exist .                                    

Hello, I'm having trouble, when sending an email (plain text and html) through a flow. Each time line breaks dont work and I'm not sure what works properly? I've used BR() with no luck. Here is what I get when I send a rich HTML template:

How do you add line breaks effectively in both instances? I couldn't find a straight answer online or in the documentation (perhaps I looked in the wrong place).

User-added image

I have a requirement which is
If account name field in account object contains any value from industry field(picklist),the word contained in account name field should be updated in industry picklist using apex. how can i do that?Can u please help me with this requirement.I have written the following code:


trigger updateIndustryFieldTrigger on Account (before update) {
    List<Account> accList = [SELECT Id,Name FROM Account];
    for(Account acc : Trigger.New){
        for(Account a : acc.Industry){
            if(acc.Name.contains(acc.Industry)){
                acc.Industry += acc.Industry;
            }else{
                acc.Industry = 'Other';
            }
        }
    }
}
  • October 01, 2021
  • Like
  • 0
update condition
if contact email  is null then insert the some xyz@mail in email field
if contact email is not null then copy the value of contact email in custom field cemail_c on contact
 
write test class of trigger if expected salary is equal to null then put validation Expected Salary field is missing
Hi ,

We have a requirement to display all the records which are having start date in 3 months past and in 3months future in the Objects Tab List View.

Tried creating formula fields to calculate the date and display the records in the list view when this formula field becomes true.

Start_Date_vod__c <= Today() - 30

But this formula displays only one record which has a start date <= today - 30 and not the other records.

Could you please help me in achieveing this requirement?

Thanks,
Monisha
 
Hi,

I have a requirement where need to create  private key and upload it to Salesforce certificates then need to provide APIGEE with the public key. ,how to this step by step?

Any help on this is highly appreciated

Regards
Fiona

 

Hi,

Please help. I am trying to add some conditional statement like in vfpage on my aura component but I am not able to do it. It keeps showing me the same error. 
User-added image

<aura:component implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes,force:lightningQuickAction" access="global" >
    
    <aura:attribute type="Integer" name="score"/>
    
    <aura:if isTrue="{!v.score > 0 && v.score < 10}">
    <b>You are not eligible</b>
    </aura:if>
    
</aura:component>
 

Please let me know if I am doing something wrong!

I create a datatable in aura component but after running it I found 
no record in my table and error also not coming. any suggestion
I am getting this error while previewing visualforce page. ==> Error: Unknown property 'AccountStandardController.con'


Visualforce page:

<apex:page standardController="Account" extensions="ExtensionController5">
<apex:form >
<apex:pageBlock title="Account Information" id="account"> <apex:pageBlocksection>
<apex:inputField value="{!con.accountId}"/>
<apex:actionsupport event="onchange" action="{!accountselected}" rerender="account,msgs" status="stat"/>
</apex:pageBlockSection
</apex:pageBlock>
</apex:form>
</apex:page>


Controller:

public class ExtensionController5{ private ApexPages.StandardController Stdctrl;
public ExtensionController5(ApexPages.StandardController controller){ Stdctrl=controller; }
public void AccountSelected() { contact con=(contact) StdCtrl.getRecord();
if (!string.IsBlank(con.accountid))
{ con.account=[select Name,Phone from Account where id=:con.accountid]; }
else { con.account=null; } } }
Hi All

I Have Stored a Image in Static resource and by using
<apex:image id="Logo5" value="{!$Resource.Logo5}" width="100%" />
I added in VF page

But the image should be displayed full , i marked with the yellow sketch those area also the image should occupy ,
How Can i achieve This ? , What changes should i make

Thanks In advance

User-added image
 I have just started my salesforce journey so I'm sorry If my doubt is too silly but please help me
Apex class code:
public with sharing class TrackOrderController {
    public string ordernum {get; set;}
    public date orderDate {get; set;}
    public List<Order> Order {get; set;}
    public List<OrderItem> status {get; set;}
    public List<string> vrs {public get; private set;}
    public List<string> pro {public get; private set;} 
    public List<integer> index {public get; private set;}
    
    public PageReference findOrder()
    {
        try{
      
        Order = [SELECT id FROM Order where PoNumber=:ordernum and PoDate =: orderdate ];
        status = [SELECT Product_name__c,Vehicle_Request_Status1__c FROM OrderItem WHERE OrderId =: Order[0].Id];
        system.debug('size-->'+status.size());
        vrs = new List<String>();
        index = new List<integer>();   
        for(integer i=0; i<status.size(); i++){
            index.add(i);
            if(status[i].Vehicle_Request_Status1__c != null){
            vrs.add(status[i].Vehicle_Request_Status1__c);
            }else{
                vrs.add('Null');
            }
        }
           
        system.debug(status);
        system.debug('vrs list--->'+vrs);
        system.debug('index list--->'+index);
        pro = new List<string>();
        for(integer i=0; i<status.size(); i++){
             pro.add(status[i].Product_name__c);
        }

        system.debug('pro list--->'+pro);
        return null;
        }
        catch(Exception ex){ ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.ERROR,'Please check purchase number and date')); return null; }
    }
    public PageReference reset() {
        PageReference newpage = new PageReference(System.currentPageReference().getURL());
    newpage.setRedirect(true);
    return newpage;
    }
}


Test class:
@isTest(SeeAllData=true)
public class TrackOrderControllerTest {
    
static testMethod void findOrder(){
  
      Account acc = New Account();
        acc.name = 'test';
        acc.CR_Number__c = '1234567890';
        acc.CustomerName__c = 'test acc';
        acc.CR_Date_English__c = Date.newInstance(2016, 12, 9);
        acc.CR_Capital__c = 12426;
        acc.Current_Revenue__c = 1233;
        acc.Special_Admin_Rate__c = 123456;
        acc.Security_Type__c = 'ghayth';
        acc.ID_Issuer__c = 'asdasd';
        acc.CR_City__c = 'asdasd';
        acc.Workforce__c = 'sdadad';
        acc.In_Business__c = 'sdasdasdas';
        acc.Nationality_of_Business__c = 'India';
        acc.Arabic_Date__c = Date.newInstance(2016, 10, 7);
        acc.Company_Establishment__c = 'sdads';
        acc.Bank2__c = 'sdfdsf';
        acc.City_Region__c = 'sadf';
        insert acc;  
        
        Product2 newProduct = new Product2();
        newProduct.name = 'abc';
        newProduct.Varient__c = 'asd';
        newProduct.Make__c = 'AMI';
        newProduct.Model__c = 'SEMI TRAILER';
        newProduct.ModelYear__c = 2018;
        newProduct.Fuel_Type__c = 'Petrol';
        newProduct.Transmission__c = 'Powershift';
        newProduct.Internal_Purchase_Price__c = 25;
        newProduct.Registration_Fee__c = 25;
        Insert newProduct;
        
         Pricebook2 customPB = new Pricebook2(Name='Custom Pricebook', isActive=true);
        insert customPB;
        
        PricebookEntry customPrice = new PricebookEntry(
            Pricebook2Id = customPB.Id, Product2Id =newProduct.Id,
            UnitPrice = 12000, IsActive = true);
        insert customPrice;
        
    Order ord = new Order ();
    ord.AccountId =acc.Id;
        ord.PoNumber='PO67543';
        ord.PoDate = Date.newInstance(2016, 10, 5);
        ord.Status ='Draft';
        ord.EffectiveDate= system.today();
        ord.Pricebook2Id = customPB.Id;
    insert ord;
    
    OrderItem orditem = new OrderItem();
    orditem.OrderId = ord.Id;
        Orditem.Vehicle_Request_Status1__c ='PO Approved';
        orditem.PricebookEntryId =customPrice.Id;
        orditem.UnitPrice= 678;
        orditem.Quantity= 7;
    insert orditem;
        
      
    /*  list<OrderItem>status=new List<OrderItem>();
        list<integer>index=new List<integer>();
        status = [SELECT Product_name__c,Vehicle_Request_Status1__c FROM OrderItem WHERE OrderId =: ord.Id];
    for(integer i=0; i<status.size(); i++){
            index.add(i);
        } */
         PageReference testPage = Page.TrackOrder;
         Test.setCurrentPage(testPage);
         testPage.getParameters().put('Id', String.valueOf(ord.Id));
    Test.StartTest(); 
      ApexPages.StandardController sc = new ApexPages.StandardController(ord);
            TrackOrderController  testord = new TrackOrderController();
      testord.findOrder();
      testord.reset ();

    Test.StopTest();
        
  }
}
Hi all,
I want to add commas in the amount field like 100000 amount is like then I have to show it on vfp pdf as 1,00,000.00 as an Indian standard currency type. I have used #,### but it's not working properly if have a greater amount please suggest.
Thanks.
Original code:
public class MessageAlert {
    @auraenabled
    public static Boolean getmessages(String recordId){
        Boolean checkExpDate = False;
        List<LVSCR_c> contactList = new List<LVSCR_c>();
        Set<String> newSet = new Set<String>();
        //     Set<String> existingSet = new Set<String>();
        for ( LVSCR__c lvs : contactList ) {
            system.debug(lvs);
            if ( lvs.Contact__c != null ) {
                newSet.add(lvs.Contact__c);
            }
        }
        system.debug('newset--->>'+newSet);
        
        List <LVSCR_c> soql = new List<LVSCR_c>();
        soql = [SELECT Id,Contact_c FROM LVSCRc WHERE Id =: recordId AND Contact_c IN: newSet];
        system.debug('soql--->'+soql);
        if(soql.size()>0){
                //checkExpDate = True;
        }
        else{
                checkExpDate = False;
        }
        return checkExpDate;
    }
}

I hav tried but Its not covering the whole code.
apex test class:

@isTest
private class MessageAlertTest{
        @isTest
        static boolean getmessages(){
            List<LVSCR_c> conlist = new List<LVSCR_c>();
            Boolean checkExpDate = False;

            Lvscr_c lvscrcObj = new Lvscr_c ();
            lvscrcObj.Id='0012600001Ck4AEAA';
            lvscrcObj.Contact__c = '0012600001Ck4AEAA'; 
            lvscrcObj.Delivery_Type__c ='Original'; 
            lvscrcObj.LAFS__c = '122255'; 
            lvscrcObj.Tamm_Authorisation__c ='Yes';
            conlist.add(lvscrcObj);
            update conlist; 
            return checkExpDate;
      
         
    }

    @isTest static void testMethod1() {
        // code_block    
    }

    @isTest static void testMethod2() {
        // code_block    
    }
}
How to get email alert to identify Error in the schedulable Batch 
How to add error handling in the catch batch
global class updatePolicyStatusSchedule implements Schedulable {
    global void execute(SchedulableContext ctx) {
        updatePolicyStatus();
    }
    
    public void updatePolicyStatus() {
        List<Policy__c> expiredInForcePolicies = [SELECT Id, Status__c, Policy_End_Date__c, Policy_Effective_Date__c
                                                  FROM Policy__c
                                                  WHERE (Policy_End_Date__c <= TODAY AND Status__c != 'Expired' AND Status__c != 'Terminated')
                                                  OR (Policy_Effective_Date__c <= TODAY AND Policy_End_Date__c > TODAY AND Status__c NOT IN ('In Force','In-Force - Non-Renewing'))];

        List<Policy__c> updateExpiredInForcePolicies = new List<Policy__c>();
        

        for(Policy__c policy : expiredInForcePolicies){
            if((policy.Policy_End_Date__c<=System.today() && policy.Status__c!='Expired' && policy.Status__c!='Terminated') && !(policy.Policy_Effective_Date__c <= System.today() && policy.Policy_End_Date__c > System.today() && (policy.Status__c!='In Force' || policy.Status__c!='In-Force - Non-Renewing'))){
                policy.Status__c = 'Expired';
            }

            if(!(policy.Policy_End_Date__c<=System.today() && policy.Status__c!='Expired' && policy.Status__c!='Terminated') && (policy.Policy_Effective_Date__c <= System.today() && policy.Policy_End_Date__c > System.today() && (policy.Status__c!='In Force' || policy.Status__c!='In-Force - Non-Renewing'))){
                policy.Status__c = 'In Force';
            }
            
            updateExpiredInForcePolicies.add(policy);
        }
    if(!updateExpiredInForcePolicies.isEmpty()){
    try {
 
            Database.update(updateExpiredInForcePolicies);  
        } catch(DmlException e) {
            System.debug('The following exception has occurred: ' + e.getMessage());
        }
    
        }
    }
}



Thank you 
Hi All,

I am trying to optimize a code.
The code uses nested For loop to compare values from new trigger and old trigger. As a result, some time it hits the Apex CPU Time Limit error for a large volume of data.
I would like to ask if there is any better and efficient way to handle this situation.
Many thanks in advance!
 
Hi, 

I am new to salesforce development.
How to write helper class for below apex trigger.
the handler class should have same logic. 

trigger DefaultEntitlement on Case (Before Insert, Before Update) { Set<Id> contactIds = new Set<Id>();
Set<Id> acctIds = new Set<Id>();
for (Case c : Trigger.new) {
  contactIds.add(c.ContactId);
  acctIds.add(c.AccountId);
}
List <EntitlementContact> entlContacts =
[Select e.EntitlementId,e.ContactId,e.Entitlement.AssetId
From EntitlementContact e
Where e.ContactId in :contactIds
And e.Entitlement.EndDate >= Today
And e.Entitlement.StartDate <= Today];
if(entlContacts.isEmpty()==false){
for(Case c : Trigger.new){
if(c.EntitlementId == null && c.ContactId != null){
for(EntitlementContact ec:entlContacts){
if(ec.ContactId==c.ContactId){
c.EntitlementId = ec.EntitlementId;
if(c.AssetId==null && ec.Entitlement.AssetId!=null) c.AssetId=ec.Entitlement.AssetId;
break;
        }
   }
 }
}
} else{
List <Entitlement> entls = [Select e.StartDate, e.Id, e.EndDate,
e.AccountId, e.AssetId
From Entitlement e
Where e.AccountId in :acctIds And e.EndDate >= Today
And e.StartDate <= Today];
if(entls.isEmpty()==false){
for(Case c : Trigger.new){
if(c.EntitlementId == null && c.AccountId != null){
for(Entitlement e:entls){
if(e.AccountId==c.AccountId){
c.EntitlementId = e.Id;
if(c.AssetId==null && e.AssetId!=null)
c.AssetId=e.AssetId; break;
         }
     }
   }
}
}
}
}
Hi,
I have a custom object related to Case (lookup field)... I've created an LWC to edit some fields from my custom object on the Case record page.
Once the LWC is submitted I need to make the Case record page in Edit state and repopulate some field values.
Is it possible to do?
Thanks,
How do I go about dividing a record detail page into two or more pages but can still be accessed on the same record detail page? For example, if there are many fields in a detail page, instead of scrolling down to access more fields, you can click on a button that hides the 1st page and shows the 2nd page which shows the rest of the fields. There should also be an option to go back to first page.
<apex:page showHeader="false" sidebar="false" renderAs="pdf" applyBodyTag="false"  standardStylesheets="false">
    <head>
        <style>  
        </style>
    </head>
    <apex:form >
        <body data-new-gr-c-s-loaded="14.991.0" spellcheck="false">
            <p style="text-align: center;"><strong>Test Pdf </strong><br /><strong>INFORMATION </strong></p>
            <div style="{!IF((1==1), 'display:block', 'display:none')}">
                <p>TO:&nbsp; <strong>Moblee, LLC</strong><br /><strong>&nbsp; &nbsp; &nbsp; &nbsp; There is </strong><br /><strong>&nbsp; &nbsp; &nbsp; &nbsp; Mount BSR</strong></p>
            </div>
            
            <div style="{!IF((1==2), 'display:block', 'display:none')}">
                <p>TO:&nbsp; <strong>Task, LLC</strong><br /><strong>&nbsp; &nbsp; &nbsp; &nbsp; PO 538643254</strong><br /><strong>&nbsp; &nbsp; &nbsp; &nbsp; hostel</strong></p>
            </div>
            
            <p>RE:<span style="white-space:pre;">&nbsp; &nbsp;&nbsp;</span>Patient Name: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</p>
            <p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Date of Birth: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Number: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</p>
            <p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;I authorize and request the disclosure of all protected information for the purpose of review and evaluation in connection with a legal claim. I expressly request that the designated record custodian or agent of the covered  under entity identified above disclose full and complete protected medical information including the following:</p>
            
            <p>I love the feel of wood curls flying off the lathe as I begin to shape the log in front of me. The sound of scraping changes based on the wetness of the wood, the speed at which the lathe is turning, and the type of cut I am making. The smell and feel of wet wood being turned are unique. The water is sprayed out as I cut through the different layers of wood. A log can turn into anything one's imagination can think of with the right set of hands-on tools. I have those hands and imagination. I use all of my senses and intuition to create a beautiful object. That is why I enjoy turning wood.</p>
            <p>Twenty-five stars were neatly placed on the piece of paper. There was room for five more stars but they would be difficult ones to earn. It had taken years to earn the first twenty-five, and they were considered the "easy" ones.</p>
            <p>______________________________________________________________________________<br />Name</p>
            <p>______________________________________________________________________________<br />Law </p>
            <p>______________________________________________________________________________<br />Street Address<br /></p>
            <p>The alarm went off at exactly 6:00 AM as it had every morning for the past five years. Barbara began her morning and was ready to eat breakfast by 7:00 AM. The day appeared to be as normal as any other, but that was about to change. In fact, it was going to change at exactly 7:23 AM.</p>
            <ul>
                <li>I have a right to revoke .</li>
                <li>The information released in response </li>
                <li>My treatment in payment for my treatment.</li>
            </ul>
            <p>Then came the night of the first falling star. It was seen early in the morning, rushing over Winchester eastward, a line of flame high in the atmosphere. Hundreds must have seen it and taken it for an ordinary falling star. It seemed that it fell to earth about one hundred miles east of him.</p>
            <p>Signature of Patient / Legally Authorized Representative<span style="white-space:pre;">&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</span>Date</p>
            <p>Signature<span style="white-space:pre;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp;</span>Date</p>
        </body>
    </apex:form>
</apex:page>Here is Pdf
trigger findingoppcount on OpportunityLineItem (after insert) {
    List<Account> acc = new List<Account>();
    Set<Id> oppId = new Set<Id>();
    Map<Id,List<OpportunityLineItem>> Account_opplineitems = new Map<Id,List<OpportunityLineItem>> ();
    
    for( OpportunityLineItem oppLine : Trigger.New ){
        oppId.add( oppLine.OpportunityId );
        system.debug('oppid'+oppId);
    }
    
    
    
    for( Opportunity opp : [ SELECT Id, AccountId,
                            ( SELECT Id, Product2Id FROM OpportunityLineItems ) 
                            FROM Opportunity WHERE Id IN: oppId ] ){
                                for(OpportunityLineItem oli_obj :opp.OpportunityLineItems){
                                    if(Account_opplineitems.containsKey(opp.AccountId) && Account_opplineitems.get(opp.AccountId) != null) {
                                        List<OpportunityLineItem> lst_terr = Account_opplineitems.get(opp.AccountId);
                                        lst_terr.add(oli_obj);
                                        Account_opplineitems.put(opp.AccountId,lst_terr); 
                                    }   
                                    else {
                                        Account_opplineitems.put(opp.AccountId, new List<OpportunityLineItem> {oli_obj});
                                    }
                                    
                                }                                
                            }
    system.debug('Account_opplineitems'+Account_opplineitems);
    
}
null: Status: bad value for restricted picklist field: Draft
how to fix the error.it is restricted but how to make unrestricted can anyone solve my problem.
I tried to delete files directly from the content details page, I'm getting an error: "This document is awaiting archival. Cannot delete the file at this time. Please try again later".

Anyone, please share the apex code that deletes content files from salesforce.

Thanks in advance.
I'm developing an aura compoenet which retrieves the existing Case Record for edit. I'm able to retrieve picklist value but not the multi-select picklist using force:recordData.
How to sort alphabetically a Select Option?
I see some examples but, the most close is from a github rep, but they didn't sort number also..
I need to order [0-9-A-Z]
Please, some help? I loosing my mind with this.
<apex:page>
<apex:includeScript value="/support/console/53.0/integration.js" />
<script type="text/javascript">
var primaryTabName = 'Acme';
function alertSuccess(result) {
if (result.success) {
alert('Operation is SUCCESS');
}
else {
alert('Operation FAIL');
}
}
//open primary tab
function openPrimaryTab() {
sforce.console.openPrimaryTab(null, '/005d0000006HkroAAC', true,
'SFDC', alertSuccess, primaryTabName);
}
</script>
<div id="result" />
<A HREF="#" onClick="openPrimaryTab();return false">openPrimaryTab</A>
<br/>
</apex:page>

This is always returning 'Operation FAIL'. Please help me here.
I want to open a new salesforce tab on clicking a link.
I want to create an aura component to display the account details page and its related contacts.

Thanks
When we place a Visualforce component container in Lightning Page, the current release displays them correctly without extra spacing, thus allows a developer to control the look and feel of the Visualforce Page interface.

But in Spring '17 Pre-release org, the Visualforce Component container has extra padding on left/right/top/bottom, with dark gray background color, thus placing the existing Visualforce Pages to look awkwardly spaced out.

User-added image
 
  • December 29, 2016
  • Like
  • 1
We have a public site and we want to get the site logo from the document. The associated Document record is not returned on querying by a guest user with user license "Guest User". But it returns a row if internal SF user queries for the same. Can you please suggest a solution for the same?
Hi Team,

I have an object called Leave Tracker, where users enter the leave date, reason, and number of hours, user can create more than one record in a day with different hours, ex: 1 entry with 2 hours and another entry with 4 hours. but my request is that we should not allow a user to create/update a leave tracker record if the leave hours are more than 8 in a single day per user?

any help is appreciated.

Thanks,
Madhu