• tarun jain 110
  • NEWBIE
  • -1 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 15
    Questions
  • 16
    Replies
Hi,
live chat transcript object doesn't  created on refreshing the tab even after click on save pop up too.

As, this scenario is occur when agent id doing chat with visitor and then refresh the tab after that press end chat button and click save button on pop up. Chat transcript record does not created.

Please help me out.

​Thanks
Hi,
I want to save value in custom field through controller in custom field of case when agent save the chat or create/save case in live agent console chat. 

Is here any event on which I can bind my value on that field ? Please help

Thanks in advance
Hi,

I created a after insert and after update trigger. On after insert trigger i call the static methd with @ future(callout=true) and perform callout on completion or when we get success I update the same object. when on after update is fired I call same function then I go the error of " Future method cannot be called from a future " Error.

Basically, I want to call update trigger from after insert trigger and in both the cases callout function perform. Is this possible or not ?. If yes then please tell me how resolve this error.

Thanks
Hi,
I want to know what is the flow of object like Home, Activities, Campaigns, Leads, Accounts, Contacts, Notes, Opportunities, Quotes, Forecasts,
Cases, Contracts, Orders, Products, Price Books, Partners, Assets and Chatter.

What is the use of these object and in which scenario we need to created them ?
What is the flow of object ?. If this can be explain with the example then it will be superb.

I already see this https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_erd_majors.htm link also but i still don't know how we can use and what is the flow of standard object ?

Thanks
 
Hi,
I want to create button on custom object aUser-added images per below image how i create button on highlight view please show example
Hi,
Is there any plan for use group by property in the charts of dashboard.
In below image i can't able to use group by property please suggest me. How can i used this property provide some exapmle.
User-added image

As this property in disable how can i used this property.
Thanks
 
Hi,

I want to know that for publishing the free app on App Exchange do we need to purchase any licence account or do we simply publish the app through the free developer account?

Further, I want to know why or in what circumstances we need to purchase licence?

Moreover if we have a salesforce free developer account can we publish the app on app exchange and submit the
app for security review?  Is there any issue regarding the same?

Thanks
Hi,
Can we send Duplicate Rule with package or can we create duplicate rule through apex class. ? If yes provide the steps and code.

Thanks
Hi,
I want to check is there any duplicate rule associate with particular object or not in apex class

Please provide the code if we check any exist duplicate rule with custom object
Hi,

I want to create button on standard page as show in image(Red color). If this is possible then provide me steps with some example.

Thanks
User-added image
I want to access the function of first class in to another class

public with sharing class HelperClass {
public void helperMethod()
{
CustomObject__c acct = new CustomObject__c();
           acct.Name = 'test';
            insert acct;
}
}

public with sharing class MainClass {
private HelperClass helper = new HelperClass();
helper.helperMethod();
}


Please provide answer of above problem i want to do same thing as shown in above classes 
 Error: Compile Error: Method must define a body 

 
Hi,
I want to make below table through apex class and show some custom data.
I need code for making exact table for showing data.User-added image
Hi,
I want to copy all accounts record in custom object. How can we copy all record in the custom object. Please provide apex class code.

Thanks
<apex:page controller="Checkbox_Class" Tabstyle="Account">
<apex:form>
<apex:pageBlock Title="Accounts with CheckBoxes"> <apex:pageBlockSection Title="List of Available Accounts">
<apex:dataTable value="{!accounts}" var="a" columnswidth="50px,50px" cellpadding="4" border="1">
<apex:column >
<apex:facet name="header">
<apex:inputCheckbox >
<apex:actionSupport event="onclick" action="{!GetSelected}" onsubmit="checkAll(this)" rerender="Selected_PBS"/> </apex:inputCheckbox></apex:facet> <apex:inputCheckbox value="{!a.selected}" id="checkedone"> <apex:actionSupport event="onclick" action="{!GetSelected}" rerender="Selected_PBS"/> </apex:inputCheckbox></apex:column> <apex:column headervalue="Account Name" value="{!a.acc.Name}" /> <apex:column headervalue="Account Number" value="{!a.acc.AccountNumber}" />
<apex:column headervalue="Phone" value="{!a.acc.Phone}" />
</apex:dataTable> </apex:pageBlockSection>
<apex:pageBlockSection Title="Selected Accounts" id="Selected_PBS"> <apex:dataTable value="{!SelectedAccounts}" var="s" columnswidth="50px,50px" cellpadding="4" border="1">
<apex:column headervalue="Account Name" value="{!s.Name}" />
<apex:column headervalue="Account Number" value="{!s.AccountNumber}" />
<apex:column headervalue="Phone" value="{!s.Phone}" />
</apex:dataTable> </apex:pageBlockSection> </apex:pageBlock>
</apex:form>
<script> function checkAll(cb) {
var inputElem = document.getElementsByTagName("input");
for(var i=0; i<inputElem.length; i++)
{ if(inputElem[i].id.indexOf("checkedone")!=-1) inputElem[i].checked = cb.checked; }
} </script>
</apex:page>

Controller

public class Checkbox_Class {
 List<accountwrapper> accountList = new List<accountwrapper>();
List<Account> selectedAccounts = new List<Account>();
public List<accountwrapper> getAccounts()
{
for(Account a : [select Id, Name, AccountNumber, Phone from Account limit 5])
accountList.add(new accountwrapper(a));
return accountList; }
public PageReference getSelected() {
selectedAccounts.clear();
for(accountwrapper accwrapper : accountList)
if(accwrapper.selected == true)
selectedAccounts.add(accwrapper.acc);
return null; }
public List<Account> GetSelectedAccounts()
{ if(selectedAccounts.size()>0)
return selectedAccounts;
else return null;
} public class accountwrapper
{
public Account acc{get; set;}
public Boolean selected {get; set;}
public accountwrapper(Account a)
{
acc = a; selected = false;
} } }
Hi, i am facing issue in remote site setting.Please provide solution.

Error: Compile Error: Method does not exist or incorrect signature: [MetadataService.MetadataPort].create(List<MetadataService.Metadata>) 


public static void createRemoteSiteSettings()
{   
    MetadataService.MetadataPort service = createService();
    MetadataService.RemoteSiteSetting remoteSiteSettings = new MetadataService.RemoteSiteSetting();
    remoteSiteSettings.fullName = 'Test12345';
    remoteSiteSettings.url = 'http://www.google.com';
    remoteSiteSettings.description='ewf';
    remoteSiteSettings.isActive=true;
    remoteSiteSettings.disableProtocolSecurity=false;
    MetadataService.AsyncResult[] results = service.create(new List<MetadataService.Metadata> { remoteSiteSettings });
    MetadataService.AsyncResult[] checkResults = service.checkStatus(new List<string> {string.ValueOf(results[0].Id)});
    system.debug('chk' + checkResults );
}

 public static MetadataService.MetadataPort createService()
{
    MetadataService.MetadataPort service = new MetadataService.MetadataPort();
    service.SessionHeader = new MetadataService.SessionHeader_element();
    service.SessionHeader.sessionId = UserInfo.getSessionId();
    return service;
}
Hi All,

Please help with the following trigger. The trigger is used to prevent creation of more than 2 receipts per opportunity with the exception for one profile ( Accounts). Now if I am trying to add another profile to the trigger for excemtion, but I am not getting code coverage. Please help with possible solution.

trigger Receiptt on Invoice__c(before insert) {
    ReceiptRestiction__c ua = ReceiptRestiction__c.getInstance (userinfo.getUserId());
    if (ua.Active__c) {
        set<id> Opportunity = new set<id>();
        Profile adminId = [SELECT Id from Profile where Name='Accounts' LIMIT 1]; //First profile
        profile adminId1 =[SELECT Id from Profile where Name='System Administrator' LIMIT 1]; //Second Profile
        //&&Userinfo.getProfileId() !=adminId1.id&&UserInfo.getProfileId() !=adminId1.Id
        
        if((trigger.isBefore && trigger.isInsert) && UserInfo.getProfileId() != adminId.Id&&Userinfo.getProfileId() !=adminId1.id){
            for(Invoice__c i: Trigger.new){
                Opportunity.add(i.Opportunity1__c);
            
            List<Invoice__c> lstBatAlt =[select id,Opportunity1__c,Name 
                                         from Invoice__c
                                         where Opportunity1__c IN:Opportunity and Opportunity1__r.recordType.developerName != 'Concierge' ];
                
            if(lstBatAlt.size()>1){
                i.addError('You cannot create more than two receipts for opportunity');
            }
        } 
         }
    }

Regards
Srikanth
Hi,

I created a after insert and after update trigger. On after insert trigger i call the static methd with @ future(callout=true) and perform callout on completion or when we get success I update the same object. when on after update is fired I call same function then I go the error of " Future method cannot be called from a future " Error.

Basically, I want to call update trigger from after insert trigger and in both the cases callout function perform. Is this possible or not ?. If yes then please tell me how resolve this error.

Thanks
Hi,

I want to know that for publishing the free app on App Exchange do we need to purchase any licence account or do we simply publish the app through the free developer account?

Further, I want to know why or in what circumstances we need to purchase licence?

Moreover if we have a salesforce free developer account can we publish the app on app exchange and submit the
app for security review?  Is there any issue regarding the same?

Thanks
Hi,

I want to create button on standard page as show in image(Red color). If this is possible then provide me steps with some example.

Thanks
User-added image
I want to access the function of first class in to another class

public with sharing class HelperClass {
public void helperMethod()
{
CustomObject__c acct = new CustomObject__c();
           acct.Name = 'test';
            insert acct;
}
}

public with sharing class MainClass {
private HelperClass helper = new HelperClass();
helper.helperMethod();
}


Please provide answer of above problem i want to do same thing as shown in above classes 
 Error: Compile Error: Method must define a body 

 
Hi,
I want to make below table through apex class and show some custom data.
I need code for making exact table for showing data.User-added image
Hi,
I want to copy all accounts record in custom object. How can we copy all record in the custom object. Please provide apex class code.

Thanks
<apex:page controller="Checkbox_Class" Tabstyle="Account">
<apex:form>
<apex:pageBlock Title="Accounts with CheckBoxes"> <apex:pageBlockSection Title="List of Available Accounts">
<apex:dataTable value="{!accounts}" var="a" columnswidth="50px,50px" cellpadding="4" border="1">
<apex:column >
<apex:facet name="header">
<apex:inputCheckbox >
<apex:actionSupport event="onclick" action="{!GetSelected}" onsubmit="checkAll(this)" rerender="Selected_PBS"/> </apex:inputCheckbox></apex:facet> <apex:inputCheckbox value="{!a.selected}" id="checkedone"> <apex:actionSupport event="onclick" action="{!GetSelected}" rerender="Selected_PBS"/> </apex:inputCheckbox></apex:column> <apex:column headervalue="Account Name" value="{!a.acc.Name}" /> <apex:column headervalue="Account Number" value="{!a.acc.AccountNumber}" />
<apex:column headervalue="Phone" value="{!a.acc.Phone}" />
</apex:dataTable> </apex:pageBlockSection>
<apex:pageBlockSection Title="Selected Accounts" id="Selected_PBS"> <apex:dataTable value="{!SelectedAccounts}" var="s" columnswidth="50px,50px" cellpadding="4" border="1">
<apex:column headervalue="Account Name" value="{!s.Name}" />
<apex:column headervalue="Account Number" value="{!s.AccountNumber}" />
<apex:column headervalue="Phone" value="{!s.Phone}" />
</apex:dataTable> </apex:pageBlockSection> </apex:pageBlock>
</apex:form>
<script> function checkAll(cb) {
var inputElem = document.getElementsByTagName("input");
for(var i=0; i<inputElem.length; i++)
{ if(inputElem[i].id.indexOf("checkedone")!=-1) inputElem[i].checked = cb.checked; }
} </script>
</apex:page>

Controller

public class Checkbox_Class {
 List<accountwrapper> accountList = new List<accountwrapper>();
List<Account> selectedAccounts = new List<Account>();
public List<accountwrapper> getAccounts()
{
for(Account a : [select Id, Name, AccountNumber, Phone from Account limit 5])
accountList.add(new accountwrapper(a));
return accountList; }
public PageReference getSelected() {
selectedAccounts.clear();
for(accountwrapper accwrapper : accountList)
if(accwrapper.selected == true)
selectedAccounts.add(accwrapper.acc);
return null; }
public List<Account> GetSelectedAccounts()
{ if(selectedAccounts.size()>0)
return selectedAccounts;
else return null;
} public class accountwrapper
{
public Account acc{get; set;}
public Boolean selected {get; set;}
public accountwrapper(Account a)
{
acc = a; selected = false;
} } }
Code is here :

global without sharing class PostInstallClass implements InstallHandler {
    global void onInstall(InstallContext context) {    
               
        User u = [Select Id, Email,name from User where Id =:context.installerID()];   
        List<String> toAddresses = new list<String>();
        toAddresses.add(u.Email);        
        Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
        mail.setToAddresses(toAddresses);
        mail.setReplyTo('vishnukumarramawat@gmail.com');
        mail.setSenderDisplayName('My Package Support');
        mail.setSubject('Package install successful');
        mail.setPlainTextBody('Thanks for installing the package.');
        Messaging.sendEmail(new Messaging.Email[] { mail });
        
        //Send mail to developer whenever new user install it
        toAddresses = new list<String>();
        toAddresses.add('vishnukumarramawat@gmail.com');        
        mail = new Messaging.SingleEmailMessage();
        mail.setToAddresses(toAddresses);
        mail.setReplyTo(u.Email);
        mail.setSenderDisplayName('Twins Package installed');
        mail.setSubject('New user install successful');
        mail.setPlainTextBody('Username : '+u.name + '\n' +'Email : ' + u.email);
        Messaging.sendEmail(new Messaging.Email[] { mail });
    }   
}