• 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.
There is a button, when the document is loaded if username password are remembered then it automatically fires sign in button. The problem here is when somebody manually refreshes the page or page is redirected to some where else then that button click is firing. How can i stop that button click when a page is refreshed manually or redirected. 
Hi, we are using some Remote site settings in my org for establishing the connection. There is a checkbox named as Disable Protocol Security. What will happen if i unchecked that checkbox. I read those documents provided by salesforce, those are talking about some security implications. I didnt understood what are those, can anyone explain me what are those security implications.
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.
Hi we are using javascript remoting in visualforce pages. There is a method in javascript that is passing a password in encrypted form using btoa function. Then this data is recieving by one Apex method which is annotated by @remoteAction. But how i can decrypt that password in Apex. Please help in this.
<input id="pwd" name="pwd" placeholder="Password" type="password" value="abc123" aria-invalid="false" class="valid">
Password is showing in different places like network preserve log, inspect elements.
this is the situation which i am facing in inspect elements. How to hide the password element or value in DOM elements. Please help me in this
Hi There are List/Array of Jobids and List/Array of Technician ids. How to assign jobids to technician in round robin process and no technician should not get more than 5 jobids. How we do that logic. Please help me on this.
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
Hi,

There is a Login page implemented using visualforce pages. How to save Username and Password when user sets the check box as True. What is the best practice to follow ande where we can save those credentials. Please help me on this.
function add_Account(){
    var rtsize = sforce.connection.query("SELECT Id,Name FROM RecordType WHERE SobjectType='Account'"); 
    var records = rtsize.getArray("records");
    if(records.length > 0){
        window.open('/setup/ui/recordtypeselect.jsp?ent=Account&retURL=%2F001%2Fo&save_new_url=%2F001%2Fe%3FretURL%3D%252F001%252Fo', '_parent');
    } else {
        window.open('/001/e?retURL=%2F001%2Fo', '_parent'); }
}
there is a link on visual force page, when we click on that calls above javascript method. But it is not working, i dont know where i mistaken. Please help me
1. What is the best way to find Lead record based on Phone number.
2. I have a phone number, Based on phone number i need to search a record in salesforce(I dont know which object it is). After that if that record belongs to
    a. Contact it enters into first if loop
    b. Lead it enters into second if loop
    c. Account it enters into third if loop

What is the best way to achieve this. Please suggest me a solution.
 
@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.
I am using below code to navigate to different pages based on user is in lightning or classic. But every time return((typeof sforce != 'undefined') && sforce && (!!sforce.one)); is returning FALSE either in Lightning or Classic . Please help me in this
<apex:page >

<script type="text/javascript">

function isLightningExperienceOrSalesforce1(){
    return((typeof sforce != 'undefined') && sforce && (!!sforce.one)); 
}  
function popupwindow(){

        if( isLightningExperienceOrSalesforce1() ) {
            window.open('/apex/customLightningLookup');
        } else {
            window.open('/apex/testVFpage'); 
        }
     }
</script>

<apex:form > 
    <apex:commandButton value="Generate Report" onclick="popupwindow(this);"/>
</apex:form> 
</apex:page>

 
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.