• lakshman.matti
  • NEWBIE
  • 55 Points
  • Member since 2013

  • Chatter
    Feed
  • 0
    Best Answers
  • 4
    Likes Received
  • 0
    Likes Given
  • 51
    Questions
  • 62
    Replies
Hi All,

Here is my scenario, I have created a lightning component with pick-list values.
I have pick-list values as Preview of Record,download Record.
When i select Download Record, i want to down the record as pdf automatically.
I searched google for help, i see some posts where they have create quick action button and calling vf page.below is the reference of that method.
https://medium.com/@ToAnshulVerma/lightning-generate-pdf-within-lightning-experience-with-salesforce-data-cd82ae626cc3
But in my case i want to do the same functionality with Pick-list.
I want know that how we can vf page when pick-list value is selected.

Thanks,
Lakshminarayana
 
Hi Everyone,

i got stuck with one requirement. below is the scenario.Please help in resolving the issue.
I have a custom object called xyz with status picklist field. i have created a profile with customer community licence. this profile is currently having Read permission on object. i have created custom Button(Lightning Quick Action which calls flow to update record) on record. when i login as cummunity user, i need to click on that button to change status picklist. Currently i'm getting error while updating status because it has READ permission.
Below is the error message:
This error occurred: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY: entity type cannot be updated: This error occurred: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY: entity type cannot be updated:
is there any work around for this Problem without changing permissions in the Profile level.
I hope the question is clear to understand


Thanks,
Lakshman
HI All,

I'm trying to create a form where it requires to create table. I 'm facing issues while using rowspan and colspan. below is the table format i'm trying to create. 
User-added imagebelow is the code :
<aura:component implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes,force:lightningQuickAction" access="global" >
    
    <table class="slds-table slds-table_cell-buffer slds-table_bordered slds-table_col-bordered">
        <thead>
            <tr class="slds-line-height_reset">
                <th class="" scope="col" rowspan="2" >
                    <div class="slds-truncate " title="Opportunity Name" ><img src="/resource/Shell" height="30" width="30"/>Shell Distributor Capability Assessment Tool Europe v 2.0     
                       
                    </div>
                    
                </th>
                <th class="" scope="col">
                    <div class="slds-truncate" title="Account Name">Account Name</div>
                </th>
                <th class="" scope="col">
                    <div class="slds-truncate" title="Close Date">Close Date</div>
                </th>
                <th class="" scope="col">
                    <div class="slds-truncate" title="Stage">Gap Indication</div>
                </th>
                <th class="" scope="col">
                    <div class="slds-truncate" title="Confidence">Distributor Self Capability Assessment</div>
                </th>
                <th class="" scope="col">
                    <div class="slds-truncate" title="Amount">Gap Indication</div>
                </th>
                <th class="" scope="col" colspan="2">
                    <div class="slds-truncate" title="Contact">Top Priorities to be transferred to the ACTION PLAN page of the Business Plan</div>
                </th>
                <th >
                </th>
            </tr>
        </thead>
        <tbody>
            <tr class="slds-hint-parent">
                <th ></th>
                
                <td data-label="Account Name" colspan="2">
                    <div class="slds-truncate" title="Cloudhub">Scores
                        1: More work is needed:
                        2: Getting there
                        3: Doing fantastic</div>
                </td>
                <td ></td>
                <td data-label="Prospecting" >
                    <div class="slds-truncate" title="Prospecting">Prospecting</div>
                </td>
                <td data-label="Amount">
                    <div class="slds-truncate" title="$25k">$25k</div>
                </td>
                <td data-label="Amount">
                    <div class="slds-truncate" title="$25k">$25k</div>
                </td>
                <td data-label="Contact">
                    <div class="slds-truncate" title="$25k">$25k</div>
                </td>
            </tr>
            <tr class="slds-hint-parent" rowspan="6">
                <th data-label="Opportunity Name" scope="row">
                    <div class="slds-truncate" title="Cloudhub + Anypoint Connectors">
                        <a href="javascript:void(0);" tabindex="-1">Cloudhub + Anypoint Connectors</a>
                    </div>
                </th>
                <td data-label="Account Name">
                    <div class="slds-truncate" title="Cloudhub">Cloudhub</div>
                </td>
                <td data-label="Close Date">
                    <div class="slds-truncate" title="4/14/2015">4/14/2015</div>
                </td>
                <td data-label="Prospecting">
                    <div class="slds-truncate" title="Prospecting">Prospecting</div>
                </td>
                <td data-label="Confidence">
                    <div class="slds-truncate" title="20%">20%</div>
                </td>
                <td data-label="Amount">
                    <div class="slds-truncate" title="$25k">$25k</div>
                </td>
                <td data-label="Amount">
                    <div class="slds-truncate" title="$25k">$25k</div>
                </td>
                
            </tr>
            <tr class="slds-hint-parent">
                <th data-label="Opportunity Name" scope="row">
                    
                </th>
                <td data-label="Account Name">
                    <div class="slds-truncate" title="Cloudhub">Cloudhub</div>
                </td>
                <td data-label="Close Date">
                    <div class="slds-truncate" title="4/14/2015">4/14/2015</div>
                </td>
                <td data-label="Prospecting">
                    <div class="slds-truncate" title="Prospecting">Prospecting</div>
                </td>
                <td data-label="Confidence">
                    <div class="slds-truncate" title="20%">20%</div>
                </td>
                <td data-label="Amount">
                    <div class="slds-truncate" title="$25k">$25k</div>
                </td>
                <td data-label="Amount">
                    <div class="slds-truncate" title="$25k">$25k</div>
                </td>
                
            </tr>
            <tr class="slds-hint-parent">
                <th data-label="Opportunity Name" scope="row">
                    
                </th>
                <td data-label="Account Name">
                    <div class="slds-truncate" title="Cloudhub">Cloudhub</div>
                </td>
                <td data-label="Close Date">
                    <div class="slds-truncate" title="4/14/2015">4/14/2015</div>
                </td>
                <td data-label="Prospecting">
                    <div class="slds-truncate" title="Prospecting">Prospecting</div>
                </td>
                <td data-label="Confidence">
                    <div class="slds-truncate" title="20%">20%</div>
                </td>
                <td data-label="Amount">
                    <div class="slds-truncate" title="$25k">$25k</div>
                </td>
                <td data-label="Amount">
                    <div class="slds-truncate" title="$25k">$25k</div>
                </td>
                
            </tr>
            <tr class="slds-hint-parent">
                <th data-label="Opportunity Name" scope="row">
                    
                </th>
                <td data-label="Account Name">
                    <div class="slds-truncate" title="Cloudhub">Cloudhub</div>
                </td>
                <td data-label="Close Date">
                    <div class="slds-truncate" title="4/14/2015">4/14/2015</div>
                </td>
                <td data-label="Prospecting">
                    <div class="slds-truncate" title="Prospecting">Prospecting</div>
                </td>
                <td data-label="Confidence">
                    <div class="slds-truncate" title="20%">20%</div>
                </td>
                <td data-label="Amount">
                    <div class="slds-truncate" title="$25k">$25k</div>
                </td>
                <td data-label="Amount">
                    <div class="slds-truncate" title="$25k">$25k</div>
                </td>
                
            </tr>
            <tr class="slds-hint-parent">
                <th data-label="Opportunity Name" scope="row">
                    
                </th>
                <td data-label="Account Name">
                    <div class="slds-truncate" title="Cloudhub">Cloudhub</div>
                </td>
                <td data-label="Close Date">
                    <div class="slds-truncate" title="4/14/2015">4/14/2015</div>
                </td>
                <td data-label="Prospecting">
                    <div class="slds-truncate" title="Prospecting">Prospecting</div>
                </td>
                <td data-label="Confidence">
                    <div class="slds-truncate" title="20%">20%</div>
                </td>
                <td data-label="Amount">
                    <div class="slds-truncate" title="$25k">$25k</div>
                </td>
                <td data-label="Amount">
                    <div class="slds-truncate" title="$25k">$25k</div>
                </td>
                
            </tr>
            <tr class="slds-hint-parent">
                <th data-label="Opportunity Name" scope="row">
                    
                </th>
                <td data-label="Account Name">
                    <div class="slds-truncate" title="Cloudhub">Cloudhub</div>
                </td>
                <td data-label="Close Date">
                    <div class="slds-truncate" title="4/14/2015">4/14/2015</div>
                </td>
                <td data-label="Prospecting">
                    <div class="slds-truncate" title="Prospecting">Prospecting</div>
                </td>
                <td data-label="Confidence">
                    <div class="slds-truncate" title="20%">20%</div>
                </td>
                <td data-label="Amount">
                    <div class="slds-truncate" title="$25k">$25k</div>
                </td>
                <td data-label="Amount">
                    <div class="slds-truncate" title="$25k">$25k</div>
                </td>
                
            </tr>
        </tbody>
    </table>
</aura:component>
Please suggest me how to procedd.

Thanks in advance.
Hi Everyone,

i'm trying to convert custom button into vf page.
my scenario is, i  have a custom button where we are invoking flows using javacript.code looks like below.
windows.open (/flow/Enable_SLink_Access &varContactId={!Contact.Id} &retURL=/{!Contact.Id}).
here we are passig some values in the URL.

Now i creating a  custom button where i'm using vf page as content resource.when i click on that button i need to invoke the above flow with same paramaters.. can someone help how to achieve this/ any alternate soluation for this.(if anything can be done flow level that is fine.).very urgent..:)


Thanks
Lakshminarayana
 
Hi All,

Can someone suggest me how to write trigger for the below scenario?
I have one Account, which can have many contacts. 
there are custom fields on contact object 1.Event date(date) 2. Active(Checkbox).
so whenever I'm adding a contact to the account, I need to make it active, here i have one condition if have multiple contacts for the same account i need to check the event date field on contact and if there two contact events with the same year i need to make one contact as active and another as inactive.
Eg: Account A got 2 Contacts, all are active
-cont1 Event date is 01/01/2016
-cont2 event date is 01/01/2017
If a new contact is created (cont3) with event date 01/02/2017 
- cont1  will remain active
- cont2  will be inactivated
- cont3 will become active 
Hope my question is clear.
Thanks in advance.

 
HI All,

I have created a visualforce page which contains many inputfileds to accept values from user. i'm showing some visualforce error messages on top of the page, if user forgets to enter values in inputfields. 
what i want here is whenever user enters some values and clicked on submit button,if it shows any errors it should automatically go back to the the place where error messages are displyed.(i.e we need to set focus on Error messages.)
I hope my question is clear.
Any suggestions or code snippet is appriciated.


Thanks
Lakshman
 
HI All,

I have created a visualforce page which contains many inputfileds to accept values from user. i'm showing some visualforce error messages on top of the page, if user forgets to enter values in inputfields. 
what i want here is whenever user enters some values and clicked on submit button,if it shows any errors it should automatically go back to the the place where error messages are displyed.(i.e we need to set focus on Error messages.)
I hope my question is clear.
Any suggestions or code snippet is appriciated.


Thanks
Lakshman


 
Hi All,

I am getting an error "/apex/Unauthorized" while attaching an image in Rich text box in a Public site. It is working fine in a VF page inside salesforce but not working in a public site. Please help me on this.

Thanks
Lakshman
HI All,

I have a page which contains many fields out which 2 are region and country,these 2 are picklists.
i wanted to populate values into these 2 fields from custom settings. problem is i wanted to country values based region values.
Ex: say i have region like APJ,EMEA.
for APJ i have countries like india,indonesia,australia,
for EMEA i have countries like US,UK,.
when i select REgion as APJ i have to show only india,indonesia,australia in the country field.
for this do i need to create 2 custom settings ?and how to achieve the above functionality in VF Page.

Thanks
Lakshminarayana
 
Hi All,
I have created a page which contains a picklist. 
which looks like below.
User-added image
i wanted to change the down arrow color into different color and border also in different color.

Thanks
Lakshman


 
Hi Everyone,

i have scenario . can you suggest me how to write trigger.
scenario is i have a standard object case. i have created a custom field which is of type checkbox.
i have created a record. on the record detail page we can post some comments using @mention xyz user.

when some one is posted comments using @mention username(owner of the record), i want to make that checkbox true.
what is relationship between case and casefeed.
can some one tel me how to write trigger for this.

Thanks
Lakshman
Hi Everyone,

I have create a vf page and custom controller .page contains 2 input to take user inputs.when user gives values and saves the record using custom button.once it is saved i need to send that page vf page as attachment in pdf format to the mail what we have speciefied in vf page.
here i'm pasting my code.please corrrect my code.
VF PAGE:
---------------------

<apex:page controller="sendingMailAttachment"> <apex:form > <apex:messages /> <apex:outputLabel >Name</apex:outputLabel>&nbsp; &nbsp; &nbsp; <apex:inputText value="{!name}"/><br/> <apex:outputLabel >Mail</apex:outputLabel>&nbsp; &nbsp; &nbsp;&nbsp; &nbsp; <apex:inputText value="{!cmail}"/><br/> <apex:commandButton action="{!Submit}" value="Submit"/> </apex:form> </apex:page>
controller:
-----------
public class sendingMailAttachment {

    public String cmail { get; set; }

    public String name { get; set; }
   
    public sendingMailAttachment (){}
    public pagereference Submit(){
    
    contact Conval=new contact();
    conval.lastname=name ;
    conval.Email=cmail ;
    insert conval;
    
        ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.info, 'contact inserted');
        ApexPages.addMessage(myMsg); 
        
        
        
        // Reference the attachment page and pass in the  ID
        PageReference pdf =  Page.emailAttachmentEx1;
       pdf.getParameters().put('id',conval);
        // Take the PDF content
        Blob b = pdf.getContentAsPDF();
        // Create the email attachment
        Messaging.EmailFileAttachment efa = new Messaging.EmailFileAttachment();
        efa.setContentType('application/pdf');
        efa.setFileName('attachment.pdf');
        efa.setInline(false);
        efa.setBody(b);
        
        Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
        String[] toAddresses = new String[] {conval.Email};
        mail.setToAddresses(toAddresses);
        mail.setSubject('New contact is created'); 
        
        mail.plainTextBody = 'Name : '+conval.lastname+'\n'+'Mail Id : '+conval.email;
        
        mail.setFileAttachments(new Messaging.EmailFileAttachment[] {efa});
        Messaging.SendEmail(new Messaging.SingleEmailMessage[] {mail});
        return null;
    }
    
}
---
above code is sending attachment with just labels. i want the inputs user give along with labels.

Thanks
Lakshman
 
Hi Everyone,

I have a problem with custom button on standard page.
i have created custom button in an object.which is used to create new record.it's working as expected.but i facing new problem which if i click multiple times on that button it's creating multiple records.i want to avoid clicking multple times of that button.i want to fadeout that button once i clikc on that button.(note: its a custom button on standard page)
i hope im clear with question.

Thanks
Lakshman
Hi Everyone,

While writting test class webservice callouts, i'm getting the following Exception.
you have uncommitted work pending. Please commit or rollback before calling out.

my test class:
----------------------
@isTest
public class GSD_partordercontroller_TESTROH {
    
    private static void createCustomSetting(){
            HPTriggerFrameworkObjectMapping__c CSPOobj=new HPTriggerFrameworkObjectMapping__c(Name='GSD_Part_Order__c ', DispatcherCalssName__c='GSDPartOrder');
            insert CSPOobj;
            HPTriggerFrameworkObjectMapping__c CSPOLobj=new HPTriggerFrameworkObjectMapping__c(Name='GSD_Part_Order_Line__c', DispatcherCalssName__c='GSDPartOrderLine');
            insert CSPOLobj;
            HPTriggerFrameworkObjectMapping__c trigFramework = new HPTriggerFrameworkObjectMapping__c(name = 'CKSW__Task__c',DispatcherCalssName__c = 'GSDTask');
            insert trigFramework;
            HPTriggerFrameworkObjectMapping__c resourceCS = new HPTriggerFrameworkObjectMapping__c(name = 'CKSW__Engineer_Equipment__c',DispatcherCalssName__c = 'GSDResource');
            insert resourceCS;
            HPTriggerFrameworkObjectMapping__c GsdCaseQuote=new HPTriggerFrameworkObjectMapping__c(name='GSD_Case_Quote__c',DispatcherCalssName__c='GSDCaseQuote');
            insert GsdCaseQuote;
             HPTriggerFrameworkObjectMapping__c partPickLoCObj=new HPTriggerFrameworkObjectMapping__c(name='GSD_Part_Pickup_Location__c',DispatcherCalssName__c='GSDPartPickupLocation');
            insert partPickLoCObj;

        } 
Private testmethod static void MethodFROH(){
        createCustomSetting();
   // Test.setMock(WebServiceMock.class, new GSDTrunkPartOrderWebMockIml());
    test.startTest();
    CKSW__Engineer_Equipment__c resourecObj =  new CKSW__Engineer_Equipment__c( Name='Test resource',Standby_Dispatch_Policy__c='Bulk',
                                                                                    Mobile__c='9663066004', CKSW__User__c=userinfo.getUserId());
        insert resourecObj;
        
        GSD_Business_Center__c buscenter= new GSD_Business_Center__c(Name='Test Business' ,Business_Center_Key__c=123456,Active__c=true);
        insert buscenter;
        
        Account newAccount= new Account(Name='Test Account');
        insert newAccount;
        contact newContact =new contact(FirstName='Joe',LastName='Smith',Phone='415.555.1212',AccountId=newAccount.Id);
        Asset AsetObj=new Asset();
        AsetObj.name='as1';
        AsetObj.HP_Product_Number__c='H4U87ES';
        AsetObj.HP_Asset_Type__c='PPS GSB Asset';
        AsetObj.Manufacturer__c='HP DesignJet (PL30)';
        AsetObj.Status='Active';
        AsetObj.HP_Product_Model__c='30 - DesignJet HW';
        AsetObj.AccountId=newAccount.Id;
        insert AsetObj;
        BusinessHours newBusHours= new BusinessHours(Name='Default');
        Case newCase= new Case(status='open', BusinessHours=newBusHours,source_system_case_id__c='98000057131', 
                               Severity__c='3-NORMAL', Description='Test Description', OwnerId=userinfo.getUserId(),Reason='ABP Support',NBD_SBD__c='NBD');
        newCase.Requestor_s_TimeZone__c='(GMT+00:00) British Standard Time (Europe/London)';
        newCase.AssetId=AsetObj.Id;
        newcase.Last_Service_Delivery_Time__c=system.now()+1;
        newCase.Entitlement_SLA_Response__c='RESPONSE_TIME';
        newCase.Latest_Service_DateTime__c=system.now();
        newCase.Mission_Critical__c=true;
        newCase.OrderTypeCode__c='00E-No Entitlement';
        insert newCase;
        GSD_Part_Order__c POObj=new GSD_Part_Order__c(name='Po',Legacy_Part_Order_number__c='1234567891-123-1');
        POObj.ISO2_Character_Country_Code__c='AX'; 
        POObj.Country__c='AF';
        POObj.Order_Reason_Code__c='615-Customer Self Repair (CSR)';
        POObj.Shipping_Condition_Code__c='SBD';
        POObj.Shipping_Carrier_Code__c='S3-DHL';
        POObj.Case_Number__c=newcase.id;
        POObj.Part_Delivery_Requested_TimeStamp__c=system.now();
        POObj.Part_Order_Type_Code__c='ZSSB Exchange Order';
        POObj.Delivery_Priority_Code__c='40-Manual Escalations';
        POObj.Special_Delivery_Process_Code__c='21-Next Flight Out';
        insert POObj;
        GSD_Part_Order_Line__c partorderline=new GSD_Part_Order_Line__c(name='pol',Part_Order_Header_Number__c=POObj.Id);
         partorderline.Logistics_Estimated_Arrival_TimeStamp__c=system.now()+1;
         partorderline.Part_Response_Status_Code__c='BACKORDER';
         partorderline.Offered_Part_Identifier__c='abcOfr';
         partorderline.Part_Identifier__c='Test';
         partorderline.Part_Line_Status__c='Cancelled';
         partorderline.Part_Description__c='Description';
        insert partorderline;
        World_Region__c WR=new World_Region__c();
        wr.Name='AX';
        insert WR;
        World_Region_Configuration__c WRCObj=new World_Region_Configuration__c();
        WRCObj.Text_Value__c='test';
        WRCObj.World_Region__c=WR.Id;
        WRCObj.Name='GSD_iGSO_Sales_Organization';
        insert WRCObj;
        GSD_ODM_Reference__c ODMObj=new GSD_ODM_Reference__c();
        ODMObj.name='odm123';
        insert ODMObj;
        list<gsd_offer__C> LIObj=new list<gsd_offer__C>();
        gsd_offer__C OFFObj=new gsd_offer__C();
        OFFObj.name='off1';
        OFFObj.Case__c=newCase.Id;
        OFFObj.Offer_Reference__c=ODMObj.Id;
        OFFObj.Start_Date__c=system.today();
        OFFObj.End_Date__c=system.today()+1; 
        OFFObj.Entitlement_Type_Code__c='W';
        insert OFFObj;
        LIObj.add(OFFObj);
        GSD_Integration_Data__c trunkpartorder=new GSD_Integration_Data__c();
        trunkpartorder.End_point_URL__c='https://it-services-gw-csc-stg.itcs.hp.com/gw/hpit/egit/createtrunkpartorder.itg';
        trunkpartorder.Name='Trunkpartorder';
        trunkpartorder.Time_out__c=120000;
        trunkpartorder.Client_Certificate__c='';
        insert trunkpartorder; 
        
        Apexpages.StandardController sc = new Apexpages.standardController(POObj);
        GSD_PartOrderController POCObj=new GSD_PartOrderController(sc);
        POCObj.closeValidateAddressPopUp();
        POCObj.caseobj=newcase;
        POCObj.orderobj=POObj;
        POCObj.orderid='';
        POCObj.partorderid=POObj.id;
        //MonitorUtility objmonitorutility=new MonitorUtility();
        POCObj.Transactionid='TrunkPartOrder';
        GSDCustomerTimeZoneUtility LTZObj=new GSDCustomerTimeZoneUtility();
        string tZ='(GMT+09:00) Japan Standard Time (Asia/Tokyo)';
        GSDCustomerTimeZoneUtility.LongNameToTimeZone(tZ);
        
     
   // GsdTrunkpartorderCreateResponse.CreateTrunkPartOrderEndpoint3 resObj=new GsdTrunkpartorderCreateResponse.CreateTrunkPartOrderEndpoint3();
    test.stopTest();
    Test.setMock(WebServiceMock.class, new GSDTrunkPartOrderWebMockIml());  
    
    POCObj.TrunkPartorder();
    
    }
       private testmethod static void methodFEntitleElseblcok(){
        
        createCustomSetting();
        CKSW__Engineer_Equipment__c resourecObj =  new CKSW__Engineer_Equipment__c( Name='Test resource',Standby_Dispatch_Policy__c='Bulk',
                                                                                    Mobile__c='9663066004', CKSW__User__c=userinfo.getUserId());
        insert resourecObj;
        
        GSD_Business_Center__c buscenter= new GSD_Business_Center__c(Name='Test Business' ,Business_Center_Key__c=123456,Active__c=true);
        insert buscenter;
        
        Account newAccount= new Account(Name='Test Account');
        insert newAccount;
        contact newContact =new contact(FirstName='Joe',LastName='Smith',Phone='415.555.1212',AccountId=newAccount.Id);
        Asset AsetObj=new Asset();
        AsetObj.name='as1';
        AsetObj.HP_Product_Number__c='H4U87ES';
        AsetObj.HP_Asset_Type__c='PPS GSB Asset';
        AsetObj.Manufacturer__c='HP DesignJet (PL30)';
        AsetObj.Status='Active';
        AsetObj.HP_Product_Model__c='30 - DesignJet HW';
        AsetObj.AccountId=newAccount.Id;
        insert AsetObj;
        BusinessHours newBusHours= new BusinessHours(Name='Default');
        Case newCase= new Case(status='open', BusinessHours=newBusHours,source_system_case_id__c='98000057131', 
                               Severity__c='3-NORMAL', Description='Test Description', OwnerId=userinfo.getUserId(),Reason='ABP Support',NBD_SBD__c='SBD');
        newCase.Mission_Critical__c=true;
        newCase.AssetId=AsetObj.Id;
        newcase.Last_Service_Delivery_Time__c=system.now()+1;
        insert newCase;
       // ApexPages.currentPage().getParameters().put('caseid', newCase.Id);
        GSD_Case_Quote__c quote = new GSD_Case_Quote__c(name = 'Test Quote', Case__c = newCase.id);
        insert quote;
        
        CKSW__TaskType__c taskType= new CKSW__TaskType__c(Name='Repair', CKSW__Duration__c=20);
        insert taskType;
        CKSW__WorkOrder__c workOrder= new CKSW__WorkOrder__c(CKSW__Account__c=newAccount.Id,
                                      CKSW__StartDate__c=Date.Today(), CKSW__EndDate__c=Date.Today());
        insert workOrder;
        CKSW__Task__c taskRec = new CKSW__Task__c(CKSW__WorkOrder__c=workOrder.Id, CKSW__TaskType__c=taskType.Id,Business_Center__c=buscenter.Id,
                                                  External_Task_Identifier__c='98000057131-971', CKSW__Assigned_Resource__c=resourecObj.Id,Product_Number__c='123',Serial_Number__c='S123',Case_Quote__c=quote.id);
        taskRec.Entitled_Service_Window_Start_DateTime__c=system.now();
        taskRec.Requested_Service_Window_Start_DateTime__c=system.now();
        taskRec.Entitled_Service_Window_End_DateTime__c=system.now();
        taskRec.Requested_Service_Window_End_DateTime__c=system.now();
        taskRec.CKSW__Country__c='India';
        taskRec.CKSW__Street__c='biji';
        taskREc.CKSW__City__c='Bangalore';
        taskRec.CKSW__State__c='Karnataka';
        taskREc.CKSW__Zip_Postal_Code__c='560100';
        insert taskRec ;
       
        GSD_ODM_Reference__c ODMObj=new GSD_ODM_Reference__c();
        ODMObj.name='odm123';
        insert ODMObj;
        
        ApexPages.currentPage().getParameters().put('caseid', newCase.Id);
        GSD_Part_Order__c POObj=new GSD_Part_Order__c(Case_Number__c=newCase.id,Service_Delivery_Type__c='Onsite');
        POObj.Legacy_Part_Order_number__c='1234567890-123-1';
        POObj.Pending_Transaction_Type__c='Trans';
        POObj.ISO2_Character_Country_Code__c='AX';
        POObj.Shipping_Carrier_Code__c='S1-Postal Service';
        POObj.Shipping_Condition_Code__c='None';
        POObj.Service_Delivery_Type__c='CSR';
        POObj.Delivery_Priority_Code__c='None';
        POObj.Street2__c='street2';
        POObj.Company_Name__c='company1';
        POObj.Responsible_Party_Id__c='RPID';
        POObj.Order_Status_Code__c='Recommended';
        insert POObj;
        World_Region__c WR=new World_Region__c();
        wr.Name='AX';
       // Wr.ParentId__c=POObj.ISO2_Character_Country_Code__c;
       
        insert WR;
        list<World_Region_Configuration__c> lstwrc=new list<World_Region_Configuration__c>();
        World_Region_Configuration__c wrObj=new World_Region_Configuration__c();
           
        wrObj.World_Region__c=wr.Id;
        wrObj.Name='GSD_iGSO_Sales_Organization';
        insert wrObj;
        lstwrc.add(wrobj);
        
        GSD_Part_Order_Line__c partorderline=new GSD_Part_Order_Line__c(name='pol',Part_Order_Header_Number__c=POObj.Id);
        partorderline.Part_Line_Status__c='On Hold';
        partorderline.Part_Identifier__c='PI';
        insert partorderline;
        List<GSD_Part_Order_Line__c> WLPOLObj=new List<GSD_Part_Order_Line__c>();
        WLPOLObj.add(partorderline); 
        
        list<gsd_offer__C> LIObj=new list<gsd_offer__C>();
        gsd_offer__C OFFObj=new gsd_offer__C();
        OFFObj.name='off1';
        OFFObj.Case__c=newCase.Id;
        OFFObj.Offer_Reference__c=ODMObj.Id;
        OFFObj.Start_Date__c=system.today();
        OFFObj.End_Date__c=system.today()+1;        
        insert OFFObj;
        LIObj.add(OFFObj);
        
        Apexpages.StandardController sc = new Apexpages.standardController(POObj);
        GSD_PartOrderController POCObj=new GSD_PartOrderController(sc);
        GSD_PartOrderController.postback=true;
        POCObj.CaseId=newCase.id;
        POCObj.TaskId=taskRec.Id;
        POCObj.partorderid=POObj.id;
        POCObj.taskObj=taskRec;
        
        boolean isChecked=true;
        boolean isSLAmet=true;
        List<SelectOption> options = new List<SelectOption>();
        options.add(new SelectOption('US','US'));
        String PromisedTimeCOnvertedtoCTZ='re';
        GSD_PartOrderController.partOrderLineWrapper POLObj=new GSD_PartOrderController.partOrderLineWrapper(isChecked,isSLAmet,partorderline,options,PromisedTimeCOnvertedtoCTZ);
        list<GSD_PartOrderController.partOrderLineWrapper> WPOLObj=new list<GSD_PartOrderController.partOrderLineWrapper>();
        WPOLObj.add(POLObj);
        POCObj.wl= WPOLObj;
        POCObj.onPageLoad();
        POCObj.closeValidateAddressPopUp();
        POCObj.FillEntitlementsection();
        

        GsdAtpStream ATPObj=new GsdAtpStream();
        GsdAtpStream.GetATPType GetAtp=new GsdAtpStream.GetATPType();
        GsdAtpStream.AddressBlock_element Address=new GsdAtpStream.AddressBlock_element ();
        GsdAtpStream.InPartList_element InPart=new GsdAtpStream.InPartList_element();
        GsdAtpStream.GetATPResponseType Res=new GsdAtpStream.GetATPResponseType();
        GsdAtpStream.PartList_element PartElement=new GsdAtpStream.PartList_element();
        GsdAtpStream.PortTypeEndpoint1  port=new GsdAtpStream.PortTypeEndpoint1();
        GsdAtpStream.FaultMessageType Msg=new GsdAtpStream.FaultMessageType();
         GSD_Integration_Data__c GSDI=new  GSD_Integration_Data__c(name='ATP',End_point_URL__c='https://it-services-gw-csc-stg.itcs.hp.com/gw/hpit/egit/getatp.itg',Time_out__c=120000,Client_Certificate__c='');
         insert GSDI;
           
        GSDIntegrationUtilityClass objIntegrationData = new GSDIntegrationUtilityClass();
           string strServicename='ATP';
           objIntegrationData.GetEndpointData(strServicename);
       test.startTest();
       Test.setMock(WebServiceMock.class, new GsdAtpStreamWebMockIml()); 
        POCObj.checkAvail();
        POCObj.partlineid=partorderline.id;
        POCObj.checkAvailSupressEqualent();
       test.stopTest();
    }
   
    
}
can some one tel me how to resolve this issue.
Regards
Lakshman
Hi Everyone,

I want to write to test class for webservice callouts.below is the WSDL2Apex class.
how to generate mock response for this.
public class GsdTrunkpartorderCreateResponse {
    public class CreateTrunkPartOrderEndpoint3 {
        public String endpoint_x = 'https://localhost:4437/CreateTrunkPartOrder';
        public Map<String,String> inputHttpHeaders_x;
        public Map<String,String> outputHttpHeaders_x;
        public String clientCertName_x;
        public String clientCert_x;
        public String clientCertPasswd_x;
        public Integer timeout_x;
        private String[] ns_map_type_info = new String[]{'http://www.hp.com/GSD/SFDC/Outbound/WES_Cloud/CreateTrunkPartOrder/Artifacts/Schema/CreateTrunkPartOrder.xsd', 'GsdTrunkpartorderCreateRequest', 'http://www.hp.com/GSD/SFDC/Outbound/WES_Cloud/CreateTrunkPartOrder/Services/CreateTrunkPartOrder-service.serviceagent', 'GsdTrunkpartorderCreateResponse'};
        public GsdTrunkpartorderCreateRequest.CreateTrunkPartOrderResponse_element CreateTrunkPartOrder(GsdTrunkpartorderCreateRequest.YORDER_CREATE_IMP1 ORDER_CREATE_IMP,GsdTrunkpartorderCreateRequest.Monitoring_element Monitoring,String Region) {
            GsdTrunkpartorderCreateRequest.CreateTrunkPartOrder_element request_x = new GsdTrunkpartorderCreateRequest.CreateTrunkPartOrder_element();
            request_x.ORDER_CREATE_IMP = ORDER_CREATE_IMP;
            request_x.Monitoring = Monitoring;
            request_x.Region = Region;
            GsdTrunkpartorderCreateRequest.CreateTrunkPartOrderResponse_element response_x;
            Map<String, GsdTrunkpartorderCreateRequest.CreateTrunkPartOrderResponse_element> response_map_x = new Map<String, GsdTrunkpartorderCreateRequest.CreateTrunkPartOrderResponse_element>();
            response_map_x.put('response_x', response_x);
            WebServiceCallout.invoke(
              this,
              request_x,
              response_map_x,
              new String[]{endpoint_x,
              '/SFDC/Outbound/WES_Cloud/CreateTrunkPartOrder/Artifacts/WSDL/CreateTrunkPartOrder_Abstract-service3.serviceagent/CreateTrunkPartOrderEndpoint3/CreateTrunkPartOrder',
              'http://www.hp.com/GSD/SFDC/Outbound/WES_Cloud/CreateTrunkPartOrder/Artifacts/Schema/CreateTrunkPartOrder.xsd',
              'CreateTrunkPartOrder',
              'http://www.hp.com/GSD/SFDC/Outbound/WES_Cloud/CreateTrunkPartOrder/Artifacts/Schema/CreateTrunkPartOrder.xsd',
              'CreateTrunkPartOrderResponse',
              'GsdTrunkpartorderCreateRequest.CreateTrunkPartOrderResponse_element'}
            );
            response_x = response_map_x.get('response_x');
            return response_x;
        }
    }
}.
-----------------------
public class GsdTrunkpartorderCreateRequest {
public class CreateTrunkPartOrderResponse_element {
        public String StatusCode;
        public String StatusMsg;
        private String[] StatusCode_type_info = new String[]{'StatusCode','http://www.hp.com/GSD/SFDC/Outbound/WES_Cloud/CreateTrunkPartOrder/Artifacts/Schema/CreateTrunkPartOrder.xsd',null,'0','1','false'};
        private String[] StatusMsg_type_info = new String[]{'StatusMsg','http://www.hp.com/GSD/SFDC/Outbound/WES_Cloud/CreateTrunkPartOrder/Artifacts/Schema/CreateTrunkPartOrder.xsd',null,'0','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://www.hp.com/GSD/SFDC/Outbound/WES_Cloud/CreateTrunkPartOrder/Artifacts/Schema/CreateTrunkPartOrder.xsd','true','false'};
        private String[] field_order_type_info = new String[]{'StatusCode','StatusMsg'};
    }
}
Hi  everyone,

I'm having an issue of writing test class for asynchronous callouts which i have used in controller.
can some one help me to write test class to code coverage to max.
i followed the way in the below link and i'm getting the following Error.
System.NoSuchElementException: Iterator has no more elements
link for test class provided by salesforce.
https://www.salesforce.com/us/developer/docs/apexcode/Content/apex_continuation_callout_soap.htm
Thanks in advance.
Lakshman
 
Hi Everyone,

I have a button initially, it is disable(i.e not able to click.).
i want to enable it when if any one of the check box is checked.
here is my check box code.and button code
<apex:column headerValue="Select" style="text-align: center"> 
                        <apex:inputCheckbox id="isCheckBox" style="opacity:{!w2.isPartOrderabilityStatusCode};" value="{!w2.isCheckBox}" >
                            <apex:actionSupport event="onclick" action="{!checkBoxStaus}" reRender="pb2"/>
                        </apex:inputCheckBox>
 </apex:column>
<apex:commandButton value="Add Selected"  action="{!selectRecords}" id="sparebtn" reRender="frm">
                    <apex:actionSupport event="onclick" rerender="resultsBlock" status="statusSaveTrip"/>
</apex:commandButton>

Thanks
Lakshminarayana
 
I have a pageblock table. for every record i'm showing a check box.i want a validation that if no check box is checked i want show alert.
if user selected a check box i'm showing circle/process image for to show end user that some processing is happing. when user is not selected any checked and clicked on submit button i want to show validation using js or jquery(after this i dont want them to show circle/process image ).

my code is like below for button.
<apex:commandButton value="Add Selected"  action="{!selectRecords}" id="sparebtn" reRender=">
                    <apex:actionSupport event="onclick" rerender="resultsBlock" status="statusSaveTrip"/>
 </apex:commandButton>
public void  selectRecords(){
    
    system.debug('@@@@@@@@@'+spareBomList.size()); 
     
     try
     {  
         //selectedPartList.clear(); 
         
         if(spareBomList.size()>0)
         {
             system.debug('@#@#@#'); 
             for(Wrapper w: spareBomList)
             {
                 system.debug('selected value'+w.isCheckBox);
                 if(w.isCheckBox)
                 { 
                     for(integer q=1;q<=w.qty;q++)
                     {
                         selectedPartList.add(w);
                         
                     }
                 }
                 
             }
         }
 
Hi Everyone,

i have a vf page which contains a button, with a record.
i want to enable button based on record owner.contion here i want to enable it only if record owner is other than created user of record.
EX: lets say User A is create record.if user is opened that opened the page contains this record.this time button needs to disabled.
If user B opened this page contains user A created record.this time it needs to be enabled.

can some one help tel me the condtion please.

Regards
Lakshman
 
Hi Everyone,

I have a page, which is taking time to load the entire content in the page.
So,I want to show process/load image on page load.

Can some one help me please.

Thanks in advance
Regards
Lakshman
 
i have 2 objects namely objA,objB.
i have created lookup relationship on objB to objA. objA have some values like abc,xyz(two record names).

here i want to write a validation rule on objA.

While creating objB records when i select abc record from objA i want to make one field mandatory in objB.when i select another record that is xyz record i dont want to validate that field.


i hope im clear with my question.

Regards
Lakshman
HI,
i have created a custom field in account object called Prevoius Fiscal Year Revenue.
This field needs to be created and should allow for population via batch apex that can be run when the year ends.  Button to start batch should be available on the account Detail page.

Can some body give suggestion on how to create a button to achieve functinality.

Thanks in advance
Hi,
I have been suffering with lack of logic from last couple of days.
i want to write a trigger on account object custom field which will calculate revenue for current fiscal yearYTD based on oppotunity amount.
once the current fiscal yearYTD gets changed again calculations start from next fiscal yearYTD.(that mean whatever value stored for last current fiscal yearYTD need to be override with urrent fiscal yearYTD)
Can somebody help me in figure out the best approach to get current fiscalYTD.
I hope i'm clear with my question.

Thanks in Advance

Thanks&Regards
Lakshman
I created a field called  Revenue on account object.i want to calculate Fiscal Year to Date (YTD) revenue based on amount field from opportunity object on account object.
Can some body tel me the approach.
Hi All,

Here is my scenario, I have created a lightning component with pick-list values.
I have pick-list values as Preview of Record,download Record.
When i select Download Record, i want to down the record as pdf automatically.
I searched google for help, i see some posts where they have create quick action button and calling vf page.below is the reference of that method.
https://medium.com/@ToAnshulVerma/lightning-generate-pdf-within-lightning-experience-with-salesforce-data-cd82ae626cc3
But in my case i want to do the same functionality with Pick-list.
I want know that how we can vf page when pick-list value is selected.

Thanks,
Lakshminarayana
 
HI All,

I'm trying to create a form where it requires to create table. I 'm facing issues while using rowspan and colspan. below is the table format i'm trying to create. 
User-added imagebelow is the code :
<aura:component implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes,force:lightningQuickAction" access="global" >
    
    <table class="slds-table slds-table_cell-buffer slds-table_bordered slds-table_col-bordered">
        <thead>
            <tr class="slds-line-height_reset">
                <th class="" scope="col" rowspan="2" >
                    <div class="slds-truncate " title="Opportunity Name" ><img src="/resource/Shell" height="30" width="30"/>Shell Distributor Capability Assessment Tool Europe v 2.0     
                       
                    </div>
                    
                </th>
                <th class="" scope="col">
                    <div class="slds-truncate" title="Account Name">Account Name</div>
                </th>
                <th class="" scope="col">
                    <div class="slds-truncate" title="Close Date">Close Date</div>
                </th>
                <th class="" scope="col">
                    <div class="slds-truncate" title="Stage">Gap Indication</div>
                </th>
                <th class="" scope="col">
                    <div class="slds-truncate" title="Confidence">Distributor Self Capability Assessment</div>
                </th>
                <th class="" scope="col">
                    <div class="slds-truncate" title="Amount">Gap Indication</div>
                </th>
                <th class="" scope="col" colspan="2">
                    <div class="slds-truncate" title="Contact">Top Priorities to be transferred to the ACTION PLAN page of the Business Plan</div>
                </th>
                <th >
                </th>
            </tr>
        </thead>
        <tbody>
            <tr class="slds-hint-parent">
                <th ></th>
                
                <td data-label="Account Name" colspan="2">
                    <div class="slds-truncate" title="Cloudhub">Scores
                        1: More work is needed:
                        2: Getting there
                        3: Doing fantastic</div>
                </td>
                <td ></td>
                <td data-label="Prospecting" >
                    <div class="slds-truncate" title="Prospecting">Prospecting</div>
                </td>
                <td data-label="Amount">
                    <div class="slds-truncate" title="$25k">$25k</div>
                </td>
                <td data-label="Amount">
                    <div class="slds-truncate" title="$25k">$25k</div>
                </td>
                <td data-label="Contact">
                    <div class="slds-truncate" title="$25k">$25k</div>
                </td>
            </tr>
            <tr class="slds-hint-parent" rowspan="6">
                <th data-label="Opportunity Name" scope="row">
                    <div class="slds-truncate" title="Cloudhub + Anypoint Connectors">
                        <a href="javascript:void(0);" tabindex="-1">Cloudhub + Anypoint Connectors</a>
                    </div>
                </th>
                <td data-label="Account Name">
                    <div class="slds-truncate" title="Cloudhub">Cloudhub</div>
                </td>
                <td data-label="Close Date">
                    <div class="slds-truncate" title="4/14/2015">4/14/2015</div>
                </td>
                <td data-label="Prospecting">
                    <div class="slds-truncate" title="Prospecting">Prospecting</div>
                </td>
                <td data-label="Confidence">
                    <div class="slds-truncate" title="20%">20%</div>
                </td>
                <td data-label="Amount">
                    <div class="slds-truncate" title="$25k">$25k</div>
                </td>
                <td data-label="Amount">
                    <div class="slds-truncate" title="$25k">$25k</div>
                </td>
                
            </tr>
            <tr class="slds-hint-parent">
                <th data-label="Opportunity Name" scope="row">
                    
                </th>
                <td data-label="Account Name">
                    <div class="slds-truncate" title="Cloudhub">Cloudhub</div>
                </td>
                <td data-label="Close Date">
                    <div class="slds-truncate" title="4/14/2015">4/14/2015</div>
                </td>
                <td data-label="Prospecting">
                    <div class="slds-truncate" title="Prospecting">Prospecting</div>
                </td>
                <td data-label="Confidence">
                    <div class="slds-truncate" title="20%">20%</div>
                </td>
                <td data-label="Amount">
                    <div class="slds-truncate" title="$25k">$25k</div>
                </td>
                <td data-label="Amount">
                    <div class="slds-truncate" title="$25k">$25k</div>
                </td>
                
            </tr>
            <tr class="slds-hint-parent">
                <th data-label="Opportunity Name" scope="row">
                    
                </th>
                <td data-label="Account Name">
                    <div class="slds-truncate" title="Cloudhub">Cloudhub</div>
                </td>
                <td data-label="Close Date">
                    <div class="slds-truncate" title="4/14/2015">4/14/2015</div>
                </td>
                <td data-label="Prospecting">
                    <div class="slds-truncate" title="Prospecting">Prospecting</div>
                </td>
                <td data-label="Confidence">
                    <div class="slds-truncate" title="20%">20%</div>
                </td>
                <td data-label="Amount">
                    <div class="slds-truncate" title="$25k">$25k</div>
                </td>
                <td data-label="Amount">
                    <div class="slds-truncate" title="$25k">$25k</div>
                </td>
                
            </tr>
            <tr class="slds-hint-parent">
                <th data-label="Opportunity Name" scope="row">
                    
                </th>
                <td data-label="Account Name">
                    <div class="slds-truncate" title="Cloudhub">Cloudhub</div>
                </td>
                <td data-label="Close Date">
                    <div class="slds-truncate" title="4/14/2015">4/14/2015</div>
                </td>
                <td data-label="Prospecting">
                    <div class="slds-truncate" title="Prospecting">Prospecting</div>
                </td>
                <td data-label="Confidence">
                    <div class="slds-truncate" title="20%">20%</div>
                </td>
                <td data-label="Amount">
                    <div class="slds-truncate" title="$25k">$25k</div>
                </td>
                <td data-label="Amount">
                    <div class="slds-truncate" title="$25k">$25k</div>
                </td>
                
            </tr>
            <tr class="slds-hint-parent">
                <th data-label="Opportunity Name" scope="row">
                    
                </th>
                <td data-label="Account Name">
                    <div class="slds-truncate" title="Cloudhub">Cloudhub</div>
                </td>
                <td data-label="Close Date">
                    <div class="slds-truncate" title="4/14/2015">4/14/2015</div>
                </td>
                <td data-label="Prospecting">
                    <div class="slds-truncate" title="Prospecting">Prospecting</div>
                </td>
                <td data-label="Confidence">
                    <div class="slds-truncate" title="20%">20%</div>
                </td>
                <td data-label="Amount">
                    <div class="slds-truncate" title="$25k">$25k</div>
                </td>
                <td data-label="Amount">
                    <div class="slds-truncate" title="$25k">$25k</div>
                </td>
                
            </tr>
            <tr class="slds-hint-parent">
                <th data-label="Opportunity Name" scope="row">
                    
                </th>
                <td data-label="Account Name">
                    <div class="slds-truncate" title="Cloudhub">Cloudhub</div>
                </td>
                <td data-label="Close Date">
                    <div class="slds-truncate" title="4/14/2015">4/14/2015</div>
                </td>
                <td data-label="Prospecting">
                    <div class="slds-truncate" title="Prospecting">Prospecting</div>
                </td>
                <td data-label="Confidence">
                    <div class="slds-truncate" title="20%">20%</div>
                </td>
                <td data-label="Amount">
                    <div class="slds-truncate" title="$25k">$25k</div>
                </td>
                <td data-label="Amount">
                    <div class="slds-truncate" title="$25k">$25k</div>
                </td>
                
            </tr>
        </tbody>
    </table>
</aura:component>
Please suggest me how to procedd.

Thanks in advance.
Hi Everyone,

i'm trying to convert custom button into vf page.
my scenario is, i  have a custom button where we are invoking flows using javacript.code looks like below.
windows.open (/flow/Enable_SLink_Access &varContactId={!Contact.Id} &retURL=/{!Contact.Id}).
here we are passig some values in the URL.

Now i creating a  custom button where i'm using vf page as content resource.when i click on that button i need to invoke the above flow with same paramaters.. can someone help how to achieve this/ any alternate soluation for this.(if anything can be done flow level that is fine.).very urgent..:)


Thanks
Lakshminarayana
 
HI All,

I have created a visualforce page which contains many inputfileds to accept values from user. i'm showing some visualforce error messages on top of the page, if user forgets to enter values in inputfields. 
what i want here is whenever user enters some values and clicked on submit button,if it shows any errors it should automatically go back to the the place where error messages are displyed.(i.e we need to set focus on Error messages.)
I hope my question is clear.
Any suggestions or code snippet is appriciated.


Thanks
Lakshman
 
HI All,

I have created a visualforce page which contains many inputfileds to accept values from user. i'm showing some visualforce error messages on top of the page, if user forgets to enter values in inputfields. 
what i want here is whenever user enters some values and clicked on submit button,if it shows any errors it should automatically go back to the the place where error messages are displyed.(i.e we need to set focus on Error messages.)
I hope my question is clear.
Any suggestions or code snippet is appriciated.


Thanks
Lakshman


 
Hi All,

I am getting an error "/apex/Unauthorized" while attaching an image in Rich text box in a Public site. It is working fine in a VF page inside salesforce but not working in a public site. Please help me on this.

Thanks
Lakshman
HI All,

I have a page which contains many fields out which 2 are region and country,these 2 are picklists.
i wanted to populate values into these 2 fields from custom settings. problem is i wanted to country values based region values.
Ex: say i have region like APJ,EMEA.
for APJ i have countries like india,indonesia,australia,
for EMEA i have countries like US,UK,.
when i select REgion as APJ i have to show only india,indonesia,australia in the country field.
for this do i need to create 2 custom settings ?and how to achieve the above functionality in VF Page.

Thanks
Lakshminarayana
 
Hi Everyone,

i have scenario . can you suggest me how to write trigger.
scenario is i have a standard object case. i have created a custom field which is of type checkbox.
i have created a record. on the record detail page we can post some comments using @mention xyz user.

when some one is posted comments using @mention username(owner of the record), i want to make that checkbox true.
what is relationship between case and casefeed.
can some one tel me how to write trigger for this.

Thanks
Lakshman
Hi Everyone,

While writting test class webservice callouts, i'm getting the following Exception.
you have uncommitted work pending. Please commit or rollback before calling out.

my test class:
----------------------
@isTest
public class GSD_partordercontroller_TESTROH {
    
    private static void createCustomSetting(){
            HPTriggerFrameworkObjectMapping__c CSPOobj=new HPTriggerFrameworkObjectMapping__c(Name='GSD_Part_Order__c ', DispatcherCalssName__c='GSDPartOrder');
            insert CSPOobj;
            HPTriggerFrameworkObjectMapping__c CSPOLobj=new HPTriggerFrameworkObjectMapping__c(Name='GSD_Part_Order_Line__c', DispatcherCalssName__c='GSDPartOrderLine');
            insert CSPOLobj;
            HPTriggerFrameworkObjectMapping__c trigFramework = new HPTriggerFrameworkObjectMapping__c(name = 'CKSW__Task__c',DispatcherCalssName__c = 'GSDTask');
            insert trigFramework;
            HPTriggerFrameworkObjectMapping__c resourceCS = new HPTriggerFrameworkObjectMapping__c(name = 'CKSW__Engineer_Equipment__c',DispatcherCalssName__c = 'GSDResource');
            insert resourceCS;
            HPTriggerFrameworkObjectMapping__c GsdCaseQuote=new HPTriggerFrameworkObjectMapping__c(name='GSD_Case_Quote__c',DispatcherCalssName__c='GSDCaseQuote');
            insert GsdCaseQuote;
             HPTriggerFrameworkObjectMapping__c partPickLoCObj=new HPTriggerFrameworkObjectMapping__c(name='GSD_Part_Pickup_Location__c',DispatcherCalssName__c='GSDPartPickupLocation');
            insert partPickLoCObj;

        } 
Private testmethod static void MethodFROH(){
        createCustomSetting();
   // Test.setMock(WebServiceMock.class, new GSDTrunkPartOrderWebMockIml());
    test.startTest();
    CKSW__Engineer_Equipment__c resourecObj =  new CKSW__Engineer_Equipment__c( Name='Test resource',Standby_Dispatch_Policy__c='Bulk',
                                                                                    Mobile__c='9663066004', CKSW__User__c=userinfo.getUserId());
        insert resourecObj;
        
        GSD_Business_Center__c buscenter= new GSD_Business_Center__c(Name='Test Business' ,Business_Center_Key__c=123456,Active__c=true);
        insert buscenter;
        
        Account newAccount= new Account(Name='Test Account');
        insert newAccount;
        contact newContact =new contact(FirstName='Joe',LastName='Smith',Phone='415.555.1212',AccountId=newAccount.Id);
        Asset AsetObj=new Asset();
        AsetObj.name='as1';
        AsetObj.HP_Product_Number__c='H4U87ES';
        AsetObj.HP_Asset_Type__c='PPS GSB Asset';
        AsetObj.Manufacturer__c='HP DesignJet (PL30)';
        AsetObj.Status='Active';
        AsetObj.HP_Product_Model__c='30 - DesignJet HW';
        AsetObj.AccountId=newAccount.Id;
        insert AsetObj;
        BusinessHours newBusHours= new BusinessHours(Name='Default');
        Case newCase= new Case(status='open', BusinessHours=newBusHours,source_system_case_id__c='98000057131', 
                               Severity__c='3-NORMAL', Description='Test Description', OwnerId=userinfo.getUserId(),Reason='ABP Support',NBD_SBD__c='NBD');
        newCase.Requestor_s_TimeZone__c='(GMT+00:00) British Standard Time (Europe/London)';
        newCase.AssetId=AsetObj.Id;
        newcase.Last_Service_Delivery_Time__c=system.now()+1;
        newCase.Entitlement_SLA_Response__c='RESPONSE_TIME';
        newCase.Latest_Service_DateTime__c=system.now();
        newCase.Mission_Critical__c=true;
        newCase.OrderTypeCode__c='00E-No Entitlement';
        insert newCase;
        GSD_Part_Order__c POObj=new GSD_Part_Order__c(name='Po',Legacy_Part_Order_number__c='1234567891-123-1');
        POObj.ISO2_Character_Country_Code__c='AX'; 
        POObj.Country__c='AF';
        POObj.Order_Reason_Code__c='615-Customer Self Repair (CSR)';
        POObj.Shipping_Condition_Code__c='SBD';
        POObj.Shipping_Carrier_Code__c='S3-DHL';
        POObj.Case_Number__c=newcase.id;
        POObj.Part_Delivery_Requested_TimeStamp__c=system.now();
        POObj.Part_Order_Type_Code__c='ZSSB Exchange Order';
        POObj.Delivery_Priority_Code__c='40-Manual Escalations';
        POObj.Special_Delivery_Process_Code__c='21-Next Flight Out';
        insert POObj;
        GSD_Part_Order_Line__c partorderline=new GSD_Part_Order_Line__c(name='pol',Part_Order_Header_Number__c=POObj.Id);
         partorderline.Logistics_Estimated_Arrival_TimeStamp__c=system.now()+1;
         partorderline.Part_Response_Status_Code__c='BACKORDER';
         partorderline.Offered_Part_Identifier__c='abcOfr';
         partorderline.Part_Identifier__c='Test';
         partorderline.Part_Line_Status__c='Cancelled';
         partorderline.Part_Description__c='Description';
        insert partorderline;
        World_Region__c WR=new World_Region__c();
        wr.Name='AX';
        insert WR;
        World_Region_Configuration__c WRCObj=new World_Region_Configuration__c();
        WRCObj.Text_Value__c='test';
        WRCObj.World_Region__c=WR.Id;
        WRCObj.Name='GSD_iGSO_Sales_Organization';
        insert WRCObj;
        GSD_ODM_Reference__c ODMObj=new GSD_ODM_Reference__c();
        ODMObj.name='odm123';
        insert ODMObj;
        list<gsd_offer__C> LIObj=new list<gsd_offer__C>();
        gsd_offer__C OFFObj=new gsd_offer__C();
        OFFObj.name='off1';
        OFFObj.Case__c=newCase.Id;
        OFFObj.Offer_Reference__c=ODMObj.Id;
        OFFObj.Start_Date__c=system.today();
        OFFObj.End_Date__c=system.today()+1; 
        OFFObj.Entitlement_Type_Code__c='W';
        insert OFFObj;
        LIObj.add(OFFObj);
        GSD_Integration_Data__c trunkpartorder=new GSD_Integration_Data__c();
        trunkpartorder.End_point_URL__c='https://it-services-gw-csc-stg.itcs.hp.com/gw/hpit/egit/createtrunkpartorder.itg';
        trunkpartorder.Name='Trunkpartorder';
        trunkpartorder.Time_out__c=120000;
        trunkpartorder.Client_Certificate__c='';
        insert trunkpartorder; 
        
        Apexpages.StandardController sc = new Apexpages.standardController(POObj);
        GSD_PartOrderController POCObj=new GSD_PartOrderController(sc);
        POCObj.closeValidateAddressPopUp();
        POCObj.caseobj=newcase;
        POCObj.orderobj=POObj;
        POCObj.orderid='';
        POCObj.partorderid=POObj.id;
        //MonitorUtility objmonitorutility=new MonitorUtility();
        POCObj.Transactionid='TrunkPartOrder';
        GSDCustomerTimeZoneUtility LTZObj=new GSDCustomerTimeZoneUtility();
        string tZ='(GMT+09:00) Japan Standard Time (Asia/Tokyo)';
        GSDCustomerTimeZoneUtility.LongNameToTimeZone(tZ);
        
     
   // GsdTrunkpartorderCreateResponse.CreateTrunkPartOrderEndpoint3 resObj=new GsdTrunkpartorderCreateResponse.CreateTrunkPartOrderEndpoint3();
    test.stopTest();
    Test.setMock(WebServiceMock.class, new GSDTrunkPartOrderWebMockIml());  
    
    POCObj.TrunkPartorder();
    
    }
       private testmethod static void methodFEntitleElseblcok(){
        
        createCustomSetting();
        CKSW__Engineer_Equipment__c resourecObj =  new CKSW__Engineer_Equipment__c( Name='Test resource',Standby_Dispatch_Policy__c='Bulk',
                                                                                    Mobile__c='9663066004', CKSW__User__c=userinfo.getUserId());
        insert resourecObj;
        
        GSD_Business_Center__c buscenter= new GSD_Business_Center__c(Name='Test Business' ,Business_Center_Key__c=123456,Active__c=true);
        insert buscenter;
        
        Account newAccount= new Account(Name='Test Account');
        insert newAccount;
        contact newContact =new contact(FirstName='Joe',LastName='Smith',Phone='415.555.1212',AccountId=newAccount.Id);
        Asset AsetObj=new Asset();
        AsetObj.name='as1';
        AsetObj.HP_Product_Number__c='H4U87ES';
        AsetObj.HP_Asset_Type__c='PPS GSB Asset';
        AsetObj.Manufacturer__c='HP DesignJet (PL30)';
        AsetObj.Status='Active';
        AsetObj.HP_Product_Model__c='30 - DesignJet HW';
        AsetObj.AccountId=newAccount.Id;
        insert AsetObj;
        BusinessHours newBusHours= new BusinessHours(Name='Default');
        Case newCase= new Case(status='open', BusinessHours=newBusHours,source_system_case_id__c='98000057131', 
                               Severity__c='3-NORMAL', Description='Test Description', OwnerId=userinfo.getUserId(),Reason='ABP Support',NBD_SBD__c='SBD');
        newCase.Mission_Critical__c=true;
        newCase.AssetId=AsetObj.Id;
        newcase.Last_Service_Delivery_Time__c=system.now()+1;
        insert newCase;
       // ApexPages.currentPage().getParameters().put('caseid', newCase.Id);
        GSD_Case_Quote__c quote = new GSD_Case_Quote__c(name = 'Test Quote', Case__c = newCase.id);
        insert quote;
        
        CKSW__TaskType__c taskType= new CKSW__TaskType__c(Name='Repair', CKSW__Duration__c=20);
        insert taskType;
        CKSW__WorkOrder__c workOrder= new CKSW__WorkOrder__c(CKSW__Account__c=newAccount.Id,
                                      CKSW__StartDate__c=Date.Today(), CKSW__EndDate__c=Date.Today());
        insert workOrder;
        CKSW__Task__c taskRec = new CKSW__Task__c(CKSW__WorkOrder__c=workOrder.Id, CKSW__TaskType__c=taskType.Id,Business_Center__c=buscenter.Id,
                                                  External_Task_Identifier__c='98000057131-971', CKSW__Assigned_Resource__c=resourecObj.Id,Product_Number__c='123',Serial_Number__c='S123',Case_Quote__c=quote.id);
        taskRec.Entitled_Service_Window_Start_DateTime__c=system.now();
        taskRec.Requested_Service_Window_Start_DateTime__c=system.now();
        taskRec.Entitled_Service_Window_End_DateTime__c=system.now();
        taskRec.Requested_Service_Window_End_DateTime__c=system.now();
        taskRec.CKSW__Country__c='India';
        taskRec.CKSW__Street__c='biji';
        taskREc.CKSW__City__c='Bangalore';
        taskRec.CKSW__State__c='Karnataka';
        taskREc.CKSW__Zip_Postal_Code__c='560100';
        insert taskRec ;
       
        GSD_ODM_Reference__c ODMObj=new GSD_ODM_Reference__c();
        ODMObj.name='odm123';
        insert ODMObj;
        
        ApexPages.currentPage().getParameters().put('caseid', newCase.Id);
        GSD_Part_Order__c POObj=new GSD_Part_Order__c(Case_Number__c=newCase.id,Service_Delivery_Type__c='Onsite');
        POObj.Legacy_Part_Order_number__c='1234567890-123-1';
        POObj.Pending_Transaction_Type__c='Trans';
        POObj.ISO2_Character_Country_Code__c='AX';
        POObj.Shipping_Carrier_Code__c='S1-Postal Service';
        POObj.Shipping_Condition_Code__c='None';
        POObj.Service_Delivery_Type__c='CSR';
        POObj.Delivery_Priority_Code__c='None';
        POObj.Street2__c='street2';
        POObj.Company_Name__c='company1';
        POObj.Responsible_Party_Id__c='RPID';
        POObj.Order_Status_Code__c='Recommended';
        insert POObj;
        World_Region__c WR=new World_Region__c();
        wr.Name='AX';
       // Wr.ParentId__c=POObj.ISO2_Character_Country_Code__c;
       
        insert WR;
        list<World_Region_Configuration__c> lstwrc=new list<World_Region_Configuration__c>();
        World_Region_Configuration__c wrObj=new World_Region_Configuration__c();
           
        wrObj.World_Region__c=wr.Id;
        wrObj.Name='GSD_iGSO_Sales_Organization';
        insert wrObj;
        lstwrc.add(wrobj);
        
        GSD_Part_Order_Line__c partorderline=new GSD_Part_Order_Line__c(name='pol',Part_Order_Header_Number__c=POObj.Id);
        partorderline.Part_Line_Status__c='On Hold';
        partorderline.Part_Identifier__c='PI';
        insert partorderline;
        List<GSD_Part_Order_Line__c> WLPOLObj=new List<GSD_Part_Order_Line__c>();
        WLPOLObj.add(partorderline); 
        
        list<gsd_offer__C> LIObj=new list<gsd_offer__C>();
        gsd_offer__C OFFObj=new gsd_offer__C();
        OFFObj.name='off1';
        OFFObj.Case__c=newCase.Id;
        OFFObj.Offer_Reference__c=ODMObj.Id;
        OFFObj.Start_Date__c=system.today();
        OFFObj.End_Date__c=system.today()+1;        
        insert OFFObj;
        LIObj.add(OFFObj);
        
        Apexpages.StandardController sc = new Apexpages.standardController(POObj);
        GSD_PartOrderController POCObj=new GSD_PartOrderController(sc);
        GSD_PartOrderController.postback=true;
        POCObj.CaseId=newCase.id;
        POCObj.TaskId=taskRec.Id;
        POCObj.partorderid=POObj.id;
        POCObj.taskObj=taskRec;
        
        boolean isChecked=true;
        boolean isSLAmet=true;
        List<SelectOption> options = new List<SelectOption>();
        options.add(new SelectOption('US','US'));
        String PromisedTimeCOnvertedtoCTZ='re';
        GSD_PartOrderController.partOrderLineWrapper POLObj=new GSD_PartOrderController.partOrderLineWrapper(isChecked,isSLAmet,partorderline,options,PromisedTimeCOnvertedtoCTZ);
        list<GSD_PartOrderController.partOrderLineWrapper> WPOLObj=new list<GSD_PartOrderController.partOrderLineWrapper>();
        WPOLObj.add(POLObj);
        POCObj.wl= WPOLObj;
        POCObj.onPageLoad();
        POCObj.closeValidateAddressPopUp();
        POCObj.FillEntitlementsection();
        

        GsdAtpStream ATPObj=new GsdAtpStream();
        GsdAtpStream.GetATPType GetAtp=new GsdAtpStream.GetATPType();
        GsdAtpStream.AddressBlock_element Address=new GsdAtpStream.AddressBlock_element ();
        GsdAtpStream.InPartList_element InPart=new GsdAtpStream.InPartList_element();
        GsdAtpStream.GetATPResponseType Res=new GsdAtpStream.GetATPResponseType();
        GsdAtpStream.PartList_element PartElement=new GsdAtpStream.PartList_element();
        GsdAtpStream.PortTypeEndpoint1  port=new GsdAtpStream.PortTypeEndpoint1();
        GsdAtpStream.FaultMessageType Msg=new GsdAtpStream.FaultMessageType();
         GSD_Integration_Data__c GSDI=new  GSD_Integration_Data__c(name='ATP',End_point_URL__c='https://it-services-gw-csc-stg.itcs.hp.com/gw/hpit/egit/getatp.itg',Time_out__c=120000,Client_Certificate__c='');
         insert GSDI;
           
        GSDIntegrationUtilityClass objIntegrationData = new GSDIntegrationUtilityClass();
           string strServicename='ATP';
           objIntegrationData.GetEndpointData(strServicename);
       test.startTest();
       Test.setMock(WebServiceMock.class, new GsdAtpStreamWebMockIml()); 
        POCObj.checkAvail();
        POCObj.partlineid=partorderline.id;
        POCObj.checkAvailSupressEqualent();
       test.stopTest();
    }
   
    
}
can some one tel me how to resolve this issue.
Regards
Lakshman
Hi Everyone,

I want to write to test class for webservice callouts.below is the WSDL2Apex class.
how to generate mock response for this.
public class GsdTrunkpartorderCreateResponse {
    public class CreateTrunkPartOrderEndpoint3 {
        public String endpoint_x = 'https://localhost:4437/CreateTrunkPartOrder';
        public Map<String,String> inputHttpHeaders_x;
        public Map<String,String> outputHttpHeaders_x;
        public String clientCertName_x;
        public String clientCert_x;
        public String clientCertPasswd_x;
        public Integer timeout_x;
        private String[] ns_map_type_info = new String[]{'http://www.hp.com/GSD/SFDC/Outbound/WES_Cloud/CreateTrunkPartOrder/Artifacts/Schema/CreateTrunkPartOrder.xsd', 'GsdTrunkpartorderCreateRequest', 'http://www.hp.com/GSD/SFDC/Outbound/WES_Cloud/CreateTrunkPartOrder/Services/CreateTrunkPartOrder-service.serviceagent', 'GsdTrunkpartorderCreateResponse'};
        public GsdTrunkpartorderCreateRequest.CreateTrunkPartOrderResponse_element CreateTrunkPartOrder(GsdTrunkpartorderCreateRequest.YORDER_CREATE_IMP1 ORDER_CREATE_IMP,GsdTrunkpartorderCreateRequest.Monitoring_element Monitoring,String Region) {
            GsdTrunkpartorderCreateRequest.CreateTrunkPartOrder_element request_x = new GsdTrunkpartorderCreateRequest.CreateTrunkPartOrder_element();
            request_x.ORDER_CREATE_IMP = ORDER_CREATE_IMP;
            request_x.Monitoring = Monitoring;
            request_x.Region = Region;
            GsdTrunkpartorderCreateRequest.CreateTrunkPartOrderResponse_element response_x;
            Map<String, GsdTrunkpartorderCreateRequest.CreateTrunkPartOrderResponse_element> response_map_x = new Map<String, GsdTrunkpartorderCreateRequest.CreateTrunkPartOrderResponse_element>();
            response_map_x.put('response_x', response_x);
            WebServiceCallout.invoke(
              this,
              request_x,
              response_map_x,
              new String[]{endpoint_x,
              '/SFDC/Outbound/WES_Cloud/CreateTrunkPartOrder/Artifacts/WSDL/CreateTrunkPartOrder_Abstract-service3.serviceagent/CreateTrunkPartOrderEndpoint3/CreateTrunkPartOrder',
              'http://www.hp.com/GSD/SFDC/Outbound/WES_Cloud/CreateTrunkPartOrder/Artifacts/Schema/CreateTrunkPartOrder.xsd',
              'CreateTrunkPartOrder',
              'http://www.hp.com/GSD/SFDC/Outbound/WES_Cloud/CreateTrunkPartOrder/Artifacts/Schema/CreateTrunkPartOrder.xsd',
              'CreateTrunkPartOrderResponse',
              'GsdTrunkpartorderCreateRequest.CreateTrunkPartOrderResponse_element'}
            );
            response_x = response_map_x.get('response_x');
            return response_x;
        }
    }
}.
-----------------------
public class GsdTrunkpartorderCreateRequest {
public class CreateTrunkPartOrderResponse_element {
        public String StatusCode;
        public String StatusMsg;
        private String[] StatusCode_type_info = new String[]{'StatusCode','http://www.hp.com/GSD/SFDC/Outbound/WES_Cloud/CreateTrunkPartOrder/Artifacts/Schema/CreateTrunkPartOrder.xsd',null,'0','1','false'};
        private String[] StatusMsg_type_info = new String[]{'StatusMsg','http://www.hp.com/GSD/SFDC/Outbound/WES_Cloud/CreateTrunkPartOrder/Artifacts/Schema/CreateTrunkPartOrder.xsd',null,'0','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://www.hp.com/GSD/SFDC/Outbound/WES_Cloud/CreateTrunkPartOrder/Artifacts/Schema/CreateTrunkPartOrder.xsd','true','false'};
        private String[] field_order_type_info = new String[]{'StatusCode','StatusMsg'};
    }
}
Hi  everyone,

I'm having an issue of writing test class for asynchronous callouts which i have used in controller.
can some one help me to write test class to code coverage to max.
i followed the way in the below link and i'm getting the following Error.
System.NoSuchElementException: Iterator has no more elements
link for test class provided by salesforce.
https://www.salesforce.com/us/developer/docs/apexcode/Content/apex_continuation_callout_soap.htm
Thanks in advance.
Lakshman
 
Hi Everyone,

i have problem with iframe.
i have 2 pages. 1st page is having a button. when i click on that button 2nd is opening as a pop up. 2nd page is taking some time to load.so i want to show process image till page is loaded. i'm doing doing pop up using <apex:iframe>.
can some one tel me help in this context.
i hope i'm clear with my question.

Regards
Lakshman

I want to show alert whenever progressbar reaches to the max value.

 

Here is my code---------

<script>
var width=0;
var timer;
$(document).ready(function(){
if(width<100){
timer=setInterval("CallMeInterval()", 2000);
}
});

function CallMeInterval()
{

$( "#progressbar" ).progressbar({
value: width+=10
});
}
</script>
<apex:form >
</apex:form>
<div id="progressbar"></div>

 

I have tried it through lots of way but not working perfectly.Please Help.

Hello,

Can anyone please provide some guidance in how to go about writing test code coverage for Webservices API Calls to a 3rd party application.

Following is the code, that I am trying to get code coverage for:

 String datumapp = '{'
      + '"serial_number":"'+SerialNumber + '",'
      + '"model":"A20-R-500",'
      + '"reseller":"'+ SFDCResellerID +'",'
      + '"client":"' + SFDCClientID +'",'
      + '"package":"'+ PackageType +'",'
      + '"offsite":"'+ Offsite +'",'
      + '"data_center":"'+ DataCenter +'",'
      + '"status":"active"'
      + '}';
      
             
      Http httpProtocolInsertAppliance = new Http();       // Create HTTP request to send.
      HttpRequest requestapp = new HttpRequest(); // Set the endpoint URL.
      String endpointapp = 'https://rmc01.asdsdt.net/sfapi/appliance/';
      requestapp.setEndPoint(endpointapp);
      requestapp.setBody(datumapp);
      requestapp.setMethod('POST');
      requestapp.setHeader('X-API-KEY','abczyx');
      requestapp.setHeader('Content-length', String.valueOf(datumapp.length()));

      
      try
      {
      
      HttpResponse responseapp = httpProtocolInsertAppliance.send(requestapp);
      System.debug(responseapp.getBody()+'APPLIANCE INSERTION CHECK 1');
      System.debug(responseapp.getHeader('Location')+'APPLIANCE INSERTION CHECK 1');
     
      
      if(String.valueof(responseapp.getStatus())=='400')
      {
      
      throw new IntegrationException('Already exists');
      }

    Submitted

Hi I have created a custom object "Referral__c" and within this object there is a custom field  "Physician_s_Signature__c" of Type Rich text

 

I have created a VF page to take input from user and user suppose to upload a image in this rich text box, when I upload this image in text from SFDC itself it works fine.

 

But when I used this page within a SFDC site and try to upload a image in that rich text box, it gives me authentication error, please see the details below

 

Ant help would be highly appreciate

 

this is how  i used this field in VF page

<apex:inputfield value="{!Referral__c.Physician_s_Signature__c}"/> 

 

 

Error message

Timestamp: 26/05/12 10:13:11 PM

Error: CSRF protect string not added to servlet response.

Source File: http://ebsc-developer-edition.ap1.force.com/apexpages/ckeditor/_source/plugins/sfdcImage/dialogs/sfdcImage.js?t=B49E5BQ

Line: 172

Timestamp: 26/05/12 10:13:11 PMError: CSRF protect string not added to servlet response.Source File: http://ebsc-developer-edition.ap1.force.com/apexpages/ckeditor/_source/plugins/sfdcImage/dialogs/sfdcImage.js?t=B49E5BQLine: 172