• Paras_Bhatt
  • NEWBIE
  • 70 Points
  • Member since 2015

  • Chatter
    Feed
  • 2
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 9
    Replies
i want to write this query='SELECT idHistorical__c,Name__c,HomeOutstandingValue__c FROM TLItem__c WHERE TLItem__c .Name__c=GLA1 OR TLItem__c .Name__c=GLA2';  

where GLA1='1200-food'; and GLA2='2000=rice' for my batch class how to write?
Please create a Custom List View Button "New Case" that will pre-populate the Contact, Account, Email, based on the current logged in User if the User is external (community profile) and use the standard functionality if he is not
The contact field should be updated with $User.ContactID if the Record Type is Case from Communities


Thanks in Advance.......


Thanks & Regards
Gopal. 
Hi Team,

How can we bulkify this using trigger handler class, please let me know any one.
Trigger :
---------------
trigger OpportunityTrig on Opportunity (before insert, before update, after insert, after update) {
    
    
    if(Trigger.isBefore && Trigger.isInsert){
        
  for(opportunity op : Trigger.New){
            //opportunity o = Trigger.oldmap.get(op.Id);
            if(op.Close_Deal_Date__c != null){
                
                
                Integer y = op.Close_Deal_Date__c.YEAR();
                Integer m = ((op.Close_Deal_Date__c.MONTH()-1)/3)+1;
                String q = String.valueOf(y)+' Q'+String.valueOf(m);
                system.debug('y'+y+' Mon :'+m+' Quarter:'+q);
                op.Reporting_Quarter__c = q;
            }
            else if(op.Close_Deal_Date__c == null){
                op.Reporting_Quarter__c = null;
            }
            
            
        }

    }
    
    if(Trigger.isBefore && Trigger.isUpdate){
       OpportunityTriggerHandlerCls.oppCategoryUpdate((List<Opportunity>)Trigger.New);
        for(opportunity op : Trigger.New){
            opportunity o = Trigger.oldmap.get(op.Id);
            if(op.Close_Deal_Date__c != null && (op.Close_Deal_Date__c != o.Close_Deal_Date__c)){
                
                
                Integer y = op.Close_Deal_Date__c.YEAR();
                Integer m = ((op.Close_Deal_Date__c.MONTH()-1)/3)+1;
                String q = String.valueOf(y)+' Q'+String.valueOf(m);
                system.debug('y'+y+' Mon :'+m+' Quarter:'+q);
                op.Reporting_Quarter__c = q;
            }
            else if(op.Close_Deal_Date__c == null && (op.Close_Deal_Date__c != o.Close_Deal_Date__c)){
                op.Reporting_Quarter__c = null;
            }
            
        }
    }
}

I want to bulkify this code using trigger handler class.


Regards,
Lakshmi
 
I have written the following code in sandbox which is showing 100% test coverage .
But during deployment it is showing the following error:
System.AssertException: Assertion Failed: Expected: false, Actual: true 
Stack Trace: Class.DeleteBillingItemsTest.DeleteBillingItemsTest: line 37, column 1.
Code is as follows:
public class DeleteBillingItems
{
    @InvocableMethod
    public static void BIDelete(List<Id> BIIds)
    {
        List<BillingItem__c> BI =[select id,BillingDocumentId__c,UnitPrice__c,Sub_Segment__c,Gross__c,NettoAmount2__c from BillingItem__c
                          where BillingItem__c.id in :BIIds and BillingDocumentId__c!=Null
                       and UnitPrice__c=0 and Sub_Segment__c='Undefined' and Gross__c=0 and NettoAmount2__c =0 ];
        delete BI;
        }
}

@isTest
Public class DeleteBillingItemsTest{
Static testMethod void DeleteBillingItemsTest(){
Account acc=new Account();
acc.Name='Test';
insert acc;

 Product2 Pd1=new Product2();
   Pd1.Name='Pd01';
   Pd1.Production_Location__c='SMT-TH';
   Pd1.SAP_Product_Nr__c='123';
  Pd1.Module_Source__c='bought';
   insert pd1;
        
 BillingDoc__c BD1=new BillingDoc__c();
            BD1.DocumentType__c='Test01';
            BD1.Name='001';
            BD1.Production_Location__c='SMT-TH';
            BD1.DocumentTypeCode__c='ZOR';
            BD1.DocumentDate__c=System.Today();
            BD1.FacturaDate__c=System.Today();
        insert BD1;

BillingItem__c BI= new BillingItem__c();
BI.Name='Test';
BI.Quantity__c=100;
BI.Units__c='PCE';
BI.UnitPrice__c= 500;
BI.Product2__c=PD1.id;
BI.BillingDocumentId__c=BD1.ID;


insert BI;
BI.UnitPrice__c= 0;
Update BI; 
BillingItem__c deletedBI = [SELECT Id, IsDeleted FROM BillingItem__c WHERE Id = :BI.Id ALL ROWS];
System.assertEquals(deletedBI.IsDeleted, true);



}

}
I have a form in visualforce page.This form have some input text,picklist,radio buttons.
I have some values in a pick list.efault picklist value on page load is None. On selecting a value from this pick list the values from a salesforce record get filled in the input text,radio buttons,etc.
Now what I am looking for is that the input fields radio button and all should be disabled till the selected value of my picklist is set to none.
Can anyone provide me some solution for the problem?

Thanks in advance
Hi all,
I need to make a call out from Salesforce to an external web service which we called it server, but it always shows me an exception: System.CalloutException: IO Exception: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target.

I researched a lot of reference guides and I think this exception is due to Salesforce does not have a server certificate,fianlly, the server system refuses this request from Salesforce.

So far, the technician of the server system has already sent me a server-side certificate for valid connections. This server-side certificate is valid and can be used immediately. So I want to upload this server-side certificate into Salesforce directly instead I need to create a CA-signed certificate and send a CSR file to a seleted certificate authority afterwards.

The answer is very important for me. Could anyone help me ?
 
Thanks in advance.
BR
Yiming
i want to write this query='SELECT idHistorical__c,Name__c,HomeOutstandingValue__c FROM TLItem__c WHERE TLItem__c .Name__c=GLA1 OR TLItem__c .Name__c=GLA2';  

where GLA1='1200-food'; and GLA2='2000=rice' for my batch class how to write?
I have object like "A", In this  object have 4 fields and  i created one custom button like "insert" and also i created vf page for that custom button,now i want to without give any fieldvalues on vf page level .this means i have no inputfields ,in page level i have only "insert" button .when ever i click on insert button i need to insert the record. How can achieve this by using apex class
Please create a Custom List View Button "New Case" that will pre-populate the Contact, Account, Email, based on the current logged in User if the User is external (community profile) and use the standard functionality if he is not
The contact field should be updated with $User.ContactID if the Record Type is Case from Communities


Thanks in Advance.......


Thanks & Regards
Gopal.