• minkesh
  • NEWBIE
  • 115 Points
  • Member since 2011

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

Hi All, I have met a problem and have no idea how to handle it. Here is the situation: I need to write a SOQL sentence like "SELECT field1 FROM object1" but in my case I don't know the value of fields1 in the first place. There is a string to hold the value. How can write the SOQL sentence to use this string value. Thanks

Hello Folks,

 

I hope you all are doing well.

I stuck into one problem. Please Help me to get out of this.

Here is the problem.

 

I have written page and Controller.

 

Her is the code of VF Page :- 

     <table border="1" cellspacing="0" cellpadding="0" width="40%">
            <tr>
                <td > 
                    <b><apex:outputLabel value="Staff,managed by " >{!$User.FirstName} {!$User.LastName}</apex:outputLabel></b>
                </td>
                <td >
                    <b><apex:outputLabel value="Role" /></b> 
                </td>
                <td >
                    <b><apex:outputLabel value="Monthly Salary" /></b> 
                </td>
                <td>
                    <table width="300px;">
                        <tr>
                            <apex:repeat value="{!projectWrapListForHeader}" var="projectHeader" >
                               <td width="180px;">
                                   <apex:outputText value="{!projectHeader.projectRec.Name}" />
                               </td>                
                            </apex:repeat>
                        </tr>
                        <tr>
                            <apex:repeat value="{!projectWrapListForHeader}" var="projectHeader" >
                                <apex:repeat value="{!projectHeader.balanceWrap}" var="bal">
                                    <td width="180px;">
                                         <apex:outputText value="{!bal.balance.Name}"/>
                                    </td>
                                </apex:repeat>
                            </apex:repeat>
                        </tr>
                    </table>
                </td>
            </tr>
            <apex:repeat value="{!staffWrapList}" var="staffVar">
                <tr>
                
                    <td>
                        <apex:outputText >{!staffVar.staff.name}</apex:outputText>
                    </td>
                    <td>
                        <apex:outputText >{!staffVar.staff.Role__c}</apex:outputText>
                    </td>
                    <td>
                        <apex:outputText >{!staffVar.staff.Monthly_Salary_2__c}</apex:outputText>
                    </td>
                    <td>
                        <table width="300px;">
                            <tr>
                                <apex:repeat value="{!ProjectWrapListForHeader}" var="projectHeader1" >
                                   <td width="180px;">
                                   </td>                
                                </apex:repeat>
                            </tr>
                            <tr>
                                <apex:repeat value="{!staffVar.projectWrap}" var="projectHeader" >
                                    <apex:repeat value="{!projectHeader.balanceWrap}" var="ta">
                                        <td width="180px;">
                                           <apex:repeat value="{!ta.timeAllocationList}" var="tal">
                                             <apex:inputText value="{!tal.Percent__c}"/>
                                           </apex:repeat>
<!--                                        <apex:inputText value="{!ta.Percent__c}"/>-->
                                        </td>
                                    </apex:repeat>
                                </apex:repeat>
 

 Here is my controller :-

 

Wrapper class   

public class StaffWrapperClass
    { 
        public Staff__c staff{get;set;}
        public List<ProjectWrapperClass> projectWrap {get;set;}
        public List<Double> percent{get;set;}
        public StaffWrapperClass(){
          staff = new Staff__c();
          projectWrap = new List<ProjectWrapperClass>();
          percent = new List<Double>();
      }
    }
    
   public class ProjectWrapperClass{
        public Project__c projectRec {get;set;} 
        //public List<Balance__c> balance{get;set;}
        public List<BalanceTimeWrapper> balanceWrap{get;set;}
        public ProjectWrapperClass(){
          projectRec = new Project__c();
          //balance = new List<Balance__c>();
          balanceWrap = new List<BalanceTimeWrapper>();
        }
   }
   
   public class BalanceTimeWrapper{
       public Balance__c balance{get;set;}
       //public Time_Allocation__c timeAllocation{get;set;}
       public List<Time_Allocation__c> timeAllocationList{get;set;}
       public BalanceTimeWrapper(){
         balance = new Balance__c();
         //timeAllocation = new Time_Allocation__c();
         timeAllocationList = new List<Time_Allocation__c>();
       }
   }

 

 

 When I clicked on save I want to create seperate time allocation object record.
It is creating record but overriding the last rows text box value.

 

Where i am making mistake ?

 

TIme Allocation Object Stricture :- Balance__c Lookup,Staff LookUp and Percent field which is Text box. So in above case it should generate six records of time allocation with value of percent 1 2 3 4 5 6 but it is generating 456 456.

 

Thanks,

Minkesh

 

Hello folks,

 

I hope you all are doing well.

Can anyone tell me that what is the difference between aloha app and native app of salesforce ?

Can anyone tell me what feature salesforce is giving in force.com various editions.

 

Thanks,

Minkesh Patel

Hello folks,

 

I hope you all are doing well.

 

I am facing one serious issue and i can't understand.

Here is my class :-

 

In this class  I am trying to sequencing bundle product and their option. e.g. product1 has two option. So it I have to arrange it

 

Product1

 -- option1

 -- option2

 

In this format, same option may be in the different different budle.I have written code but while inserting it shows me 125 row and the exception that is my subject line.

 

public with sharing class CopyToAgreementTemplateFieldHolderClass {
    String agreementId = Apexpages.CurrentPage().getParameters().get('id');
    String action = ApexPages.CurrentPage().getParameters().get('action');
    String templateType = ApexPages.CurrentPage().getParameters().get('templateType');
    List<Apttus__AgreementLineItem__c> agreementLineItemList = new List<Apttus__AgreementLineItem__c>();
    List<Agreement_Template_Field_Holder__c> agreementTemplateFieldHolderList = new List<Agreement_Template_Field_Holder__c>();
    Map<String,List<Apttus__AgreementLineItem__c>> agreementTemplateFieldMap = new Map<String,List<Apttus__AgreementLineItem__c>>(); 
    public CopyToAgreementTemplateFieldHolderClass(){
        String soql = sobjetQuery('Apttus__AgreementLineItem__c','Apttus__AgreementId__c','=',agreementId,'Apttus_CMConfig__PriceListItemId__r.Required_Option__c,Apttus__ProductId__r.Name,Apttus_CMConfig__OptionId__r.Name,Apttus_CMConfig__PriceListItemId__r.Charge_Specifics__c') + ' Order By Apttus_CMConfig__LineNumber__c ASC';
        agreementLineItemList = database.query(soql);
        Agreement_Template_Field_Holder__c agreementTemplateFieldHolder;
        List<Apttus__AgreementLineItem__c> aggTempList;
        Map<String,Agreement_Template_Field_Holder__c> uniqueValueMap = new Map<String,Agreement_Template_Field_Holder__c>();
        for(Apttus__AgreementLineItem__c agmntli : agreementLineItemList){
             if( agreementTemplateFieldMap.containsKey(agmntli.Apttus__ProductId__r.Name +''+ agmntli.Apttus_CMConfig__OptionId__r.Name) ){
                aggTempList.add(agmntli);
                system.debug('===========agmntli.Apttus_CMConfig__OptionPrice__c=====>'+agmntli.Apttus__ListPrice__c);
                system.debug('===========agmntli====>'+agmntli);
                agreementTemplateFieldMap.put(agmntli.Apttus__ProductId__r.Name +''+ agmntli.Apttus_CMConfig__OptionId__r.Name,aggTempList);
            }else{
                aggTempList = new List<Apttus__AgreementLineItem__c>();
                system.debug('===========agmntli.Apttus_CMConfig__OptionPrice__c=====>'+agmntli.Apttus_CMConfig__OptionPrice__c);
                system.debug('===========agmntli====>'+agmntli);
                aggTempList.add(agmntli);
                agreementTemplateFieldMap.put(agmntli.Apttus__ProductId__r.Name +''+ agmntli.Apttus_CMConfig__OptionId__r.Name,aggTempList);
            }
           
             
            
        }
        system.debug('===agreementTemplateFieldMap====>'+agreementTemplateFieldMap.values());
        system.debug('===agreementTemplateFieldMap====>'+agreementTemplateFieldMap.keySet());
        for(String s : agreementTemplateFieldMap.keySet()){
            agreementTemplateFieldHolder = new Agreement_Template_Field_Holder__c();
            List<Apttus__AgreementLineItem__c> agreementLineItemList = agreementTemplateFieldMap.get(s);
            for(Apttus__AgreementLineItem__c agmntli : agreementLineItemList){
                system.debug('===========agmntli====>'+agmntli);
                system.debug('===========agmntli.Apttus_CMConfig__OptionPrice__c=====>'+agmntli.Apttus_CMConfig__OptionPrice__c);
                agreementTemplateFieldHolder.Agreement__c = agreementId;
                agreementTemplateFieldHolder.Product_Name__c = agmntli.Apttus__ProductId__r.Name;
                agreementTemplateFieldHolder.Product__c = agmntli.Apttus__ProductId__c;
                agreementTemplateFieldHolder.Product_Sequence__c = agmntli.Apttus_CMConfig__LineNumber__c;
                agreementTemplateFieldHolder.Option_Sequence__c = agmntli.Apttus_CMConfig__ItemSequence__c;
                if(agmntli.Apttus_CMConfig__OptionId__c != null){
                    agreementTemplateFieldHolder.Option_Name__c = ' - '+agmntli.Apttus_CMConfig__OptionId__r.Name;
                
                    if(agmntli.Apttus_CMConfig__ChargeType__c == 'North America PPM'){ 
                        agreementTemplateFieldHolder.Charge_Type_1__c = agmntli.Apttus_CMConfig__ChargeType__c;
                    
                        agreementTemplateFieldHolder.Charge_Type_1_Value__c = agmntli.apttus__listprice__c;
                    }
                    if(agmntli.Apttus_CMConfig__ChargeType__c == 'International PPM'){
                        agreementTemplateFieldHolder.Charge_Type_2__c = agmntli.Apttus_CMConfig__ChargeType__c;
                        
                        agreementTemplateFieldHolder.Charge_Type_2_Value__c = agmntli.apttus__listprice__c;
                    }
                    
                    if(agmntli.Apttus_CMConfig__ChargeType__c == 'Standard Price'){
                        if(agmntli.apttus__listprice__c != null){
                            agreementTemplateFieldHolder.Charge_Type_2__c = 'International PPM';
                            agreementTemplateFieldHolder.Charge_Type_1__c = 'North America PPM';
                            
                            agreementTemplateFieldHolder.Charge_Type_2_Value__c = agmntli.apttus__listprice__c;
                            agreementTemplateFieldHolder.Charge_Type_1_Value__c = agmntli.apttus__listprice__c;
                            
                        }
                        agreementTemplateFieldHolder.Appended_Text__c = agmntli.Apttus_CMConfig__PriceListItemId__r.Charge_Specifics__c;
                        agreementTemplateFieldHolder.Required_Option__c = agmntli.Apttus_CMConfig__PriceListItemId__r.Required_Option__c;
                    }
                }
                system.debug('======agmntli.Apttus__ProductId__r.Name=======>'+agmntli.Apttus__ProductId__r.Name);
                if(agmntli.Apttus__ProductId__r.Name == 'Steaming Perspective (StrP)')
                    agreementTemplateFieldHolder.Parent_Table__c = '2';
                if(agmntli.Apttus__ProductId__r.Name == 'Mobile Web Perspective Over Air (MWP-Air)' || agmntli.Apttus__ProductId__r.Name == 'MWP-Air Private Agent (1 device)' || agmntli.Apttus__ProductId__r.Name == 'Mobile Web Perspective (MWP)' || agmntli.Apttus__ProductId__r.Name == 'MWP Private Agent' || agmntli.Apttus__ProductId__r.Name == 'Mobile Device Perspective (MDP)' || agmntli.Apttus__ProductId__r.Name == 'MDP Initial Scripting' || agmntli.Apttus__ProductId__r.Name == 'Mobile Keynote Diagnostic Services (KDS)' )
                    agreementTemplateFieldHolder.Parent_Table__c = '3';
                else
                    agreementTemplateFieldHolder.Parent_Table__c = '1';
                
                uniqueValueMap.put(agmntli.Apttus_CMConfig__LineNumber__c+''+agmntli.Apttus_CMConfig__ItemSequence__c,agreementTemplateFieldHolder);
               
            }
            agreementTemplateFieldHolderList.add(agreementTemplateFieldHolder);
           // set<String> mapForSort = uniqueValueMap.keySet();
           // mapForSort = mapForSort.sort();
        }
    }
    
    public String sobjetQuery( String SobjectApiName , String conditionalField ,String condition,String comparingFieldvalue,String additionalFields ){
       String query = '';

       Map<String, Schema.SObjectType> schemaMap = Schema.getGlobalDescribe();
       
       Map<String, Schema.SObjectField> fieldMap = schemaMap.get(SobjectApiName).getDescribe().fields.getMap();
       
       for(String fieldName : fieldMap.keyset()){
           if(query == null || query == ''){
               query = fieldName;
           }else{
               query = query + ',' + fieldName;
           }
       
       }
       if(additionalFields != null && additionalFields != '')
            query = 'Select' + ' ' + query +','+additionalFields+' '+' from ' + SobjectApiName;
       else
            query = 'Select' + ' ' + query+' '+' from ' + SobjectApiName;
       system.debug('------------>'+query);
       if((conditionalField != null && conditionalField != '' ) && (condition != null && condition != '') && (comparingFieldvalue != null && comparingFieldvalue != null))
            query = query + ' ' + 'Where '+conditionalField+' '+condition+' \''+comparingFieldvalue+'\'';
       
            
       
       return query;
    } 
    
    public Pagereference redirectToSelect(){
    	try{
	        insert agreementTemplateFieldHolderList;
	        system.debug('======agreementTemplateFieldHolderList========>'+agreementTemplateFieldHolderList.size());
	        system.debug('======agreementTemplateFieldHolderList========>'+agreementTemplateFieldHolderList);
	        Map<String,List<Agreement_Template_Field_Holder__c>> bundlewiseMap = new Map<String,List<Agreement_Template_Field_Holder__c>>();
	        Map<String,Agreement_Template_Field_Holder__c> productBundleMap = new Map<String,Agreement_Template_Field_Holder__c>();
	        //integer i = 0;
	        List<Agreement_Template_Field_Holder__c> bundlewiseAgreementTemplateList;
	        for(Agreement_Template_Field_Holder__c atfh : agreementTemplateFieldHolderList){
	            if(!productBundleMap.containskey(atfh.Product__c)){
	                if(atfh.Option_Name__c == null){
	                	system.debug('==product name====>'+atfh.Product__r.Name);
	                    productBundleMap.put(atfh.Product__c,atfh);
	                }
	            }
	            if(bundlewiseMap.containsKey(atfh.Product__c)){
	                if(atfh.Option_Name__c != null){ 
	                    
	                    system.debug('==atfh====>'+atfh.Product__r.Name);
	                    system.debug('==bundlewiseAgreementTemplateList==size==>'+bundlewiseAgreementTemplateList.size());
	                    for(Agreement_Template_Field_Holder__c a : bundlewiseAgreementTemplateList){
	                        system.debug('=======a.Name_For_Template__c======>'+a.Name_For_Template__c);
	                    }
	                    //bundlewiseAgreementTemplateList.clear();
	                    if(atfh != null){
	                    	bundlewiseAgreementTemplateList.add(atfh);
	                    	bundlewiseMap.put(atfh.Product__c,bundlewiseAgreementTemplateList);
	                    }
	                }
	              //  i++;
	            }else{
	                if(atfh.Option_Name__c != null){
	                    bundlewiseAgreementTemplateList = new List<Agreement_Template_Field_Holder__c>();
	                    
	                    system.debug('==atfh=new===>'+atfh.Product__r.Name);
	                    if(atfh != null){
	                    	bundlewiseAgreementTemplateList.add(atfh);
	                    	bundlewiseMap.put(atfh.Product__c,bundlewiseAgreementTemplateList);
	                    }	                    	
	                }  
	            }
	           
	        }
	        List<Agreement_Template_Field_Holder__c> agreementTempToInsert = new List<Agreement_Template_Field_Holder__c>();
	        for(String bundleName : bundlewiseMap.keySet()){
	            system.debug('------------bundleName---------->'+bundleName);
	            if(productBundleMap.get(bundleName) != null)
	            	agreementTempToInsert.add(productBundleMap.get(bundleName));
	            for(Agreement_Template_Field_Holder__c ag : bundlewiseMap.get(bundleName)){
	                system.debug('-------ag.Product----->'+ ag.Product_Name__c);
	                system.debug('-------ag.Option----->'+ ag.Option_Name__c);
	                if(ag != null)
	                	agreementTempToInsert.add(ag);
	            }
	           // i++;
	          //  system.debug('=========>'+i);
	            
	        }
	        
	        
	        delete[select Id from Agreement_Template_Field_Holder__c where Agreement__c =: agreementId];
	        //insert agreementTemplateFieldHolderList;
	        insert agreementTempToInsert;
	        //insert UniqueValueList;
    	}catch(Exception e){
    		e.getMessage();
    	}
        return new Pagereference('/apex/Apttus__SelectTemplate?id='+agreementId+'&action='+action+'&templateType='+templateType);
    }

}

 

 

 

Please help me if i am making any mistake.

 

 

Hi folks,

 

 

I have created one aprooval process and i have activated it for testing purpose but aprooval process was wrong so i have inactive that process and created new one. Now when i am trying to delete the old one i am not able to do so.

 

I am getting error given below :-

 

Cannot Modify Active/Once Active Approval Process Definition Once an approval process has been activated, you cannot add or remove steps. Please create a new approval process from this one for modification. You may only delete an approval process that has no data records associated with it.

Click here to return to the previous page.       

 

Please help me in this matter.

 

Thanks,

Minkesh Patel

Hi,

 

I hope you all are doing well.Here i have one requirement.I have to set displayname for to address in email. can anyone help me in this problem.Below is the example that i have given:-

 

in to address it si displayed as :- "minkesh.patel@gmail.com" <Minkesh.patel@gmail.com>

I want to show like :- "Minkesh Patel" <Minkesh.patel@gmail.com>

 

Thanks,

Minkesh Patel

Hi,

     I am in big trouble and i don't why this error comes.

     can anybody help me in this matter ? 

    I am facing the error Too many query locator rows: 10001. i have put limit  10000 in the query than also this error comes.

    Please help me.

Hi,

      I am not able to fetch email template which has letterhead using SOQL query. 

     can anybody tell me how to fetch it using soql query ?

 

Hi, 

     I have one template with letterhead and i want to mail it.

     I am facing the problem while i am doing so because i am not able to see template in preview also. 

     I have used Tiny MCE editor to display preview template and i am not able to do so. what i am doing wrong can anyone tell me.

Hi,

      I am facing one problem. I want to Display image in the custom field.

      I made one zip file i.e. Flags. Now i want to use this file into custom field. So how can i do that.

      Can any one tell me ? can i use $resource  in the field.If yes than what is the syntax ?

 

Hi All,

           I hope you all are doing well.

           I am getting one problem please help me.

           I have taken One List<Object> .

           I am iterating on this Object and i have requirement to check weather this Object Contains '$' or not so for that i am using contains but the problem is contains is working only for TEXT.

          So can anybody tell me that how to convert this Object to TEXT on visualforce page side.

          Please reply me ASAP.

  • September 24, 2011
  • Like
  • 0

Hello,

           I have one method which is exporting record over 2000 and when i am clicking on export all button i am facing error.i.e. too many script statement :200001.

         Now i can't optimize the lines so that i want to catch this exception and i want to show message so i thought to put try catch on that method but still i am getting that exception.

 

Here is the code of that method :-

public PageReference exportAll(){

Pagereference pg;
try{
pg = new Pagereference('/apex/TransactionExcelGenerator?accId='+ controllerAccount.Id + '&exportall=yes' + '&listview='+ selectedList + '&sortfield=' + sortFieldName + '&sortfield1=' + sortFieldName1 + '&ordertype=' + orderType );
system.debug('----page---'+pg);
return pg;
}
catch(Exception ex){
Apexpages.addMessage(new Apexpages.Message(Apexpages.Severity.INFO, 'Exporting this view is not possible due to large amount of data being accessed. Please either change view filter, select fewer rows to export or use reporting functionality to extract the data required:'+ex.getMessage()));
return null;
}


}

 

  • September 02, 2011
  • Like
  • 0

Hello,

            I have one org in which company has default currency GBP and user has also default currency GBP.

            In report, One account is showing USD currency and others are showing GBP.How to show value in One currency ?

 

Hello  All,

                 i want to increase test class coverage. i have written code in variable's get method.here i am posting piece of code of my class.

 

// List of File Attachment type
 	   public List<SelectOption> attachTypes {
 	   get {
 	  
 	   if ( isMultiInvoiceTemplates ) {
	  
 	   return invoiceTemplates;
 	   }
	   attachTypes = new List<SelectOption>();
 	   attachTypes.add(new SelectOption('None','None'));

           if(ConfigUtilController.isEnableInvoiceDetailPDF())
	   {
	   attachTypes.add(new SelectOption('SumPDF','Summary PDF'));
 	   attachTypes.add(new SelectOption('SumAndDetailsPDF','Summary and Details PDF'));
 	   }
 	   attachTypes.add(new SelectOption('StatPDF','Statement PDF'));
 	   attachTypes.add(new SelectOption('StatSpreadsheet','Statement Spreadsheet'));
 	  
 	   return attachTypes;
 	   }
 	   set;
 	   }

 how to cover this code ? can anyone help me ?

Hello,

            I want to make one formula field which will contain Name of whatId. Is it possible ? If possible tell me the possible way.

Hello All,

                Can anyone tell me that where the time based workflow  tasks are stored ?

 

Hello All,

                 I have an transaction object.

                 I have created one page i.e. massUpdateTransaction . in that i want to add field dynamically. Custom Setting is one way to do so.

                 Can i use field set instead of custom settings. and after moving it to the production,are we able to change field set fields ?

                 Please help.

 

Hello All,

                I have developped one component. the component is used to display account hierarchy in tree view manner.

                I called this component in searchAccount class in which i have given one text box to search account and also given another button i.e. ADD which will add  that searched selected account into that tree hierarchy by assigning parentAccount.

                Now when i added that account i need it to rerender that component so that i will be able to display that account into that hierarchy but unfortunately hierarchy view is distracted and another columns are automatically appended to the last row.

                can anyone help me in this matter?

Hello All,

                 I am facing problem while i am trying to install package in one of the developer edition.

                 Following error occurred while installing:-

 

Data Not Available
The data you were trying to access could not be found. It may be due to another user deleting the data or a system error. If you know the data is not deleted but cannot access it, please look at our support page. 

 

Hello All,

                I have created List<Object> objList = new List<Object>();

                Now I have requirement to know the what is the datatype of the value stored in this list.

                How we get to know the datatype of the stored value ? Is there any method ?

                i.e. objList = {'hello',1234.56,12};

                how we get to know that 2nd value in the list is Number Or decimal Type?

                Please Help me to solve this issue?

Hello,

           I am facing very critical issue and i don't know what is the reason behind this error.

           when user is trying to update task which is on account.User is getting this error given below.

          

Developer script exception from Citrix Online : AutomaticDuningHelper : Update failed. First exception on row 0 with id 00TA000000Xw7HhMAJ; first error: INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY, insufficient access rights on object id: []

 

 

          can anyone tell me the reason why this happens?

Hello folks,

 

I hope you all are doing well.

Can anyone tell me that what is the difference between aloha app and native app of salesforce ?

Can anyone tell me what feature salesforce is giving in force.com various editions.

 

Thanks,

Minkesh Patel

I have just set up the Force.com IDE through eclipse, and have a question about getting custom objects.  I have created a sandbox instance that has custom objects that were created through salesforce.com in a browser, but when looking at this instance in the Force.com IDE it does not show any of my custom objects.  Any help/suggestions here would be great!

 

Cameron

Hi,

     I am in big trouble and i don't why this error comes.

     can anybody help me in this matter ? 

    I am facing the error Too many query locator rows: 10001. i have put limit  10000 in the query than also this error comes.

    Please help me.

Hi,

      I am not able to fetch email template which has letterhead using SOQL query. 

     can anybody tell me how to fetch it using soql query ?

 

Hi,

      I am facing one problem. I want to Display image in the custom field.

      I made one zip file i.e. Flags. Now i want to use this file into custom field. So how can i do that.

      Can any one tell me ? can i use $resource  in the field.If yes than what is the syntax ?

 

Hi

  I have a trigger  on oppertunity .When stage is closed won . i m creating a case and assisning a r Assignment rule to it with Database.DMLOptions.  I have a update trigger on case. When a new csae is inserted . Update trigger is fired. 

This is because of the Assignment rule . it is udated after case is created.

How can i stop  firying the update on case.

 

Trigger-:

 oDatabase.DMLOptins dmo = new Database.DMLOptions();
 dmo.assignmentRuleHeader.useDefaultRule= true;

if(o.StageName == 'Closed Won' && o.Cases__r.size()<1 )  {
        try
        {
              Case  c = new Case();
              c.AccountId = o.AccountId;
              c.Opportunity__c = o.Id;
              c.Subject = o.Name;
              c.setOptions(dmo);                      
              caseList.add(c);
               
        }
        catch(Exception e){}   
  }
  if(!(caseList.isEmpty())){
     
    insert caseList;
  
  }

 

After this update trigger is executed.

Please Help!!!!!!!!!!!!!!!

 

Thanks

Shailu

  • September 24, 2011
  • Like
  • 0

I have the following code in one of my classes:


if(adwc != null) {
       adwc.Used__c = true;
       adwc.Used_Time__c = datetime.now();
       update adwc;        
}

 

When trying to sace I just get the error "Variable does not exist: adwc" on the line with "update adwc;".

 

Any ideas why I get this error, the check is done to avoid this?



Hello All,

                Can anyone tell me that where the time based workflow  tasks are stored ?

 

Hello All,

                 I have an transaction object.

                 I have created one page i.e. massUpdateTransaction . in that i want to add field dynamically. Custom Setting is one way to do so.

                 Can i use field set instead of custom settings. and after moving it to the production,are we able to change field set fields ?

                 Please help.

 

I want to populate treeview same as Organization's Role Hierarchy in salesforce. Add/Edit features should be threre. But this tree view should not reflect the Organization's Role Hierarchy.

 

Example:

 

Admin1
|------ Manager1
--|------ ReportingPerson1
--|------ ReportingPerson2
|------ Manager2
--|------ ReportingPerson3
--|------ ReportingPerson4
--|------ ReportingPerson5
|------ Manager3
--|------ ReportingPerson1
--|------ ReportingPerson6
--|------ ReportingPerson7
--|------ ReportingPerson8
|------ Manager4
--|------ ReportingPerson2
Admin2
|------ Manager5
--|------ ReportingPerson1
--|------ ReportingPerson2
|------ Manager6
--|------ ReportingPerson3
--|------ ReportingPerson4
--|------ ReportingPerson5

 

--Chamil Madusanka

Hello,

           I have an requirement to sort Text field which contains (i.e. 0.0,0.1.0,0.0.0.1,1.0,1.1). it is the index of tree. i have another field which is Number field and it contains (0,1,2,3,...). i am making that above text field using this index field.

           now i have an requirement to display that visualforce page as an HTML page. and that Text field i need to put infront of tree node name.e.g.

                              1.0  a1

                                  1.1.0 a1.0

                                   1.1.1 a1.1

 

i am using that text  field so that it is sorting it by considering it String so my output becomes as follows which is wrong. can anyone help.

 



	
1   2.01.06.01 Australia
Role
Description
	
10   2.01.06.17 Spain
Role
Description
	
11   2.01.06.15 Portugal
Role
Description
	
12   2.01.06.19 United Kingdom & Ireland
Role
Description
	
13   2.01.06.02 Belgium
Role
Description
	
14   2.01.06.04 Czech Republic
Role
Description
	
16   2.01.06.10 India
Role
Description
	
17   2.01.06.12 Mexico
Role
Description
	
18   2.01.06.14 Poland
Role
Description
	
19   2.01.06.16 Slovenia
Role
Description
	
2   2.01.06.03 Canada
Role
Description
	
20   2.01.06.18 Switzerland
Role
Description
	
21   2.01.06.08 Hong Kong
Role
Description
	
3   2.01.06.05 France
Role
Description
	
4   2.01.06.07 Greece (Hellas
Role
Description
	
5   2.01.06.09 Hungary
Role
Description
	
6   2.01.06.11 Italy
Role
Description
	
7   2.01.06.13 Nordic & Baltic Region
Role
Description
	
8   2.01.06.06 Germany
Role
Description

 

Thank you,

Minkesh Patel



Hello,

            I have some issues while building jstree with salesforce. i have attached following files in the the static resource.

 

 

<apex:stylesheet value="{!URLFOR($Resource.TreeJsAndStyle, 'jquery/themes/default/style.css')}"/>
     <apex:stylesheet value="{!URLFOR($Resource.TreeJsAndStyle, 'jquery/themes/apple/style.css')}"/>  
     <apex:stylesheet value="{!URLFOR($Resource.TreeJsAndStyle, 'jquery/themes/classic/style.css')}"/>  
     <apex:stylesheet value="{!URLFOR($Resource.TreeJsAndStyle, 'jquery/themes/default-rtl/style.css')}"/>       
     
    
     <apex:includeScript value="{!URLFOR($Resource.TreeJsAndStyle, 'jquery/jquery.cookie.js')}"/>
     <apex:includeScript value="{!URLFOR($Resource.TreeJsAndStyle, 'jquery/jquery.hotkeys.js')}"/>
     <apex:includeScript value="{!URLFOR($Resource.TreeJsAndStyle, 'jquery/jquery.js')}"/>
     <apex:includeScript value="{!URLFOR($Resource.TreeJsAndStyle, 'jquery/jquery.jstree.js')}"/>
     <apex:includeScript value="{!$Resource.treejs}"/>

 

 

i have written following code for that but it is not working and giving me javascript error that jstree is not  a function.here is the javascript code given below.

 

  <!--  jquery for activity tree -->
        var selectedActivityName = '';
    	var $jq  = jQuery.noConflict();
    	
			function createRootActivity() {
				nd = $jq("#demo").jstree('get_selected');
				$jq("#demo").jstree("create",-1,false,"No rename",false,false);
			}
			
			//NOT USED AS OF NOW
			function createActivity(e) {
				$jq("#demo").jstree("create"); 
			}
			
			//NOT USED AS OF NOW
			function renameActivity(e) {
				$jq("#demo").jstree("rename"); 
			}
			
			function setSelectedActivity(selActivityName) {
				selectedActivityName = selActivityName;
			}
			
			var newActivitParentName = '';
			function setNewActivityParentName(parentActName) {
				newActivitParentName = parentActName;
			}
			
			var newActivityName = '';
			function setActivityNewName(newName) {
				//alert('newName:'+newName);
				newActivityName = newName;
			}
		
			$jq(function () {
				$jq("#create_1").click(createRootActivity);
				//$jq("#create_2").click(createActivity);
				//$jq("#rename").click(renameActivity);
				
			});
			
			var activityMoved = '';
			var newActivityPosition = '';
			var newActivityParent = '';
			var keepOriginalActivity = '';
			function changePositionOfActivity(activityName,newPosition,newParentAcitivityName, keepOrigNode) {
				//alert("activityName:"+activityName);
				//alert("newPosition:"+newPosition);
				//alert("newParentAcitivityName:"+newParentAcitivityName);
				//alert("keepOrigNode:"+keepOrigNode);
				
				activityMoved = activityName;
				newActivityPosition = newPosition;
				newActivityParent = newParentAcitivityName;
				keepOriginalActivity = keepOrigNode;
			}
		
			$jq(function () {
			    $jq("#demo")
			    .bind("open_node.jstree create_node.jstree close_node.jstree select_node.jstree move_node.jstree rename_node.jstree cut_node.jstree", function (e, data) {
					if(e.type == 'create_node') {
						movObject = data.args[0];
						setNewActivityParentName($jq("#demo").jstree("get_text",movObject));
					}
				    if(e.type == 'move_node') {
						movObject = data.args[0];
						var keepOrigNode = false;
						if(data.args[3]) {keepOrigNode=true;}
						changePositionOfActivity(movObject.o.text(),movObject.cp,$jq("#demo").jstree("get_text",movObject.np),keepOrigNode);
					}
					if(e.type == 'select_node') {
						setSelectedActivity($jq("#demo").jstree("get_text",data.inst.get_selected()));
					}
					if(e.type == 'rename_node') {
						alert("node renamed");
						movObject = data.args[0];
						setActivityNewName($("#demo").jstree("get_text",movObject));
					}
			    })
			        
			    .jstree({
			        "core" : { "initially_open" : [ "root" ] },
			        
			        "html_data" : {
			            "data" : "<ul><li id='rhtml_1'><a href='#'>Root node 1</a><ul><li id='rhtml_2'><a href='#'>Child node 1</a></li><li id='rhtml_3'><a href='#'>Child node 2</a></li><li id='rhtml_4'><a href='#'>Child node 3</a></li><li id='rhtml_5'><a href='#'>Child node 4</a></li></ul></li><li id='rhtml_6'><a href='#'>Root node 2</a></li><li id='rhtml_7'><a href='#'>Root node 3</a></li></ul>"
		
			    	},
			    	"dnd" : {
				    	"drop_finish" : function () {
			                alert("DROP");
			            },
			            "drag_finish" : function (data) {
			                alert("DRAG OK");
			                alert(data.r);
			            },
			    	},
			    	"ui" : {
			            "select_limit" : 1
			        },
			        "contextmenu" : {
				        	"select_node"		: true,
							"show_at_node"		: false,
							"rename" : {
								"label"				: "Rename",
								// The function to execute upon a click
								"action"			: function (obj) { alert('1');this.rename(obj); },
								// All below are optional 
								"_disabled"			: false,		// clicking the item won't do a thing
								"_class"			: "class",	// class is applied to the item LI node
								"separator_before"	: false,	// Insert a separator before the item
								"separator_after"	: true,		// Insert a separator after the item
								// false or string - if does not contain `/` - used as classname
								"icon"				: true,
								"submenu"			: { 
									/* Collection of objects (the same structure) */
								}
							}
						},
			        "plugins" : [ "themes", "html_data", "dnd", "ui", "crrm","contextmenu" ]
			    });
			});

 

 

and page code is given below.

 

 

<apex:outputPanel id="outPanel" >
                                            	<div id="demo" class="demo"></div>   
                                            </apex:outputPanel>

 

if anyone has any idea pleas tell me.