• smiera
  • NEWBIE
  • 0 Points
  • Member since 2010
  • Smita Erande

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 4
    Replies

Hi,
I have a following requirement,
I am dispalying the custom object records with 'Accept' Button on each Record inside' PageblockTable' .And doing the pagination with the available records.So here if user clicked on Accept button on 1st record ,it should get diasabled and remains diasabled even user will go back and fourth by doing Next and Previous. Here for binding the records I have used wrapper class and the record and buttons got binds as well.But Not able to maintained the Buttons diasability across the session.

Thanks In Advance.

Hi,

I have written one

 trigger {before insert, before update}

{

for(CustomObj__c t: Trigger.new)

{

system.debug('AutoID__c '+t.AutoID__c);

}

}

1. If I try to insert any record through UI , it will be possible to get the autonumber with the same trigger.

2.But if i try to run the data loader to insert any record ,its giving me 'Null' value.

   

So, i want the same trigger should work for Data loader as well.

Plz suggest some solution.

 

Thanks,

smi.

        

 

  • November 30, 2010
  • Like
  • 0
Getting following error when I try to login through java client failing at          connection = new EnterpriseConnection(config); Thanks in advance for the answer.

com.sforce.ws.ConnectionException: Failed to create object
    at com.sforce.ws.bind.TypeMapper.readSingle(TypeMapper.java:677)
    at com.sforce.ws.bind.TypeMapper.readObject(TypeMapper.java:556)
    at com.sforce.soap.enterprise.LoginResponse_element.setResult(LoginResponse_element.java:38)
    at com.sforce.soap.enterprise.LoginResponse_element.loadFields(LoginResponse_element.java:69)
    at com.sforce.soap.enterprise.LoginResponse_element.load(LoginResponse_element.java:63)
    at com.sforce.ws.bind.TypeMapper.readSingle(TypeMapper.java:674)
    at com.sforce.ws.bind.TypeMapper.readObject(TypeMapper.java:556)
    at com.sforce.ws.transport.SoapConnection.bind(SoapConnection.java:180)
    at com.sforce.ws.transport.SoapConnection.receive(SoapConnection.java:154)
    at com.sforce.ws.transport.SoapConnection.send(SoapConnection.java:99)
    at com.sforce.soap.enterprise.EnterpriseConnection.login(EnterpriseConnection.java:1097)
    at com.sforce.soap.enterprise.EnterpriseConnection.<init>(EnterpriseConnection.java:387)
    at com.orangelake.tourmanifest.client.QuickstartApiSample.login(abc.java:93)
    at com.orangelake.tourmanifest.client.QuickstartApiSample.run(abc.java:47)
    at com.orangelake.tourmanifest.client.QuickstartApiSample.main(abc.java:42)
Caused by: java.lang.InstantiationException: com.sforce.soap.enterprise.LoginResult
    at java.lang.Class.newInstance(Unknown Source)
    at com.sforce.ws.bind.TypeMapper.readSingle(TypeMapper.java:673)
    ... 14 more
Caused by: java.lang.NoSuchMethodException: com.sforce.soap.enterprise.LoginResult.<init>()
    at java.lang.Class.getConstructor0(Unknown Source)

Hi,

I am new the salesforce, so dont have much expertise on this subject. I was trying to create a app/portal for loan processing.
and I want below finctionalities on this :-

1. user registration and generate user id and password
2. Login to user accoung and Request loan
3. It will go first level approver anf then 2nd level
4. once approved it will be notified to user.

can you please guide how I can achive this ? I mean how I can create multiple users and assign role to test this apps functionalities

Hello!
I'm new to apex, please advise.
I have created the trigger that create child record based on parent field value. And I need to start this process avaery day at once for all records. So i write the batch process which search for all records where conditions are met, and set the checkbox to true if it does.
And the problem is when the batch process completes the trigger doesn't fire at all. In the Apex Jobs found error: Error Message
Below my trigger and batch processes:
Batch:
global class ITAssetProessingBatch implements Database.Batchable<sobject>{
  global String [] email = new String[] {'VBakanov@bcsprime.com'};
  
  //Start Method
  global Database.Querylocator start (Database.BatchableContext BC) {
    return Database.getQueryLocator('SELECT id, Name, FirstDateOfMonth__c, FrstDayOfMnth__c, Status__c FROM IT_Asset__c WHERE FirstDateOfMonth__c = today AND Status__c = \'Activated\' AND FrstDayOfMnth__c = false');//Query which will be determine the scope of Records fetching the same
  }

  //Execute method
  global void execute (Database.BatchableContext BC, List<sobject> scope) {
    List<IT_Asset__c> ITAList = new List<IT_Asset__c>();
    List<IT_Asset__c> updtaedITAList = new List<IT_Asset__c>();
    for (sObject objScope: scope) { 
        IT_Asset__c newObjScope = (IT_Asset__c)objScope ;
        newObjScope.FrstDayOfMnth__c = true;
        updtaedITAList.add(newObjScope);
        System.debug('Value of UpdatedITAList'+updtaedITAList);
    } 
        if (updtaedITAList != null && updtaedITAList.size()>0) {
            Database.update(updtaedITAList); System.debug('List Size '+updtaedITAList.size());
        }
  }
    
//Finish Method
  global void finish(Database.BatchableContext BC){
  Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();

  //Below code will fetch the job Id
  AsyncApexJob a = [Select a.TotalJobItems, a.Status, a.NumberOfErrors, a.JobType, a.JobItemsProcessed, a.ExtendedStatus, a.CreatedById, a.CompletedDate From AsyncApexJob a WHERE id = :BC.getJobId()];//get the job Id
  System.debug('$$$ Jobid is'+BC.getJobId());

  //below code will send an email to User about the status
  mail.setToAddresses(email);
  mail.setReplyTo('VBakanov@bcsprime.com');
  mail.setSenderDisplayName('Apex Batch Processing Module');
  mail.setSubject('Batch Processing '+a.Status);
  mail.setPlainTextBody('The Batch Apex job processed  '+a.TotalJobItems+'batches with  '+a.NumberOfErrors+'failures'+'Job Item processed are'+a.JobItemsProcessed);
  Messaging.sendEmail(new Messaging.Singleemailmessage [] {mail});
  }
    //Scheduler Method to scedule the class
  global void execute(SchedulableContext sc)
    {
        ITAssetProessingBatch conInstance = new ITAssetProessingBatch();
        database.executebatch(conInstance,100);
    }
}
Trigger:
Trigger CashFlow on IT_Asset__c (after update)
{
         List<Cash_Flow__c> sub=new List<Cash_Flow__c>();
     for(IT_Asset__c it : Trigger.new)
     {
           if(it.FrstDayOfMnth__c == true)
           {
                   Cash_Flow__c cf=new Cash_Flow__c();
                   cf.CurrencyIsoCode=it.CurrencyIsoCode;
                   cf.Date__c=it.Start_Date__c;
               	   cf.RecordTypeId='012b0000000UOay';
                   cf.IT_Asset__c=it.Id;
                   //add other fields of subject here and add volunteer values in that.
                 
                   sub.add(cf);
            }
            if(sub.size()>0)
            insert sub;
     }
}

I deactivate the trigger and run batch and it completes without errors, so i think the problem in trigger.... Maybe I made something wrong?