• abhi_sfdc
  • NEWBIE
  • 5 Points
  • Member since 2012

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 8
    Questions
  • 4
    Replies
Hello Guys,

I have a requirment where i have to maintain the session id of the login user throughout the application.
From the org user could redirect to some external website and when he come back to his salesforce org it should not redirect him to salesforce login page instead his session should be maintain in salesforce.
Your help will be appreciated.
 
How to open a google spreadsheet on click of button? Can somone help on integration between salesforce and googlespreadsheet?
Hi, I have a requirment in which i have to create a user at the time of user login.
I found using SAML assertion we can achive this but i don't know how to implement this. Can someone help on this?

Can someone explain me what is the best way to transfer custom setting's data from one org to another org? Without dataloader is it possibel to transfer data?

While parsing a webserivce i am getting below erroe,

 

Error: Failed to parse wsdl: Unsupported Schema element found http://www.w3.org/2001/XMLSchema:attribute.
 
Can someone suggest the reason for it?
 
Thanks,
SFDC Guy

Hi All,

 

I am getting this error ("System.CalloutException: You have uncommitted work pending. Please commit or rollback before calling out") on one custom button(Delete) click in salesforce.

In below code  i am geting the records from two instances and trying to delete the selected record: 

 

public with sharing class testchkcnt{

    public List<Accountwrapper> accntlist{get; set;}
    public List<Case> caselist{get; set;}
    public List<Account> selectedaccount = new List<Account>();
    public List<Cse> cselist{get; set;}
    public String lname{get; set;}
    Boolean testval = false;
    Boolean testcase = false;
    public String testcaseid{get; set;}

    public Class Cse
    {
        public String CaseNumber{get; set;}
        public String Status{get; set;}
    }   
    
    public pageReference search(){
        List<Accountwrapper> accnt1 = new List<Accountwrapper>();
        List<Accountwrapper> accnt2 = new List<Accountwrapper>();
        accntlist = new List<Accountwrapper>();
        List<Account> accn = [Select Id, Name, Phone from Account where Name =: lname] ;
        for(Account a: accn ){
            accnt1.add(new Accountwrapper(a));
        }
        partnerSoapSforceCom.Soap myPartnerSoap = new partnerSoapSforceCom.Soap();
        partnerSoapSforceCom.LoginResult partnerLoginResult = myPartnerSoap.login('test123@xxx.com', '**********');
        soapSforceComSchemasClassAllacoutsdd.SessionHeader_element webserviceSessionHeader = new soapSforceComSchemasClassAllacoutsdd.SessionHeader_element();
        webserviceSessionHeader.sessionId = partnerLoginResult.sessionId;
          
            soapSforceComSchemasClassAllacoutsdd.allAcoutsDetails  stub = new soapSforceComSchemasClassAllacoutsdd.allAcoutsDetails();
            stub.SessionHeader = webserviceSessionHeader;
            List<Account> lst_Account = new List<Account>();
            if(stub.makeaccount(lname) != null){
            for(soapSforceComSchemasClassAllacoutsdd.response li: stub.makeaccount(lname)){
                
                    Account acn = new Account();
                    acn.Id = li.AccId;
                    acn.Name = li.AccName;
                    acn.Phone = li.PhoneNum;
                    lst_Account.add(acn);
                }
            }

            for(Account an: lst_Account){
                accnt2.add(new Accountwrapper(an));
            }
        accntlist.addall(accnt1);
        accntlist.addall(accnt2);       
        if(accntlist.size()>0)
            setHideshow(true);
        else
            setHideshow(false);
        
        return null;
    } 
        
    public Boolean gethideshowcase()
    {
        return this.testcase ;
    }
    public void sethideshowcase(boolean q)
    {
        this.testcase = q;
    }
    
       public Boolean getHideshow()
    {
        return this.testval;
    }
    public void setHideshow(boolean s)
    {
        this.testval = s;
    }

    public pageReference GetCaseDetails(){
        caselist = new List<Case>();
        string st = ApexPages.currentPage().getParameters().get('testcaseid');
        caselist  = [Select Id, CaseNumber, Status from Case where AccountId =: st];
        cselist = new List<Cse>();
        sethideshowcase(true);

        if(caselist.size() == 0){
            partnerSoapSforceCom.Soap myPartnerSoap = new partnerSoapSforceCom.Soap();
            partnerSoapSforceCom.LoginResult partnerLoginResult = myPartnerSoap.login('test123@xxx.com', '*********');
            soapSforceComSchemasClassAllacoutsdd.SessionHeader_element webserviceSessionHeader = new soapSforceComSchemasClassAllacoutsdd.SessionHeader_element();
            webserviceSessionHeader.sessionId = partnerLoginResult.sessionId;
            
            soapSforceComSchemasClassAllacoutsdd.allAcoutsDetails  stub = new soapSforceComSchemasClassAllacoutsdd.allAcoutsDetails();
            stub.SessionHeader = webserviceSessionHeader;          
            for(soapSforceComSchemasClassAllacoutsdd.response lis: stub.allcasedetails(st)){
                Cse cs = new Cse();
                cs.CaseNumber = lis.cnumb;
                cs.Status = lis.Casestate;
                cselist.add(cs);
            }  
        }
        else
            {
            System.debug('Entering...');
                for(Case c: caselist)
                {
                    Cse cs = new Cse();
                    cs.CaseNumber = c.CaseNumber;
                    cs.Status = c.Status;
                    cselist.add(cs);
                }
            }
        if(cselist.size()==0)
            sethideshowcase(false);
        return null;
        }
   
    public pageReference deleteaccount(){
        List<Account> selAccounts=GetSelectedAccounts();
        List<Account> act_del = new List<Account>();
        if(selAccounts.size()>0){
            for(Integer j=0; j<selAccounts.size(); j++){
                act_del.add(selAccounts[j]);
            }
           delete act_del; 
            
        }
        return search();           
    }
    
    public List<Account> GetSelectedAccounts(){
        if(selectedaccount.size()>0){
            system.debug('##########' + selectedaccount);
            return selectedaccount ;  
        }     
        else{
            return null;
        }
    }
    
   public pageReference GetSelected(){
        selectedaccount.clear();
        system.debug('testingggggggggg');
        system.debug('abhi@@@@@@@' + accntlist);
        for(Accountwrapper accwrapper: accntlist)           
            if(accwrapper.selected == true)
                selectedaccount.add(accwrapper.acc);
        return null;
    }
     
    public class Accountwrapper{
        public Account acc{get; set;}
        public Boolean selected{get; set;}
        public Accountwrapper(Account a){
            acc = a;
            selected = false;
        }
    }    
}

 

Can someone help me how to resolve this issue?

 

Can i use action and onclick attribute on command line apex component together?

Can anyone give me some examples?

 

 

Hi Guys,

 

I am new in salesforce. I want to write a visualforce page which should display all the existing account records and page should also show a new button for creating new account records. While clicking on the new button new VF page having some account fields show with save button on new VF page.

 

can we achieve this functionality? please hepl!!

Hello Team,
Greetings,
I've created a class Employee with (empName,Salary,exp) and was trying to get the result in the VF page. 

public class ClassEmployee
{
    public string EmpName {set; get;}
    public Integer EmpSalary {set; get;}
    public Integer EmpExperience {set; get;} 
    public ClassEmployee()
    {
        EmpName = 'John';
        EmpSalary= 10000;
        EmpExperience = 2;
    }

}

<apex:page controller='ClassEmployee'>
    {!.EmpName}
    {!.EmpSalary}
    {!.EmpExperience}    
</apex:page>


As soon as i save and hit preview, i get the error 
"You have uncommitted changes to this VisualForce page. This preview will show the most recently committed version of this page, not your current changes." and the result of the preview is 

User-added image

User-added image

I would like suggestions on hot to get rid of the error. Not sure why the error keeps popping up even though the page is saved

 
HI Guys ,
 I need to understand few things regarding Execution Rule 
  
As per I understand below is Order
System Validation 
Before Trigger
Custom Validation 

When we are saying system validation is this only Layout Specific(Like made field required on layout) System validation  or including Validation lets we have mad field required during its creation ?

I was trying few thing like i created a field and made it required through before Trigger and Then Made it Blank again in after trigger so record is saving properly but when i made field required during field creation and i am trying to make it blank in after trigger then it is throwing error required field missing although system validation happens  before  after trigger .

Can anybody please explain ?

Regards,
Rajesh
Hello All,

Can someone help me in achieving the below requirement

I have a field (Which is a master -detail) and i want this field to be not visible in creation page (which is a vf page), but on saving the record it should be visible(Standard detail page)

Thanks in advance
  • May 07, 2017
  • Like
  • 0

While parsing a webserivce i am getting below erroe,

 

Error: Failed to parse wsdl: Unsupported Schema element found http://www.w3.org/2001/XMLSchema:attribute.
 
Can someone suggest the reason for it?
 
Thanks,
SFDC Guy