• SaurabhGupta_
  • NEWBIE
  • 5 Points
  • Member since 2014


  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 11
    Replies
Universal Containers (UC) has a requirement to expose a web service to their business partners. The web service will be used to allow each business partner to query
 UC's Salesforce instance to retrieve the status of orders. The business partner should only be allowed access to orders for which the business partner is the 
 fulfillment vendor. The Architect does not want the business partners to utilize the standard APIs and would prefer a custom API be developed.Which three design 
 elements should the Architect consider in order to ensure the data security of the solution? Choose 3 answers
A. Query the Orders object with Dynamic SOQL based upon the fulfillment ID.
B. Set the Orders object's sharing settings to Private in the Org-Wide Defaults
C. Provide each partner with their own Salesforce login set to API Enabled on the profile. 
D. Develop a custom Apex web service with a fulfillment ID input attribute
E. Develop a custom Apex web service using the "With Sharing" keyword.
Hello Everyone,

I am currently working with a client where requirement is to integrate with FedEx and get the package tracking details. We have suggested the AppExchange product provided by Zenkraft but they want to explore more.

Do we have any experience with any other FedEx app or any point to point integration with FedEx.

Thanks for Your Support.
I have used pop to visualforce page in softphone layout. My custom vf page is popping in the new tab of service console. But I am not able to get the ANI(Caller number) value in apex controller.
It was available in old version of CTI but in open CTI I am not able to get ANI. Please suggest.
I have used pop to visualforce page in softphone layout. My custom vf page is popping in the new tab of service console. But I am not able to get the ANI(Caller number) value in apex controller.
It was available in old version of CTI but in open CTI I am not able to get ANI. Please suggest.
Universal Containers (UC) has a requirement to expose a web service to their business partners. The web service will be used to allow each business partner to query
 UC's Salesforce instance to retrieve the status of orders. The business partner should only be allowed access to orders for which the business partner is the 
 fulfillment vendor. The Architect does not want the business partners to utilize the standard APIs and would prefer a custom API be developed.Which three design 
 elements should the Architect consider in order to ensure the data security of the solution? Choose 3 answers
A. Query the Orders object with Dynamic SOQL based upon the fulfillment ID.
B. Set the Orders object's sharing settings to Private in the Org-Wide Defaults
C. Provide each partner with their own Salesforce login set to API Enabled on the profile. 
D. Develop a custom Apex web service with a fulfillment ID input attribute
E. Develop a custom Apex web service using the "With Sharing" keyword.
Hi, 

We have a apex class and trigger that always workded fine however yesterday all stoped, the class  and trigger were both at 0% code coverage yesterday so I ran the tests and cleared the past test results but still no joy. 
This morning the Class has a code coverage of 100% but the trigger is still at 0% although the when I test this the batch is showing up in the job list as complete. 
Any advice would be welcome, also is there a way I see what data was sent in the batch or where it was sent to?

Thank you in advance. 

Lorr
  • April 17, 2018
  • Like
  • 0
I have a requirement where I have to display mutliple columns from different objects on a single VF page

i'm trying to display but the way its binding is improper.

public class YourController {

    public String GetAttributes { get; set; }
public List<Vehicle> vehicles { get; set; }

    public YourController() {

        vehicles = new List<Vehicle>();

        List<account> cars = [SELECT Id, Name, Description FROM account];
        
        List<contact> planes = [SELECT Id, name , Title FROM contact];

        for(account car : cars) {
        system.debug('car value in the loop ---> '+car.name);
            vehicles.add(new Vehicle(car));
        }

        for(contact plane : planes) {
        system.debug('Plane value in the loop ---> '+plane.title);
            vehicles.add(new Vehicle(plane));
        }
        
    }
    
    
      public List<contact> GetAttributes(){
    List<contact> attr = [SELECT Name from contact limit 10];
    return attr;
    }
    

    public class Vehicle {
        public Id id { get; set; }
        public string name { get; set; }
        public string name1{ get; set; }

        public Vehicle(account car) {
     //       this.id = car.Id;
            this.name = car.name;
           // this.desc = car.desc;
        }

        public Vehicle(contact plane) {
       //     this.id = plane.Id;
            this.name1 = plane.title;
            //this.desc = plane.desc;
        }
    }
}


VF page code 


<apex:page controller="YourController" >
<apex:form >
<apex:pageBlock ><apex:pageBlockTable value="{!vehicles}" var="vehicle">
   <!--- <apex:column headerValue="Id" value="{!vehicle.id}" />  --->
    <apex:column headerValue="FirstName" value="{!vehicle.name}" />
    <apex:column headerValue="Name" value="{!vehicle.name1}" />
    
    <apex:pageBlockSection title="Vitality Check Attributes">
        <apex:pageBlock >
            <apex:repeat value="{!Attributes}" var="att">
            </apex:repeat>
        </apex:pageBlock>
    </apex:pageBlockSection>
    
    
</apex:pageBlockTable>
</apex:pageBlock>
</apex:form>
</apex:page>



 
Hello Developers
  pls help me How to cover these line in test class I am try a lot but not success. MY test code is below
@isTest
private class MSDbugScheduleLogHistoryCl_Test {
  static testMethod void MSDbugScheduleLogHistoryCl_method() {
    MS_Sync_App__c oMSSyncApp = new MS_Sync_App__c(Name = 'WooCommerce');
    insert oMSSyncApp;
    
    MS_Connector__c oMSConnector = new MS_Connector__c(Name = 'WooCommArcs', Connector_Type__c = oMSSyncApp.Id);
    insert oMSConnector;
    
    String sConId = ApexPages.currentPage().getParameters().put('conTypeId', oMSSyncApp.Id);
    
    MS_Schedule__c oMSSchedule = new MS_Schedule__c(Name = 'Test', Connector__c = oMSConnector.Id);
    insert oMSSchedule;
    String sId = ApexPages.currentPage().getParameters().put('ScheduleId', oMSSchedule.Id);
    
    MS_Schedule_History__c oMSScheduleHistory = new MS_Schedule_History__c(MS_Schedule__c = oMSSchedule.Id);
    insert oMSScheduleHistory;
    String slogId = ApexPages.currentPage().getParameters().put('logid', oMSScheduleHistory.Id);
    
    MSDbugScheduleLogHistoryCl oMSDbugScheduleLogHistoryCl = new MSDbugScheduleLogHistoryCl();
    oMSDbugScheduleLogHistoryCl.sScheduleId = sId;
    oMSDbugScheduleLogHistoryCl.slogId = slogId;
    oMSDbugScheduleLogHistoryCl.sId = oMSScheduleHistory.Id;
    oMSDbugScheduleLogHistoryCl.beginning();
	oMSDbugScheduleLogHistoryCl.next();
	oMSDbugScheduleLogHistoryCl.previousRecord();
	oMSDbugScheduleLogHistoryCl.last();
	oMSDbugScheduleLogHistoryCl.getDisableNext();
    oMSDbugScheduleLogHistoryCl.getDisablePrevious();
	oMSDbugScheduleLogHistoryCl.Previous();
    oMSDbugScheduleLogHistoryCl.Mapping(); 
    oMSDbugScheduleLogHistoryCl.closePopup();
    oMSDbugScheduleLogHistoryCl.showPopup();
    System.assert(oMSSchedule.Id != null);
  }
}

How to cover these line in test class
Hi all 
i have to deploy  15 test classes into production.  
among these some are new and few are goint to overwirte the existing test classes. 
what are the steps to follow to deploy?? 

if i go throught he changesets
do i need to validate the test classes before deploy or directly can deploy? 

shall we expect any deployment errors
 
Hi,

How to call from one future method to another future method. I'm getting the below exception.

Future method cannot be called from a future or batch method:

Is there any workaround resolve this issue? Please let me know how to fix this issue.

Thanks,
Vijay
Hello,

I have a VF, conroller and the page display like below:
<apex:page standardController="Case" extensions="Controller_Extension_Class" >
    <script type="text/javascript" language="javascript">  
    function callJS(id1)
    {        
        var v1 ='';
        if(document.getElementById(id1) != null){
            v1 = document.getElementById(id1).value;
        }     
        callAF(v1); 
    }     
    </script>     
    <apex:sectionHeader title="Case Edit" subtitle="New Case"/>
    <apex:form >
        <apex:pageMessages id="IdOfErrorMessages" />
        <apex:actionFunction name="callAF" action="{!updateSubjectAndDescription}" reRender="IdOfAsset,IdOfType, IdOfSubject,IdOfDescription, IdOfErrorMessages">
            <apex:param name="AssetValue" value="" />
            <apex:param name="profileName" value="{!$Profile.Name}" />
        </apex:actionFunction>         
        <apex:pageBlock title="Case Edit" mode="detail">
            <apex:pageBlockButtons location="bottom">
                <apex:commandButton value="Save" action="{!save}"/>
                <apex:commandButton value="Cancel" action="{!cancel}"/>
            </apex:pageBlockButtons>
            
            <apex:pageBlockSection title="Case Information" columns="2" >
                <apex:inputField value="{!caseObj.CaseNumber}" />
                <apex:inputField value="{!caseObj.AccountId}" required="true"/>
                <apex:inputField value="{!caseObj.Status}" required="true"/>
                <apex:inputField id="IdOfAsset" value="{!caseObj.AssetId}" required="{!IsRequired}" rendered="{!IsRendered}" />
                <apex:pageBlockSectionItem />
            </apex:pageBlockSection>			
            <apex:pageBlockSection title="Description Information" columns="1">
                <apex:inputField id="IdOfType" value="{!caseObj.Type}" required="true"
                                 onchange="callJS('{!$Component.IdOfType}');" />
                <apex:inputField id="IdOfSubject" value="{!caseObj.Subject}"  />
                <apex:inputField id="IdOfDescription" value="{!caseObj.Description}"  />
            </apex:pageBlockSection>			
            
        </apex:pageBlock>
    </apex:form>

</apex:page>
 
public with sharing class Controller_Extension_Class {
    
    public Case caseObj {get;set;}
    public boolean IsRequired {get; set;}
    public boolean IsRendered {get; set;}
    

    public Controller_Extension_Class(ApexPages.StandardController controller){
        caseObj = (Case)controller.getRecord();
        IsRequired = false;
        IsRendered = true;  
    }
    

    public void updateSubjectAndDescription(){
        String selectedType = System.currentPageReference().getParameters().get('AssetValue');
        String profileOfUser = System.currentPageReference().getParameters().get('profileName');
        IsRequired = false;
        IsRendered = true;  
        if(profileOfUser == 'XYZ'){
            if(selectedType == 'Pick Val1'){
                IsRequired = true;
            }else if(selectedType == 'Pick Val2'){
                IsRendered = false;  
        }          
    }    
}

User-added image

Problem:
1) once if the error message is displyed on screen, then until the "accccount id " is filled, no "action" is executed.
For example, in my use case action "updateSubjectAndDescription" is never executed if a error message is added to screen.
2) similar case happens when Asset become mandatory
3) the issue occurs when "Type" is changed or "save" is clicked.

Questions:
1) I perfectly understad that, when "save" is cliked then erro message should be displyed, but i do not understad why error mesage is displyed when "Type" is changed.

thanks for suggestions
  • December 28, 2016
  • Like
  • 0
Hi Team,

Please help me how to use translation custom labels in apex class. I can able to use translation custom labels in vf page as !$Label.customlabelname but i am not able to use translation custom lables in apex class.
I have tried to use ApexPages.Message myMsg1 = new ApexPages.Message(ApexPages.Severity.ERROR,Label.Error_Message); like this but always i am getting error message in english only not in local languages.

Please help how to use this.

Thanks in advance,
padmasree
 
Can any one help me out with this error:
System.LimitException: Too many SOQL queries: 101
I'm running a test class for a trigger  and the test class methods gets failed and the system throws an error for the other triggers 
System.LimitException: Too many SOQL queries: 101
Trigger.MergeLeadTrigger: line 276, column 1

The error line is :
conrecords=[select id , Rep_Managing_Partner_del__c from Contact where id in: getconid1 and Rep_Managing_Partner_del__c !=null];
        

System.LimitException: Too many SOQL queries: 101
Trigger.Accountduplicate: line 6, column 1
The error line is :
  lstusr  =[SELECT Id,Name,Profile.Name FROM User WHERE Id=:UserInfo.getuserId()];
Trigger which i run :
trigger CampaignMemberSyncStatus on CampaignMember (after update) {
    // Sync response status on Campaign Member to lead or contact

    // Look for status changes
    List<Id> relatedIDs = new List<ID>();
    List<Id> modifiedIDs = new List<ID>();
 
    // Get the list of IDs for campaignmembers whose status changed
    for(CampaignMember cm : Trigger.new) {
        if(cm.Response_Status__c != trigger.oldMap.get(cm.Id).Response_Status__c)
        {
            modifiedIDs.add(cm.Id);
            if(cm.ContactId != null) {
                relatedIDs.add(cm.ContactId);
            } else {
                relatedIDs.add(cm.LeadId);
            }
        }
    }
    if(modifiedIds.size() == 0) return;     /// No modified responses
    
    // Now pull the list of related leads and contacts
    Map<id,Lead> RelatedLeads;
    Map<id,Contact> RelatedContacts;
    RelatedLeads = new Map<ID,Lead>([Select id, Disqaulified_Reason__c, Status from Lead where Id in :relatedIDs]);
    RelatedContacts = new Map<ID,Contact>(
        [Select id, Status__c, Lead_Score__c, Campaign_Score__c, Account.Customer_Status__c, Admin_Nurture_Timeout__c from Contact where Id in :relatedIDs]);
    
    // Build lists of leads or contacts to update
    Map<ID,Lead> ModifiedLeads = new Map<ID,Lead>();
    Map<ID,Contact> ModifiedContacts = new Map<ID,Contact>();
    
    Map<String, CMStatusSettings__c> statusmapping = CMStatusSettings__c.getall();
    
    // Now update the stautus
    for(id cmid : modifiedIDs) {
        CampaignMember cm = trigger.newMap.get(cmid);
        Boolean wasupdated;
        if(cm.ContactId != null) {
            wasupdated = CampaignMemberFunctions.SyncStatus(cm, null, RelatedContacts.get(cm.ContactId), statusmapping);
            if(wasupdated) ModifiedContacts.put(cm.ContactID,RelatedContacts.get(cm.ContactId));
        } else {
            wasupdated = CampaignMemberFunctions.SyncStatus(cm, RelatedLeads.get(cm.LeadId), null, statusmapping);
            if(wasupdated) ModifiedLeads.put(cm.LeadId,RelatedLeads.get(cm.LeadId));
        }
    }
    if(ModifiedLeads.size()>0) update ModifiedLeads.values();
    if(ModifiedContacts.size()>0) update ModifiedContacts.values();
    }
Test Class :
@isTest
public class TestCampaignMemberSync 
{

    static testMethod void TestStatusUpdates() 
    {
    Account genericaccount = new Account(Name = 'someaccount');
    insert genericaccount;

        Lead ld1 = new Lead(Company='colead1',LastName='colead1');
        Lead ld2 = new Lead(Company='colead2',LastName='colead2');
        Contact ct1 = new Contact(LastName='cocontact1', AccountID = genericaccount.Id);
        Contact ct2 = new Contact(LastName='cocontact2', AccountID = genericaccount.Id);
        Campaign cam = new Campaign(Name='campname');
        insert cam;
    insert ld1;
    insert ld2;
    insert ct1;
    insert ct2;
        CampaignMember mc1 = new CampaignMember(CampaignId = cam.Id, LeadId=ld1.Id, Buyer__c='a', user__c='b');
        CampaignMember mc2 = new CampaignMember(CampaignId = cam.Id, LeadId=ld2.Id, Buyer__c='a', user__c='b');
        CampaignMember mc3 = new CampaignMember(CampaignId = cam.Id, ContactId=ct1.Id, Buyer__c='a', user__c='b');
        CampaignMember mc4 = new CampaignMember(CampaignId = cam.Id, ContactId=ct2.Id, Buyer__c='a', user__c='b');
    List<CampaignMember> cms = new List<CampaignMember>();
    cms.add(mc1);cms.add(mc2);cms.add(mc3);cms.add(mc4);
    
    
        insert cms;
        List<Id> cmids = new List<id>();
    for(CampaignMember thiscm: cms)
    {
      cmids.add(thiscm.id);
    }
    
    ld1.admin_CMSourceId__c = mc1.id;
    update ld1;  // Needed later to simulate the button click on conversion
    ld2.admin_CMSourceId__c = mc2.id;
    update ld2; // Needed later to simulate the button click on conversion
    
    // Initialize the opp for later creation from CampaignMember
    Opportunity Opp = new Opportunity(CloseDate = Date.Today().addDays(30), AccountId = genericaccount.Id,
        Name='someopp', StageName='Selected' );
        
        Test.StartTest();
        mc1.Response_Status__c = 'Working';
        mc2.Response_Status__c = 'Disqualified';
        mc2.Disqualified_Reason__c = 'no budget';
        mc3.Response_Status__c = 'Working';
        mc4.Response_Status__c = 'Disqualified';
        mc4.Disqualified_Reason__c = 'no budget';
        mc4.Do_not_reassign_to_Landings__c = true;
        
        update cms;
       Test.StopTest();    
        
        List<CampaignMember> mcres = [Select Id, Response_Status__c, Contact.Admin_Nurture_Timeout__c , Contact.Status__c, Lead.Status, Do_not_reassign_to_Landings__c 
          from CampaignMember where Id = :cmids ];
        for(CampaignMember cm: mcres) {
          System.debug('Response ' + cm.Response_Status__c + ' lead status:' + cm.Lead.Status + ' contact status:' + cm.Contact.Status__c );
          System.debug('Nurture date:' + mcres[3].Contact.Admin_Nurture_Timeout__c);
        }
    //System.assertEquals(mcres[3].Do_not_reassign_to_Landings__c, mcres[3].Contact.Do_not_reassign_to_Landings__c);
 
     }
   static testMethod void TestConversionsNoOpp() 
    {
        Account genericaccount = new Account(Name = 'someaccount');
        insert genericaccount;

            Lead ld1 = new Lead(Company='colead1',LastName='colead1');
            Lead ld2 = new Lead(Company='colead2',LastName='colead2');
            ld2.OwnerId = UserInfo.getUserId();
            Campaign cam = new Campaign(Name='campname');
            insert cam;
            insert ld1;
            insert ld2;
            CampaignMember mc1 = new CampaignMember(CampaignId = cam.Id, LeadId=ld1.Id, Buyer__c='a', user__c='b');
            CampaignMember mc2 = new CampaignMember(CampaignId = cam.Id, LeadId=ld2.Id, Buyer__c='a', user__c='b');
            List<CampaignMember> cms = new List<CampaignMember>();
            cms.add(mc1);
            cms.add(mc2);
        
            insert cms;
            List<Id> cmids = new List<id>();
            /*for(CampaignMember thiscm: cms)
            {
              cmids.add(thiscm.id);
            }*/
        
        ld1.admin_CMSourceId__c = mc1.id;
        update ld1;  // Needed later to simulate the button click on conversion
        ld2.admin_CMSourceId__c = mc2.id;
        update ld2; // Needed later to simulate the button click on conversion
        
        // Initialize the opp for later creation from CampaignMember
        Opportunity Opp = new Opportunity(CloseDate = Date.Today().addDays(30), AccountId = genericaccount.Id,
            Name='someopp', StageName='Selected' );
            
            mc1.Response_Status__c = 'Working';
            mc2.Response_Status__c = 'Disqualified';
            mc2.Disqualified_Reason__c = 'no budget';
             
            
            update cms;
            
            // We're checking CampaignMemberOpportunityInsertTrigger here
            Opp.admin_CMSourceId__c = mc2.Id;  // Set the source ID
            insert Opp;

            Test.StartTest();

            
            // Now let's do a lead convert
         Database.LeadConvert lc = new database.LeadConvert();
        lc.setLeadId(ld2.Id);
        lc.setConvertedStatus('Converted - Existing Opportunity');
        lc.setDoNotCreateOpportunity(true);
        lc.setOwnerId(UserInfo.getUserId());
        Database.LeadConvertResult lcr2 = Database.convertLead(lc);
            
              Test.StopTest();    
            try
            {
             }
            catch(Exception ex)
            {
              System.Debug('Exception during TestConversionsNoOpp StopTest (async error)' + ex.getMessage());
            }
     
         System.assert(lcr2.isSuccess());
            CampaignMember mc2b = [Select Id,Response_Status__c, Opportunity_Create_Date__c, Opportunity_Name__c, Buyer__c, User__c from CampaignMember where Id = :mc2.id];
        Lead convertedleadinfo = [Select Id, isConverted, Status from Lead where id = :ld2.Id];
        System.Debug('original leadid:' + ld2.Id + ' leadid result id:' + lcr2.getLeadId());
        System.Debug('Converted lead isconverted:' + convertedleadinfo.IsConverted + ' status:' + convertedleadinfo.Status);
           system.assertEquals('Converted - Existing Opportunity', mc2b.Response_Status__c);
     }
 }
Any help very much appreciated.



 
Hi,
  We have developed .NET Application & included it in Call center CTI Adapter Url . All the things are working well, when the call comes its searches phone field in objects , get the results & open the record in new tab in Service cloud console with the ANI no.  With standard all the things are working as expected.

But the issue we want to open our Custom VF page when the call comes instead of standard one.So created VF page & controller & that page is poping up instead of standard one. Now the main problem is we are not getting ANI no. neither in VF page nor in Controller .
1 ) We tried get ANI no. in Apex controller via url, host url, current url etc...but nothing is working.
2) In Vf page we tried to get via including interaction.js file & using its methods , but those methods are not getting called on page load.

Has anyone face the same issue in using open CTI in salesforce?

 Can anyone please help me to fix this error.