• Siana Dcruz
  • NEWBIE
  • 20 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 17
    Questions
  • 11
    Replies
Hey all,
I am stuck in my code where i need help in lists
I have my code something like this.
List<String[]> rowAlter= new List<String[]>(size);
            
            Integer i=1,j=2;
          for(String[] r : csv1) {
             system.debug('odd-->'+r+'!!!!!---'+i);
              rowAlter.add(i,r);
             system.debug('odd rowalter--'+i+'--'+rowAlter[i]);
              i=i+2;
         }
         system.debug('before rowAlter[3]= '+rowAlter[3]);
         for(String[] s : csv2) {
         system.debug('even-->'+s+'!!!!!---'+j);
              rowAlter.add(j,s);
              system.debug('even rowalter--'+j+'--'+rowAlter[j]);
              j=j+2;
              
         }

when i check debug logs for (system.debug('odd rowalter--'+i+'--'+rowAlter[i]);)
all the values are correctly placed in odd indices.

but again when the control comes in the for loop for even indices,all the values are correctly placed for even indices but odd indices values are not in order and few of them are null.I tried a lot  to replicate the issue but couldn't.I really need a help in this.Please can anyone help me resolve it?
Hey all,
I wanted help to reset counters.The requirement is I have a method which when called will increment the counter.The counter has to reset to 01 on the beginning of every day and then increment accordingly. I would be really gratefull if anyone helps me in building this logic.
Thanks!!
Hey all,
I have a trigger something like this:

trigger ClaimData on Intake__c (after update) {

 Profile p = [ SELECT Name FROM Profile WHERE Id =: UserInfo.getProfileId() ];
if (p.Name != 'Data Manager') {
        List<Claim__c> claims = new List<Claim__c>();
        List<Id> intakeIds = new List<Id>();
        List<Claim__c> claimsToUpdate = new List<Claim__c>();
        for (Intake__c i : Trigger.new){
                intakeIds.add(i.Id);
        }
            
        claims = [SELECT fld1,fld2,fld3....,fldn from claim__c where intake__c IN: intakeIds];
        
        List<recordType> recordTypes = [select id,name from recordType where SobjectType ='claim__c' And name in ('WC','AL','PROP','GL','MR')];     
        Map<String,recordType> mapRecordTypes = new Map<String,recordType>();
        Map<Id, List<Claim__c>> claimMap= new Map<Id, List<Claim__c>>();
        
        for (recordType r: recordTypes) {
            mapRecordTypes.put(r.DeveloperName, r);
        }
        
        for (Claim__c c: claims) {
            List<Claim__c> int2Clms = claimMap.get(c.intake__c);
            if(int2Clms == null){
                claimMap.put(c.intake__c,int2Clms = new List<Claim__c>());
            }
            int2Clms.add(c);
        }
        
        for(Intake__c i : Trigger.new){
   List<Claim__c > claimsList = claimMap.get(i.Id);
                //1
                 for(Claim__c c:claimsList){
               c.fld1='value1';
        c.fld2='value2';
                 .
         .
         .    
         .        
         .
   }
}
}
}

Since this is an after update trigger and I am updating records with an external dml,it might lead to recurssion.Can anyone
please tell me how to avoid recursion in my trigger.Any help would be greatly appreciated.
Thanks!!
Hi all,
I have 2 objects claim__c and intake__c.
Claim__c has 2 field sets: marine1 and marine2
marine1 has fields :
vesselName1
vesselName2 and so on
simmilarly
marine2 has fields:
vesselName1
vesselName2 and so on
 Intake__c has a fieldset named marine_intake
it has values vesselName1,vesselNumber and so on

What I have to do in my trigger is
if(vesselName1 of marine1 fieldset == 'ferry')
then I have to copy vesselName1 from marine2 fieldset(claim object) to vesselName1 in marine_intake fieldset(intake obj)
I am really confused with these field sets. can anyone plz help me to write the logic for this.
Hey all..

I have created a portal and the users will be accessing it through the custom tab in the platform.Everything works fine but i have a lookup field which has a lookup to contacts.The contact records which a user doesn't have access to can also be seen in the lookup.Can anyone please help me to filter these lookups so that the user can see only those contacts which he has access to.
Thanks!!
hey all,

i need help in my trigger. I have a object:additional_contacts__c
it has a field contact__c which is a lookup to Contact object.
if the users cannot find any contacts then they have to create one contact.

I have no good experience working on triggers.Can anyone please help me how to write a trigger for this
Hi all,

I have 2 objects: Claim__c and intake__c
Whenever a new claim is created i need to map all values of claim to intake.All values are getting mapped except the recordtype.Can anyone please tell me how to map recordtype from claim to intake 
Hi all,
I have a test class something like this.

global class Maincontroller()
{
  global virtual class summary extends summary1
  {
    global virtual override void startPage()
    {    
    //Lines of code
    }
  }
}

Can anyone please tell me how to cover the startPage method in my test class.Since this method is inside the inner class, I have no idea how to write the test class for that.Any help would be greatly appreciated.
Hi all,

In the below code, I am mapping
 label1 to time1,
 label2 to time2,
 label3 to time2,
 label4 to time3
 All these are the picklist values in the field time__c. Now i want 
 1)label2 to be mapped to 'time2'(which is done) and also to 'reason2' picklist value of reason__c field.
 2)label3 to be mapped to 'time2' of time__c field and 'reason3' of reason__C field.
 
 Anyone Please suggest me how can I achieve this.
 
 public List<SelectOption> getTimeOptions()
    {
        List<SelectOption> options = new List<SelectOption>();
        List<String> times= this.getDynamicPicklistValues('Intake__c', 'time__c');
       // List<String> reasonTypes = this.getDynamicPicklistValues('Intake__c', 'Reason__c');
        for (String time: times)
        {
          if(time== 'time1')     
              options.add(new SelectOption(time,'label1'));
           
         if(time== 'time2')  
             options.add(new SelectOption(time,'label2'));
       
          if(time== 'time2')  
             options.add(new SelectOption(time,'label3'));
       
        if(time== 'time3')  
           
             options.add(new SelectOption(time,'label4'));
              
         }
 return options;
     }
     
Hi all,
  I have two objects named Intake__c and claim__c
Intake__c has a field set named 'Intakes' and claim__c object has fieldset 'claims',
both fieldsets have around 40 fields each. i want to map all fields from claims to incidents.Can anyone suggest me how to do this.
 
Hi all,
I am not sure how to write test class for this method. Any help would be greatly appreciated!! 
    public List<SelectOption> getDiningTimeOptions()
    {
        List<SelectOption> options = new List<SelectOption>();
        List<String> Times = this.getDynamicPicklistValues('Intake__c', 'Time__c');
        for (String Time : Times)
        {
            options.add(new SelectOption(Time, Time));
        }

        return options;
    }
 
Hi all,
I need some help in my code. In the code below what I am trying to do is when the user selects GUEST i want the guest section should be shown up and hide when user selects EMPLOYEE. But my rerender attribute will cause the guest section to be shown up even when the user selects EMPLOYEE. In general I can say there are no observable hide/show effects. Please help me solve this issue.

<script>
$(document).ready(function() {
 $('.selectRadioinput').click(function(e) {
            var val = e.target.value;
            if (val == 'employee') {
               $('.guest_section').hide();
            }
            else if (val == 'Guest') {
                $('.guest_section').show();
}
        });
});
</script>
<apex:selectRadio layout="lineDirection" styleClass="selectRadio" id="selectrole" value="{!role}" required="false"  >
          <apex:selectOptions value="{!recordTypeOptions}" />  <!--options are: 1)employee  2)Guest -->
      <apex:actionsupport event="onclick" rerender="out" />
        </apex:selectRadio>
 <apex:outputPanel id="out" >
 <div class="guest_section">  
  <!--some text-->                      
          </div>
</apex:outputPanel>
Hi All,
 
I am using the following code to get the picklist values from Time__c

public List<SelectOption> getTimeOptions()
    {
        List<SelectOption> options = new List<SelectOption>();
        List<String> Times = this.getDynamicPicklistValues('Intake__c', 'Time_c');
        for (String Time : Times)
        {
            options.add(new SelectOption(Time, Time));
        }

        return options;
    }

Time__c has following picklist values:
Time A
Time B
Time C
Time D

But I want the values to appear as:
Time B
Time D
Time C
Time A

Please suggest me how to do this?!!
 
Hi all,
I need help in trigger, There are two objects Intake_details and claim. The issue is,some claim records are being created that do not have a corresponding Intake Detail record
A claim record should only be created if its name(claim number) field matches the Intake_details name field. 

Please suggest me how to do this.
Hi All,
I tried using capture+ for this purpose, but still i was not able to achieve the same. Can any one please help me with this or provide me the code through which the address fields can be auto populated upon entering the Zip code.

Hi
I have the following line of code written in my class to refer to the current Page: 
System.currentPageReference().getParameters().get('selectedTemplateId');

Can anyone help me replace this code so as to refer the current page dynamically?
 

I have Created an action that provides a selectedTemplate ID as a parameter in the URL.The EmailAuthor page will open with the the template, but selecting a new template does not change the rendered template.Can anyone help me with this?
Hi all,
I have 2 objects claim__c and intake__c.
Claim__c has 2 field sets: marine1 and marine2
marine1 has fields :
vesselName1
vesselName2 and so on
simmilarly
marine2 has fields:
vesselName1
vesselName2 and so on
 Intake__c has a fieldset named marine_intake
it has values vesselName1,vesselNumber and so on

What I have to do in my trigger is
if(vesselName1 of marine1 fieldset == 'ferry')
then I have to copy vesselName1 from marine2 fieldset(claim object) to vesselName1 in marine_intake fieldset(intake obj)
I am really confused with these field sets. can anyone plz help me to write the logic for this.
Hi all,

In the below code, I am mapping
 label1 to time1,
 label2 to time2,
 label3 to time2,
 label4 to time3
 All these are the picklist values in the field time__c. Now i want 
 1)label2 to be mapped to 'time2'(which is done) and also to 'reason2' picklist value of reason__c field.
 2)label3 to be mapped to 'time2' of time__c field and 'reason3' of reason__C field.
 
 Anyone Please suggest me how can I achieve this.
 
 public List<SelectOption> getTimeOptions()
    {
        List<SelectOption> options = new List<SelectOption>();
        List<String> times= this.getDynamicPicklistValues('Intake__c', 'time__c');
       // List<String> reasonTypes = this.getDynamicPicklistValues('Intake__c', 'Reason__c');
        for (String time: times)
        {
          if(time== 'time1')     
              options.add(new SelectOption(time,'label1'));
           
         if(time== 'time2')  
             options.add(new SelectOption(time,'label2'));
       
          if(time== 'time2')  
             options.add(new SelectOption(time,'label3'));
       
        if(time== 'time3')  
           
             options.add(new SelectOption(time,'label4'));
              
         }
 return options;
     }
     
Hi All,
 
I am using the following code to get the picklist values from Time__c

public List<SelectOption> getTimeOptions()
    {
        List<SelectOption> options = new List<SelectOption>();
        List<String> Times = this.getDynamicPicklistValues('Intake__c', 'Time_c');
        for (String Time : Times)
        {
            options.add(new SelectOption(Time, Time));
        }

        return options;
    }

Time__c has following picklist values:
Time A
Time B
Time C
Time D

But I want the values to appear as:
Time B
Time D
Time C
Time A

Please suggest me how to do this?!!
 
Hi all,
I need help in trigger, There are two objects Intake_details and claim. The issue is,some claim records are being created that do not have a corresponding Intake Detail record
A claim record should only be created if its name(claim number) field matches the Intake_details name field. 

Please suggest me how to do this.
I have Created an action that provides a selectedTemplate ID as a parameter in the URL.The EmailAuthor page will open with the the template, but selecting a new template does not change the rendered template.Can anyone help me with this?
Hi All,
I want to auto populate the contact address fileds(Area Name, City n all) by just entering ZipCode

Ex: If i enter Zipcode As :591317 then i want to auto populate following fields..
Mailing City    
Mailing State/Province    
Mailing Zip/Postal Code    
Mailing Country

Some Solution: I thought of creating a custom object to store this info and write a trigger to populate these values..

But Please suggest any other best ideas, like goodle api integration or free apps in apexachage or any other best solutions...
It shold be free ..