• tulasi ram 1
  • NEWBIE
  • 0 Points
  • Member since 2018

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 15
    Questions
  • 8
    Replies
how can we know or display datetime based on timezone. I have a time zone id of timezone-x, then how can i display datetime using that timezone Id. Pls help me on this.
I am using below code
global static String updateContact(Contact objContact) {
        try{
            if(isContactUpdateable() || Test.isRunningTest()) {
                update objContact;
                return 'Contact updated successfully!';
            }
            else { return 'Insufficient access to update contact, please contact system admin for more information'; }
        }catch(Exception ex) { return '' + ex.getMessage(); }
    }

Unable to include catch block in code coverage. How can we include this catch blocks in code coverage.
I Have created a managed package, when i am trying to install that package in some other orgs like Dev/ Sandbox/ Produsction we are getting below popup. What is it i didnt understand.User-added image
How can i make those check boxes to be checked.
I am calling a method from a class which is a component of managed package. I am getting an error like below. But it is working fine in normal org.
User-added image
How we can reference variables and methods in managed package
@RemoteAction global static String createTask(String subject, String callID, String contactID, String phoneNumber) {
        try{
            if(!isTaskAccessible()) return 'Insufficient access to create Task, please contact system admin for more information';
            List<Task> lstTask = [SELECT Id FROM Task WHERE Call_Id__c =:callID AND OwnerId =:UserInfo.getUserId() LIMIT 1];
            Task objTask = lstTask.isEmpty() ? new Task(Subject = subject, Call_Id__c = callID, Nextiva_Call_Start__c = system.now(), 
                                                        Nextiva_Phone_Number1__c = phoneNumber, TaskSubtype = 'Call')
                                            : lstTask[0];
        /*    Id objId = contactID;
            String sObjName = objId.getSObjectType().getDescribe().getName();
            system.debug('=========Object name ======='+sObjName);
            if(sObjName == 'Contact' || sObjName == 'Lead'){
            objTask.WhoId = String.isEmpty(contactID) ? objTask.WhoId : contactID;
            } 
            else if(sObjName == 'Account') {
            objTask.WhatId = String.isEmpty(contactID) ? objTask.WhatId : contactID;
            List<account> acc = [select id, (select id from contacts) from account where id=:objId];
            for(account ac :acc){
               for(contact con: ac.contacts){              
               objTask.whoid = con.id;
               
               }                      
            }           
            }   else     objTask.WhatId = String.isEmpty(contactID) ? objTask.WhatId : contactID; */
            upsert objTask;
            return objTask.Id;
        }catch(Exception ex) { return '' + ex.getMessage(); }  
    }

If there is no contact id is found then it has to create a new task. If any contactId found it has to create a task with some WhatIds. Here if if condition fails then total try block is not working why i dont know. if no contactid found then it has to create an empty task. But it is not working. Please help me on this.


 
Hi I am using Custom settings in visualforce page. And i am creating a managed package included both visualforce pages and custom settings. After installing managed package in target org i am creating custom setting records in target org. But those records are not working why i dont know. please somebody help me on this.