• faww afaw
  • NEWBIE
  • 0 Points
  • Member since 2021

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 5
    Replies
I'm having around 20k+ emaila in my OWA mailbox. Since our organization is moving to Google Apps now, we need to export the whole data. Could anyone suggest how do I do it?
Hi All,

Am wrote a test class for my Apex class. After that also my class not covered by 0%.

Kindly let me know where am doing the mistake?

Hi,

Kindly anyone suggests me to write a test class for this Apex class?

public class IssuedConsumable{

Dispatched_Raw_Material__c DPRM= new Dispatched_Raw_Material__c();

public list<Dispatched_Raw_Material__c> listAccount{get;set;}

{
listAccount=new list<Dispatched_Raw_Material__c>();
listAccount.add(DPRM);
}

Public void addRows()
{
Dispatched_Raw_Material__c acc = new Dispatched_Raw_Material__c();
listAccount.add(acc);
}
public PageReference saveAccount() {
for(Integer i=0; i<listAccount.size(); i++)
{
insert listAccount;
ApexPages.addmessage(new ApexPages.message(ApexPages.severity.INFO,'Created Successfully'));    

}
Return page.IssuedConsumable;

}
}

My Test Class:

@isTest(seealldata=true)
Public class IssuedConsumable_test{
    static testMethod void IssuedConsumable_test(){
        
        GetInitialData Getdata = new GetInitialData();
        list<Account> acc = Getdata.getAccount();
        list<Product2> lstprod = Getdata.getProd();
        list<Opportunity> Opp = Getdata.getOpp();
        list<Pricebook2> lstPB = Getdata.getpricebook();
        list<Pricebookentry> lststdPbe = Getdata.getstdpbe();
        list<Pricebookentry> lstPbentry = new list<Pricebookentry>();
        insert lstprod; 
        
        Integer indexvalue = 0;
        if(lstprod.size()>0)
        {
            for(pricebookentry irow :lststdPbe)
            {
                irow.product2id = lstprod[indexvalue].id;
                
                indexvalue++;
            }
        }
        
        
        insert lststdPbe;
        
        insert lstPB; 
        
        
        if(lstprod.size()>0)
        {
            for(pricebook2 irow :lstPB)
            {
                for(Product2 ipro : lstprod ){
                    Pricebookentry pbe = new Pricebookentry();
                    pbe.product2id = ipro.id;
                    pbe.pricebook2id = irow.id;
                    pbe.unitprice = 3000;
                    pbe.isActive = true;
                    lstPbentry.add(pbe);
                }
            }
        }

        insert lstPbentry;
        insert acc[0];
        
        Opp[0].accountId = acc[0].id;
        insert Opp[0]; 
        
        Opp[0].Pricebook2Id = lstPB[0].id;
        update Opp[0];
        
        OpportunityLineItem OL = new OpportunityLineItem(opportunityid=Opp[0].id, Quantity=1, unitprice=8000,  
            pricebookentryid=lstPbentry[0].id);
        insert OL; 
        
     
        
        Tax_Master__c   txm= new Tax_Master__c(CGST__c=14.00,HSN_Code__c=lstprod[0].HSN_Code__c,IGST__c=28.00,SGST__c=14.00, Start_Date__c =  Date.newInstance(2017, 07, 06), End_Date__c = System.today()+2);
        insert txm;  
            
        Quote Q = new Quote();
        Q.Name = 'QuoteOrbit';
        Q.OpportunityId = Opp[0].id; 
        Q.Quote_Count__c = 00000000;
        Q.Quote_Number__c ='000000';
        Q.Approved__c = false;
        Q.Quotation_Date__c = date.newinstance(2013,3,5);
        Q.Pricebook2Id = lstPB[0].id;
        Q.Tax_Classification__c='IGST';
        Q.Discount_Amount__c = 100;
       
        
        insert Q;  
       
        
        Quotelineitem QL = new Quotelineitem(quoteId=Q.id,SGST__c=6, CGST__c=6,IGST__c =0,Quantity =1, Unitprice=8000,pricebookentryid=lstPbentry[0].id);
        insert QL;  
        
            
        
    
    
    
    
        Project__c p = new Project__c(Name = 'NewProject',Project_Type__c = 'New PE',
        Opportunity__c = Opp[0].id,  
                       Quote__c = q.id);
        insert p;
        
        Product2 prod = new Product2(Name = 'ProdTest', CST__c = 2, Central_Excise__c = 3, VAT__c = 4, 
                        Family = '');
        insert prod; 
        
        Employee__c e = new Employee__c(Name = 'lakshmanan');
        insert e; 
               
        Project_Item__c pi = new Project_Item__c(Project__c = p.id,Status__c = 'In Progress',Product__c = prod.id,
                                 Technician_Member__c = 'suren; lakshmanan');
        insert pi;  

        
        QuoteLineItem qli = new QuoteLineItem (QuoteId = q.id,PricebookEntryId = lstPbentry[0].id, Quantity = 10,
                            UnitPrice = 100);
        insert qli;                    

        
         RawMaterial__c rm1 = new RawMaterial__c(Name = 'Painting Mask',Unit__c='MM');
        insert rm1;
       
        
       Raw_Material_Inventory__c  RW= New Raw_Material_Inventory__c(Name='Painting Mask');
       
        insert  RW ;  
        
        Dispatched_Raw_Material__c DR= new Dispatched_Raw_Material__c(Raw_Material_Inventory__c=RW.ID);
        insert DR;      
         
         IssuedConsumable RMR = New IssuedConsumable();
         rmr.addRows();
         rmr.saveAccount();
          
    }
}
 
I have setup a CTI integration with Switchvox. I am not getting any kind of SoftPhone showing up in my Salesforce console. 
  • I have a new instance of Salesforce. My email address is wmachugh@i.farm. 
  • I have a switchvox pbx running the latest version of Switchvox which is version 6.3.4.1. The hostname is pbx.i.farm. 
  • I followed the directions on the following link that is listed as the current plugin specification for the Switchvox interface. 
  • http://kb.digium.com/articles/FAQ/How-do-i-set-up-the-Switchvox-Salesforce-Plugin?retURL=%2Fapex%2FknowledgeProduct&popup=false
  • I have created a support ticket with Digium. The support ticket is #00612590. They reviewed my setup and said my configuration is correct. They have escalated it to their engineers. My system number is NXT600. You may call them at (256) 428-6161
  • I have created a trouble ticket at Salesforce. The ticket number is 15661037. They say my only interface to technical support is through the developer forum. 
  • I have tried switching from Lightning to Classic user interfaces. On the Classic interfaces a small window where the SoftPhone plugin should go shows up, but it's blank. After some time it displays a message 502. When I switch back to Lightning interface, there is no change to the user interface. 
Here is the text of the JSON that I imported into Call Centers section of the platform setup. 

<?xml version="1.0" encoding="UTF-8"?>
<callCenter>
  <section sortOrder="0" name="reqGeneralInfo" label="General Information">
    <item sortOrder="0" name="reqInternalName" label="InternalName">SwitchvoxCTI</item>
    <item sortOrder="1" name="reqDisplayName" label="Display Name">SwitchvoxCTI</item>
    <item sortOrder="2" name="reqAdapterUrl" label="CTI Adapter URL">https://pbx.i.farm/realtime/salesforce/</item>
    <item sortOrder="3" name="reqUseApi" label="Use CTI API">true</item>
    <item sortOrder="4" name="reqSoftphoneHeight" label="Softphone Height">480</item>
    <item sortOrder="5" name="reqSoftphoneWidth" label="Softphone Width">300</item>
  </section>
  <section sortOrder="1" name="reqDialingOptions" label="Dialing Options">
    <item sortOrder="0" name="reqOutsidePrefix" label="Outside Prefix">9</item>
    <item sortOrder="1" name="reqLongDistPrefix" label="Long Distance Prefix">1</item>
    <item sortOrder="2" name="reqInternationalPrefix" label="International Prefix">01</item>
  </section>
</callCenter>

I can be reached at +1 (206) 402-0911 for diagnosing this issue. 
I am pretty new to coding and have pulled the majority of my code from examples that I've seen online via the community. For the most part I've learned lots and have a functioning page that works how I envisioned. However, there is (1) field that is causing me grief. 

I am using VisualStrap: http://blogforce9.blogspot.com/2013/12/visualstrap-visualforce-implementation.html 
&
I am using his Modal idea: http://blogforce9.blogspot.com/2014/06/visualstrap-using-modals-in-visualforce.html

All seems to be working very well except the Due Date field (due_date__c). It will not update the field value in the panel when Save is clicked on the Modal. All other fields update upon Save in the Modal as expected. Due Date will not.

Visualforce Page (truncated)
 
<apex:form >
            <vs:row >
                <vs:column type="col-md-12">
                    <vs:panel title="{!rfqObj.Name}" type="primary" id="RFQRecordDetailPage">
                        <apex:PageBlock mode="maindetail" id="rfqPageBlock">
                            <apex:pageBlockButtons location="top" >
                                <a class="btn btn-info btn-sm" onclick="$('#EditRfqDetails').modal('show');return false;">Edit</a>
                                <a class="btn btn-info btn-sm" onclick="$('#submitRFQ').modal('show');return false;">Submit</a>
                                <vs:tooltip text="Use this if the Quote has NOT gone to the customer">
                                    <apex:commandButton action="{!ext_RFQ_deepClone_Revise_RFQ_and_CQ}" value="Revise RFQ and CQ" styleClass="btn btn-info btn-sm"/>
                                </vs:tooltip>
                                <vs:tooltip text="Use this if the Quote HAS gone to the customer">
                                    <apex:commandButton action="{!deepCloneRFQ}" value="Revise Quote" styleClass="btn btn-info btn-sm"/>
                                </vs:tooltip>
                                </apex:pageBlockButtons>
                            <br/>
                            <apex:pageBlockSection title="Information" collapsible="True" >
                                <apex:outputField value="{!rfqObj.Locked__c}"/>
                                <apex:outputField value="{!rfqObj.Unlock__c}"/>
                                <apex:outputField value="{!rfqObj.Old_Quote_Number__c}"/>
                                <apex:outputField value="{!rfqObj.Quoting_Priority__c}"/>
                                <apex:outputField value="{!rfqObj.Quote_Number__c}"/>
                                <apex:outputField value="{!rfqObj.Requested_By__c}"/>
                                <apex:outputField value="{!rfqObj.End_User__c}"/>
                                <apex:outputField value="{!rfqObj.Ready_to_Submit__c}"/>
                                <apex:outputField value="{!rfqObj.Submitted_Date__c}"/>
                                <apex:outputField value="{!rfqObj.Revision_Notes__c}"/>
                                <apex:outputField value="{!rfqObj.Due_Date__c}"/>
                                <apex:outputField value="{!rfqObj.RFQ_Stage__c}"/>
                            </apex:pageBlockSection>
                        </apex:PageBlock>
                    </vs:panel>
                </vs:column>
            </vs:row>
            
            <vs:modal id="EditRfqDetails" title="RFQ Details">
                <apex:outputPanel layout="block" id="EditRfqDetailsModal">
                    <apex:pageBlock mode="maindetail">
                        <apex:pageBlockSection title="Information" collapsible="True" >
                            <apex:inputField value="{!rfqObj.Locked__c}"/>
                            <apex:inputField value="{!rfqObj.Unlock__c}"/>
                            <apex:inputField value="{!rfqObj.Old_Quote_Number__c}"/>
                            <apex:inputField value="{!rfqObj.Quoting_Priority__c}"/>
                            <apex:inputField value="{!rfqObj.Quote_Number__c}"/>
                            <apex:inputField value="{!rfqObj.Requested_By__c}"/>
                            <apex:inputField value="{!rfqObj.End_User__c}"/>
                            <apex:inputField value="{!rfqObj.Ready_to_Submit__c}"/>
                            <apex:inputField value="{!rfqObj.Submitted_Date__c}"/>
                            <apex:inputField value="{!rfqObj.Revision_Notes__c}"/>
                            <apex:inputField value="{!rfqObj.Due_Date__c}"/>
                            <apex:inputField value="{!rfqObj.RFQ_Stage__c}"/>
                        </apex:pageBlockSection>
                    </apex:pageBlock>
                    <center><apex:outputPanel layout="block" styleClass="modal-footer">
                        <apex:commandButton value="Cancel" styleClass="btn-warning btn-sm" html-data-dismiss="modal"/>
                        <apex:commandButton value="Save" styleClass="btn-success btn-sm" onclick="$(this).button('loading')" html-data-loading-text="Saving..." action="{!save}" reRender="RFQRecordDetailPage,EditRfqDetailsModal"/>
                        </apex:outputPanel></center>
                    <apex:outputPanel rendered="{!isSuccess}">
                        <script>
                        $('#EditRfqDetails').modal('hide');
                        </script>
                    </apex:outputPanel>
                </apex:outputPanel>
            </vs:modal>

Controller (truncated)
 
public class RFQModalDesignCon {

    public Boolean isSuccess{get;set;}
    public Parameters__c parObj{get;set;}
    public RFQ__c rfqObj{get;set;}
    public ControlsQuoting__c cqObj {get;set;}
    public List <RFQ__c> rfqRecords {get;set;}
    public List <ControlsQuoting__c> cqList {get;set;}
    public List <RFQ__c> RFQs {get;set;}
    private ApexPages.StandardController standardController;
    string lockedRFQRecordTypeId;
    string lockedParamRecordTypeId;
    string lockedMaterialConveyedRecordTypeId;
    string lockedControlsQuotingRecordTypeId;

    public RFQModalDesignCon() {
        
        insertPar();
        parObj.Related_RFQ__c = ApexPages.currentPage().getParameters().get('id');
        insertCq();
        cqObj.RFQ__c = ApexPages.currentPage().getParameters().get('id');

        rfqObj =  [SELECT Accepted__c, Accepted_Date__c, Access_Mezzanines__c, Air_Compressor_s_Existing__c, Air_Compressor_s_by_Others__c, Air_Compressor_s_by_Shick__c, Assigned_Date__c, Assigned_To__c, 
                  Assigned_To_Workflow_Field__c, Batching_Software__c, Batching_or_Controls_Notes__c, Closed__c, Closed_Date__c, Commission_Dollar_Amount__c, Commission_Percentage__c, Completed__c, 
                  Completed_Date__c, Controls_Completed__c, Controls_Completed_Date__c, Controls_Completed_Percentage__c, Controls_Step_Weight__c, CreatedById, CreatedDate, 
                  Creation_of_Quote_Document_Completed__c, Current_Revision__c, DaysOnHold__c, Decline_RFQ__c, Declined_RFQ_Date__c, Declined_RFQ_Fixed__c, 
                  Declined_RFQ_Reason__c, IsDeleted, Dense_Phase_Pressure__c, Dense_Phase_Vacuum__c, Dilute_Phase_Pressure__c, Dilute_Phase_Vacuum__c, Due_Date__c, Electrical_Controls__c, End_User__c, 
                  Existing_PLC__c, Existing_Shick_Controls__c, Existing_Start_Panel__c, Final_Flow_Drawing_Completed__c, Final_Flow_Drawing_Completed_Date__c, Final_Flow_Drawing_Completed_Percentage__c, 
                  Final_Flow_Drawing_Completed_Step_Weight__c, Final_Flow_Drawing_Required__c, Foundations_Concrete_Work__c, Freight_Included__c, HMI_Choices__c, HMI_Quantity__c, Heat_Tracing__c, 
                  Installation_Electrical__c, Installation_Mechanical__c, Installation_Required__c, Is_Assigned__c, LastActivityDate, LastModifiedById, LastModifiedDate, Original_Lead__c, Liquids_Completed__c, 
                  Liquids_Completed_Date__c, Liquids_Required_Completed_Percentage__c, Liquids_Step_Weight__c, Locked__c, Logix_PLC__c, Margin_Calculator_Completed__c, Margin_Calculator_Completed_Date__c, 
                  Margin_Calculator_Completed_Percentage__c, Margin_Calculator_Required__c, Margin_Calculator_Step_Weight__c, Mechanical_Dry__c, Mechanical_Liquids__c, Minor_Ingredient_Automation_Required__c, 
                  Minor_Ingredient_Completed_Date__c, Minor_Ingredients_Completed__c, Minors_Ingredient_Step_Completed_Per__c, Minors_Ingredient_Step_Weight__c, Motor_Starter_Enclosure__c, 
                  Motor_Starter_Enclosure_Quantity__c, New_PLC_Required__c, New_Start_Panel_Required__c, Noise_Level_dBa_Max__c, OffHold__c, OffHoldDate__c, Old_Quote_Number__c, 
                  OnHold__c, OnHoldDate__c, OwnerId, PE_Stamped_Drawings_Required__c, PEM_Travel_Dollars__c, PLC_Enclosure__c, ParametersCount__c, Pipe_Insulation__c, Pipe_Sheathing__c, 
                  Plant_Compressed_Air_Available__c, Preliminary_Flow_Drawing_Completed__c, Preliminary_Flow_Drawing_Completed_Perc__c, Preliminary_FlowDrawing_Completed_Date__c, 
                  Preliminary_Flow_Drawing_Required__c, Preliminary_Flow_Drawing_Step_Weight__c, Preliminary_Flow_Sent__c, Preliminary_Flow_Sent_Date__c, Previous_Shick_Project__c, Priority__c, 
                  Quantity_of_AIM_Batching_Units__c, Quote_Document_Completed_Percentage__c, Quote_Document_Required__c, Quote_Document_Step_Weight__c, Quote_Number__c, Quote_Number_for_Opportunity__c, 
                  Quote_Type__c, Quoting_Priority__c, RFQ_Completion_Percentage__c, RFQ_Complted_Salesman__c, Name, RFQ_PoO__c, RFQ_Received_from_Controls_Quoting__c, RFQ_Recv_from_Controls_Quoting_Date__c, 
                  RFQ_Sent_for_Controls_Quoting__c, RFQ_Sent_to_Controls_Quoting_Date__c, RFQ_Stage__c, Ready_to_Submit__c, ReceivedInstallBid__c, Id, RecordTypeId, Related_Opportunity__c, Remote_I_O_Enclosure__c, 
                  Remote_I_O_Enclosure_Quantity__c, Replicate_Past_Project_Specs__c, Report_Quote_Number_to_Opportunity__c, Representative__c, Requested_By__c, Revision_Completed_Date__c, 
                  Revision_Notes__c, Scale_s_Calibration__c, SentforInstallBid__c, Separate_Scale_Enclosure__c, Separate_Scale_Enclosure_Quantity__c, Start_Up_Services_Required__c, 
                  Steps_Required_for_Completion__c, Submitted_Date__c, Support_Structures__c, System_Commissioning__c, System_Eng_Travel_Dollars__c, SystemModstamp, Target_GM_Percentage__c, Unlock__c, 
                  Utilize_Existing_Equipment__c, Weight_of_Steps__c, Percentage__c, ProgressBarCompletion__c 
                  FROM RFQ__c WHERE Id =: ApexPages.CurrentPage().getParameters().get('id')];
    }

    //method to save the Parameter record
    public void saveParameter(){
        try{
            insert parObj;
                insertPar();
              isSuccess = true;
        }
        catch(Exception ex){
            Apexpages.addMessages(ex);
            isSuccess = false;
        }
    }
     
    private void insertPar(){
        parObj = new Parameters__c();
        isSuccess = false;
    }

	//method to save the Controls Quote Record
    public void saveControlsQuote(){
        try{
            insert cqObj;
            	insertCq();
            isSuccess = true;
        }
        catch(Exception ex){
            Apexpages.addMessages(ex);
                issuccess = false;
        }
    }
    private void insertCQ(){
        cqObj = new ControlsQuoting__c();
        isSuccess = false;
    }
    
/////=======================================================================================/////
/////======================================--Buttons--======================================/////
/////=======================================================================================/////
    
    //Unlock Button Method 
    public void Unlock(){
        if(rfqobj.Locked__c != False){
			rfqobj.Locked__c = False;            
        }
        if(rfqObj.Unlock__c != True){
            rfqObj.Unlock__c = True;
        }
        update rfqObj;
    }
    
    public void Save(){
        try{
            update rfqObj;
            isSuccess = true;
            system.debug('SAVE!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!'+rfqObj.Due_Date__c);
        }
        catch(Exception ex){
            Apexpages.addMessages(ex);
                issuccess = false;
        }
    }
    
    public void Submit(){
        try{
            update rfqObj;
            isSuccess = true;
        }
        catch(Exception ex){
            Apexpages.addMessages(ex);
                issuccess = false;
        }
    }
    
    public PageReference RefreshPage(){
        pageReference pr = new pageReference('/apex/RFQModalDesign?id=' + rfqObj.Id);
        pr.setRedirect(true);
        return pr; 
    }
}

I am just stumped. When I update the Due Date in the modal and click save, nothing happens. No changes are written to the record. I manually refresh the page and affirm that no changes have been written. If I select any other field in the Modal it updates the record when I click save on the Modal.

Any suggestions? Please let me know if something doesn't make sense...there is a lot of code that was truncated, I don't think I left anything vital out.

Thanks.

I'm getting a new macbook pro tomorrow which will have os x Snow Leopard.  Was wondering which version of Eclipse I should install in order to run the force.com IDE.  I see that there is a 64-bit version of 4.2.2 available for os x but I'm thinking I remember the force.com IDE supported platforms does not support 64-bit.

 

Which should I install?