• Ridhi Agarwal
  • NEWBIE
  • 5 Points
  • Member since 2015

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

i have a code but its not calling my parameterised constructor. I tried printing hi in my first line of constructor and its not printing that Please guide. my trigger code is 

trigger RevenueScheduleTrigger on Revenue_Schedule__c (after insert, after update) {
         List<Revenue_Schedule__c> revs = new List<Revenue_Schedule__c>();
          for (Integer i=0;i<Trigger.new.size();i++){

                revs.add(Trigger.new[i]); 
         }                                              
                  system.debug('Rev sheds are'+revs);                   
        if(revs != null && revs.size() > 0){
            RevenueSchedulerSplitBatch sp = new RevenueSchedulerSplitBatch(revs);
            Database.executeBatch(sp,1);
        }
}

and a part of my batch class is :

global class RevenueSchedulerSplitBatch implements Database.Batchable<sObject>{
    global static List<Rev_Schedule_Split__c> splits = new List<Rev_Schedule_Split__c>();
    global static List<Rev_Schedule_Split__c> toDeleteSplits = new List<Rev_Schedule_Split__c>();
    global static List<sObject> revs = new List<sObject>();

    global RevenueSchedulerSplitBatch(List<sObject> RevSched){
    system.debug('hi');
    revs = RevSched;
    system.debug('Revenue shed from trigger are:'+ RevSched);
    }
                                                     
    global Database.QueryLocator start(Database.BatchableContext bc){
        system.debug('Rev shed are' + revs);                                
        return Database.getQueryLocator([Select Id, Schedule_Date__c,Revenue_LC__c, Revenue_USD__c, Split_Percent_2__c, Split_Percent_3__c,Sales_Rep_1__c,Sales_Rep_2__c,Sales_Rep_3__c
                                         From Revenue_Schedule__c WHERE id IN : revs]); 
                                                                          
    }
    
      global void execute(Database.BatchableContext bc, List<Revenue_Schedule__c> spl){
             for (Rev_Schedule_Split__c rs : [SELECT Id, Revenue_Schedule__c FROM Rev_Schedule_Split__c 
                                                     WHERE Revenue_Schedule__c IN : revs]) 
                 {
                    toDeleteSplits.add(rs);                                       
                 }            
}

Any advise will be of great help. thanks
 

i have a code but its not calling my parameterised constructor. I tried printing hi in my first line of constructor and its not printing that Please guide. my trigger code is 

trigger RevenueScheduleTrigger on Revenue_Schedule__c (after insert, after update) {
         List<Revenue_Schedule__c> revs = new List<Revenue_Schedule__c>();
          for (Integer i=0;i<Trigger.new.size();i++){

                revs.add(Trigger.new[i]); 
         }                                              
                  system.debug('Rev sheds are'+revs);                   
        if(revs != null && revs.size() > 0){
            RevenueSchedulerSplitBatch sp = new RevenueSchedulerSplitBatch(revs);
            Database.executeBatch(sp,1);
        }
}

and a part of my batch class is :

global class RevenueSchedulerSplitBatch implements Database.Batchable<sObject>{
    global static List<Rev_Schedule_Split__c> splits = new List<Rev_Schedule_Split__c>();
    global static List<Rev_Schedule_Split__c> toDeleteSplits = new List<Rev_Schedule_Split__c>();
    global static List<sObject> revs = new List<sObject>();

    global RevenueSchedulerSplitBatch(List<sObject> RevSched){
    system.debug('hi');
    revs = RevSched;
    system.debug('Revenue shed from trigger are:'+ RevSched);
    }
                                                     
    global Database.QueryLocator start(Database.BatchableContext bc){
        system.debug('Rev shed are' + revs);                                
        return Database.getQueryLocator([Select Id, Schedule_Date__c,Revenue_LC__c, Revenue_USD__c, Split_Percent_2__c, Split_Percent_3__c,Sales_Rep_1__c,Sales_Rep_2__c,Sales_Rep_3__c
                                         From Revenue_Schedule__c WHERE id IN : revs]); 
                                                                          
    }
    
      global void execute(Database.BatchableContext bc, List<Revenue_Schedule__c> spl){
             for (Rev_Schedule_Split__c rs : [SELECT Id, Revenue_Schedule__c FROM Rev_Schedule_Split__c 
                                                     WHERE Revenue_Schedule__c IN : revs]) 
                 {
                    toDeleteSplits.add(rs);                                       
                 }            
}

Any advise will be of great help. thanks
 
Hi All,

DId not find a similar question in the past so here it goes:
We have created a custom clone functionality. What this does is clone the record, empty some fields, update the parents, and then inserts the record in the database. Afterwards the page is redirected to the edit page of the record.

However, the standard Salesforce Edit detail record page has a cancel button. This cancel button just directs to the ?retURL paramters. So it will go back the to detail view. 

Because we performed the clone and we needed to insert this cloned record into the DB before redirecting to the Edit page, the record will not be 'cancelled' in the way of cancellation the entire clone. So the record must be deleted again.

Is there a way to capture the Cancel event? Or to redirect the page to the edit detail view of the record without inserting it into the DB? So then the user can still Click on Save and we have the requisted functionality. 

Thanks,
Robin 
  • September 11, 2014
  • Like
  • 1

I am creating a visualforce page that needs to display a block section with 4 equal width columns.  The issue I have is figuring out how to define each of the columns so they are the same width (the last two columns are much smaller compared to the first three).

 

Here is my code:

<apex:page standardController="Product_Brief__c">

    <apex:pageBlock >
        <apex:pageBlockSection columns="4">
            <apex:pageblocksectionItem ><b><center> Type 1 </center></b></apex:pageblocksectionItem>
            <apex:pageblocksectionItem ><b><center> Type 2 </center></b></apex:pageblocksectionItem>
            <apex:pageblocksectionItem ><b><center> Type 3 </center></b></apex:pageblocksectionItem>
            <apex:pageblocksectionItem ><b><center> Type 4 </center></b></apex:pageblocksectionItem>
            
            <apex:pageblocksectionItem > <apex:image url="/resource/Mix" width="100" height="100"/> </apex:pageblocksectionItem>
            <apex:pageblocksectionItem > <apex:image url="/resource/SUB1" width="100" height="100"/> </apex:pageblocksectionItem>
            <apex:pageblocksectionItem > <apex:image url="/resource/TL1" width="100" height="100"/> </apex:pageblocksectionItem>
            <apex:pageblocksectionItem > <apex:image url="/resource/SUM1" width="100" height="100"/> </apex:pageblocksectionItem>

            <apex:pageBlockSectionItem ><b> 1 - 20L Labtainer</b>    BPC's are placed in 2 plastic liners and packaged into (Company Name) branded carboard totes boxes </apex:pageBlockSectionItem>
            <apex:pageBlockSectionItem ><b> 1 - 20L Labtainer</b>    BPC's are placed in 2 plastic liners and packaged into (Company Name) branded carboard totes boxes</apex:pageBlockSectionItem>
            <apex:pageBlockSectionItem ><b> 1 - 20L Labtainer</b>    BPC's are placed in 2 plastic liners and packaged into (Company Name) branded carboard totes boxes</apex:pageBlockSectionItem>
            <apex:pageBlockSectionItem ><b> 1 - 20L Labtainer</b>    BPC's are placed in 2 plastic liners and packaged into (Company Name) branded carboard totes boxes</apex:pageBlockSectionItem>
                    
            <apex:pageBlockSectionItem ></apex:pageBlockSectionItem>
            <apex:pageBlockSectionItem ></apex:pageBlockSectionItem>
            <apex:pageBlockSectionItem ></apex:pageBlockSectionItem>
            <apex:pageBlockSectionItem ></apex:pageBlockSectionItem>
            
        
        </apex:pageBlockSection>
          
    </apex:pageBlock> 

</apex:page>

 Thanks in advance! :-)

Hi

 

I'm trying to increase the width of the columns but am not able to make it happen.

I tried both width on the pageBlockTable and on the column but nothing works.

 

What am I doing wrong?

 

 

	                    <apex:pageBlockSection title="Pending Orders">
		                    <apex:form >        
		                        <apex:pageBlockTable width="80%" value="{!mySearchResults}" var="entry">
		                            <apex:column headerValue="Select"> 
		                                <apex:inputCheckbox id="checkedone" value="{!entry.isSelected}"/>
		                                <apex:actionSupport event="onclick" />
		                            </apex:column>
		                            <apex:column value="{!entry.libTitle.Type__c}" headerValue="Type"/>
		                            <apex:column width="500px" value="{!entry.libTitle.Name}" headerValue="Name"/> 
		                            <apex:column value="{!entry.authors}" headerValue="Autors"/> 
		                            <apex:column width="5000px" value="{!entry.libTitle.Abstract__c}" headerValue="Abstract"/> 
		                            <apex:column value="{!entry.libTitle.Publication__c}" headerValue="Publication"/>
		                            <apex:column value="{!entry.libTitle.Publish_Date__c}" headerValue="Publish Date"/>
		                        </apex:pageBlockTable>
		                    </apex:form>                     
	                    </apex:pageBlockSection>
					</apex:pageBlock>

 

Thanks