• Surendra123
  • NEWBIE
  • 0 Points
  • Member since 2013

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 10
    Questions
  • 20
    Replies
i have generated a report using google analytics but it was not displaying the demographics and browser settings value and in the report it was showing 0 can anybody help me
Error: Compile Error: Invalid field Engineering_Projects__c for SObject TeamMember__c at line 14 column 9

Api's

TeamMember__c,  Engineering_Project__c
!
!
!
!
v

TeamRole__c
User__c


public class TeamMemberController {

    public list<TeamMember__c> moreTeamMembers{get;set;}
    ID endProId;
    public TeamMemberController(){
  
        system.debug(apexpages.currentpage().getparameters().get('id'));
        endProId = apexpages.currentpage().getparameters().get('id');
      
        moreTeamMembers = new list<TeamMember__c>();
      
      
        TeamMember__c teamMember = new TeamMember__c();
        teamMember.Engineering_Projects__c = endProId;
        moreTeamMembers.add(teamMember);
      
        TeamMember__c teamMember1 = new TeamMember__c();
        teamMember1.Engineering_Project__c = endProId;
        moreTeamMembers.add(teamMember1);
      
        TeamMember__c teamMember2 = new TeamMember__c();
        teamMember2.Engineering_Project__c = endProId;
        moreTeamMembers.add(teamMember2);
      
        TeamMember__c teamMember3 = new TeamMember__c();
        teamMember3.Engineering_Project__c = endProId;
        moreTeamMembers.add(teamMember3);
      
        TeamMember__c teamMember4 = new TeamMember__c();
        teamMember4.Engineering_Project__c = endProId;
        moreTeamMembers.add(teamMember4);

    }
  
  
    public pagereference mySave()
    {
        for(integer i=0;i<moreTeamMembers.size();i++)
        {
            if(moreTeamMembers[i].User__c != null)
            {
                insert moreTeamMembers[i];
            }
        }
        pagereference pagref = new pagereference('/'+endProId);
        return pagref;
    }
  
    public pagereference myCancel()
    {
       pagereference p = new pagereference('/'+ endProId);
       return p;
  
    }
      

}

page

<apex:page Controller="TeamMemberController" showHeader="false" sidebar="false">  
   <apex:form >
      <apex:pageBlock >
        <apex:pageMessages />
        <apex:pageBlockButtons >
          <apex:commandButton value="Save" action="{!mySave}"/>
          <apex:commandButton value="Save & More" action="{!mySave}"/>
          <apex:commandButton value="Cancel" action="{!myCancel}"/>                    
         </apex:pageBlockButtons>
              <apex:pageBlockTable value="{!moreTeamMembers}" var="TM">
             
              <apex:column headerValue="User">
              <apex:inputField value="{!TM.User__c}"/>
              </apex:column>
             
              <apex:column headerValue="Team Role">
               <apex:inputField value="{!TM.TeamRole__c}"/>
               </apex:column>
             
        </apex:pageBlockTable>
      </apex:pageBlock>
    </apex:form>
  </apex:page>

Csv Error Invalid Csv FileFormat Please select a different file
com.sforce.async.CSVReaders$CSVParseException:Excceded number of records:
10002.Number of records should be less than or equal to 10001

 

I am updating data using dataloader i was geting this error can anybody help me

Hi I have two fields in product object where i need to split the data and send to the other custom field for this i have split the data

eg:cable/1234  1234 will be placed in the other custom field there are some records like cable/MO1234 i just want to remove the string Mo for such records any help or make them as default to be 1 for such records ant help thanks in advance

trigger ProductFieldUpdate on Product2 (Before insert, before update){
    for(Product2 p : trigger.new){
  
        if(p.Ampics_PL__c != null && p.Ampics_PL__c == 'UTILUX'  ) {
        if(p.description!= null && p.description.lastIndexOf('/') != -1) {
      
      
      
        Integer lastIndx = p.description.lastIndexOf('/');
        p.GPL_Desc__c  = string.valueOf(p.description.subString(lastIndx + 1));
       
      
        }
       
           } else {
        p.GPL_Desc__c = '1';
           }
        }
        }

When i try update the data using data loader it was showing the error

 

ProductFieldUpdate: execution of BeforeUpdate

caused by: System.NullPointerException: Attempt to de-reference a null object

Trigger.ProductFieldUpdate: line 17, column 1

 

 

Code

trigger ProductFieldUpdate on Product2 (Before insert, before update){
    for(Product2 p : trigger.new){
   
        if(p.Ampics_PL__c != null && p.Ampics_PL__c == 'UTILUX'  ) {
        if(p.description.lastIndexOf('/') != -1) {
       
        Integer lastIndx = p.description.lastIndexOf('/');
        p.GPL_Desc__c  = string.valueOf(p.description.subString(lastIndx + 1));
        }
        else {
        p.GPL_Desc__c = '1';
         
        
             }
           }
        }
        }
      

ProductFieldUpdate: execution of BeforeUpdate

caused by: System.TypeException: Invalid decimal: STEEL 520X4.6MM

Trigger.ProductFieldUpdate: line 18, column 1

 

Here is my trigger code

 trigger ProductFieldUpdate on Product2 (Before insert, before update){
    for(Product2 p : trigger.new){
        if(p.Ampics_PL__c != null && p.Ampics_PL__c == 'UTILUX') {
        if(p.description.lastIndexOf('/') != -1) {
        Integer lastIndx = p.description.lastIndexOf('/');
         p.Pieces_in_Pack__c  = Decimal.valueOf(p.description.subString(lastIndx + 1));
         }
        else {
        p.Pieces_in_Pack__c = 1;
         
        
             }
           }
        }
        }

Where i need to split the value of one custom field and place it in the other custom field i have a developed a trigger

 

trigger ProductFieldUpdate on Product2 (Before insert, before update)
{
     for(Product2 p : trigger.new) {
         if(p.Ampics_PL__c != null && p.Ampics_PL__c == 'UTILUX') {
            if(p.description != null && p.description.contains('/'))
            
            {
               String[] sstr = p.description.split('/');
               p.Pieces_in_Pack__c = integer.valueof(sstr[1]);
            }
              else
              p.Pieces_in_Pack__c = 1;
              
              
          
         }
      }
}

 

if i have a Management/12345  i was getting 12345 there are some other values like  Management/12345(testing/123 i need to retrve the 2nd value in that case can any body help me

Error: Compile Error: Entity 'Product' not accessible in version 29.0 at line 1 column 1  please help me thanks in advance

 

 

trigger updateNewvalues on product2 (before update) {


   for (Product2 prod: Trigger.new) {
               if(prod.Ampics_PL__c !=null &&  Product.Ampics_PL__c == 'Utilix') {
                
             String str = 'Utilix';
             String[] sstr = str.split('/');
              system.debug(sstr[0]);
              system.debug(sstr[1]);
           
              System.debug('--*Product Value is changed*--');
              
              System.debug('**Ampics_PL__c  :'+prod.sstr[0]);
              
       }
       
       else{
              prod.Pieces_in_Pack__c = '1';  
       }
   }
}

i want to split the value of one custom field and assaign the value to the other custom field  which are related to product obj

 

 trigger Compare_OldandNewvalues on Product2 (before update) {

   for (Product2 prod: Trigger.new) {
        
     //   if(prod.Ampics_PL__c != Ampics_PL__c.Ampics_PL__c) {
           
     //      prod.Ampics_PL__c = Trigger.product2.get(prod.ID);
     //      String str = 'Utilix';
     //          String[] sstr = str.split('/');
     //          system.debug(sstr[0]);
     //          system.debug(sstr[1]);
     //          prod.Ampics_PL__c = 'sstr[1]';
     //          System.debug('--*Product Value is changed*--');
             //  System.debug('**Ampics_PL__c :'+Ampics_PL__c.sstr[0]);
     //          System.debug('**Ampics_PL__c  :'+prod.sstr[0]);
        }
       }
    //    else{
      //      System.debug('--**Product2 Number has not been Updated**--');
        //    prod.Pieces_in_Pack__c = '1';  
    //    }
   // }
//}

we have two fields in product object  Ampics_PL__c and Pieces_in_Pack__c where we need to fetch the value from Ampics='utilix ' picklist value and assaign to the Pieces_In  for eg  we have Cable/10002  this 10002 must be split and assaign to Pieces_in_Pack__c custom field

 

 

Error:Expression cannot be assigned at line -1 column -1

 

 

trigger UpdateProductField on Product2 (after insert, after update) {

Set<Id> Product2Id = new Set<Id>();

for (Product2 Product : Trigger.new) {
    if(Product.Ampics_PL__c != null && Product.Ampics_PL__c.equals('Utilix')) {
        product2ID.add(Product.Id);
    }
}




List<Product2> UpdateProductField = new List<Product2>();

for(Product2 p:[Select Id, Ampics_PL__c,Pieces_in_Pack__c from product2 where Ampics_PL__c = 'Utilix'] )
 {
    Product2.Ampics_PL__c = Product2.Ampics_PL__c;        
     String str = 'Ampics_PL__c';
               String[] sstr = str.split('/');
               system.debug(sstr[0]);
               system.debug(sstr[1]);
}

          
     
update UpdateProductField;   
 
 }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Error: Compile Error: Invalid field Engineering_Projects__c for SObject TeamMember__c at line 14 column 9

Api's

TeamMember__c,  Engineering_Project__c
!
!
!
!
v

TeamRole__c
User__c


public class TeamMemberController {

    public list<TeamMember__c> moreTeamMembers{get;set;}
    ID endProId;
    public TeamMemberController(){
  
        system.debug(apexpages.currentpage().getparameters().get('id'));
        endProId = apexpages.currentpage().getparameters().get('id');
      
        moreTeamMembers = new list<TeamMember__c>();
      
      
        TeamMember__c teamMember = new TeamMember__c();
        teamMember.Engineering_Projects__c = endProId;
        moreTeamMembers.add(teamMember);
      
        TeamMember__c teamMember1 = new TeamMember__c();
        teamMember1.Engineering_Project__c = endProId;
        moreTeamMembers.add(teamMember1);
      
        TeamMember__c teamMember2 = new TeamMember__c();
        teamMember2.Engineering_Project__c = endProId;
        moreTeamMembers.add(teamMember2);
      
        TeamMember__c teamMember3 = new TeamMember__c();
        teamMember3.Engineering_Project__c = endProId;
        moreTeamMembers.add(teamMember3);
      
        TeamMember__c teamMember4 = new TeamMember__c();
        teamMember4.Engineering_Project__c = endProId;
        moreTeamMembers.add(teamMember4);

    }
  
  
    public pagereference mySave()
    {
        for(integer i=0;i<moreTeamMembers.size();i++)
        {
            if(moreTeamMembers[i].User__c != null)
            {
                insert moreTeamMembers[i];
            }
        }
        pagereference pagref = new pagereference('/'+endProId);
        return pagref;
    }
  
    public pagereference myCancel()
    {
       pagereference p = new pagereference('/'+ endProId);
       return p;
  
    }
      

}

page

<apex:page Controller="TeamMemberController" showHeader="false" sidebar="false">  
   <apex:form >
      <apex:pageBlock >
        <apex:pageMessages />
        <apex:pageBlockButtons >
          <apex:commandButton value="Save" action="{!mySave}"/>
          <apex:commandButton value="Save & More" action="{!mySave}"/>
          <apex:commandButton value="Cancel" action="{!myCancel}"/>                    
         </apex:pageBlockButtons>
              <apex:pageBlockTable value="{!moreTeamMembers}" var="TM">
             
              <apex:column headerValue="User">
              <apex:inputField value="{!TM.User__c}"/>
              </apex:column>
             
              <apex:column headerValue="Team Role">
               <apex:inputField value="{!TM.TeamRole__c}"/>
               </apex:column>
             
        </apex:pageBlockTable>
      </apex:pageBlock>
    </apex:form>
  </apex:page>

Csv Error Invalid Csv FileFormat Please select a different file
com.sforce.async.CSVReaders$CSVParseException:Excceded number of records:
10002.Number of records should be less than or equal to 10001

 

I am updating data using dataloader i was geting this error can anybody help me

ProductFieldUpdate: execution of BeforeUpdate

caused by: System.TypeException: Invalid decimal: STEEL 520X4.6MM

Trigger.ProductFieldUpdate: line 18, column 1

 

Here is my trigger code

 trigger ProductFieldUpdate on Product2 (Before insert, before update){
    for(Product2 p : trigger.new){
        if(p.Ampics_PL__c != null && p.Ampics_PL__c == 'UTILUX') {
        if(p.description.lastIndexOf('/') != -1) {
        Integer lastIndx = p.description.lastIndexOf('/');
         p.Pieces_in_Pack__c  = Decimal.valueOf(p.description.subString(lastIndx + 1));
         }
        else {
        p.Pieces_in_Pack__c = 1;
         
        
             }
           }
        }
        }

Where i need to split the value of one custom field and place it in the other custom field i have a developed a trigger

 

trigger ProductFieldUpdate on Product2 (Before insert, before update)
{
     for(Product2 p : trigger.new) {
         if(p.Ampics_PL__c != null && p.Ampics_PL__c == 'UTILUX') {
            if(p.description != null && p.description.contains('/'))
            
            {
               String[] sstr = p.description.split('/');
               p.Pieces_in_Pack__c = integer.valueof(sstr[1]);
            }
              else
              p.Pieces_in_Pack__c = 1;
              
              
          
         }
      }
}

 

if i have a Management/12345  i was getting 12345 there are some other values like  Management/12345(testing/123 i need to retrve the 2nd value in that case can any body help me

I am taking String s ='aa\aa'; and tried to run in developer console, it shows the following error as Invalid string literal 'aa\aa'. Illegal character sequence '\a' in string literal.,,  but i want to save this in object as a record .. how can i do that? 

Error: Compile Error: Entity 'Product' not accessible in version 29.0 at line 1 column 1  please help me thanks in advance

 

 

trigger updateNewvalues on product2 (before update) {


   for (Product2 prod: Trigger.new) {
               if(prod.Ampics_PL__c !=null &&  Product.Ampics_PL__c == 'Utilix') {
                
             String str = 'Utilix';
             String[] sstr = str.split('/');
              system.debug(sstr[0]);
              system.debug(sstr[1]);
           
              System.debug('--*Product Value is changed*--');
              
              System.debug('**Ampics_PL__c  :'+prod.sstr[0]);
              
       }
       
       else{
              prod.Pieces_in_Pack__c = '1';  
       }
   }
}

i want to split the value of one custom field and assaign the value to the other custom field  which are related to product obj

 

 trigger Compare_OldandNewvalues on Product2 (before update) {

   for (Product2 prod: Trigger.new) {
        
     //   if(prod.Ampics_PL__c != Ampics_PL__c.Ampics_PL__c) {
           
     //      prod.Ampics_PL__c = Trigger.product2.get(prod.ID);
     //      String str = 'Utilix';
     //          String[] sstr = str.split('/');
     //          system.debug(sstr[0]);
     //          system.debug(sstr[1]);
     //          prod.Ampics_PL__c = 'sstr[1]';
     //          System.debug('--*Product Value is changed*--');
             //  System.debug('**Ampics_PL__c :'+Ampics_PL__c.sstr[0]);
     //          System.debug('**Ampics_PL__c  :'+prod.sstr[0]);
        }
       }
    //    else{
      //      System.debug('--**Product2 Number has not been Updated**--');
        //    prod.Pieces_in_Pack__c = '1';  
    //    }
   // }
//}

we have two fields in product object  Ampics_PL__c and Pieces_in_Pack__c where we need to fetch the value from Ampics='utilix ' picklist value and assaign to the Pieces_In  for eg  we have Cable/10002  this 10002 must be split and assaign to Pieces_in_Pack__c custom field

 

 

Error:Expression cannot be assigned at line -1 column -1

 

 

trigger UpdateProductField on Product2 (after insert, after update) {

Set<Id> Product2Id = new Set<Id>();

for (Product2 Product : Trigger.new) {
    if(Product.Ampics_PL__c != null && Product.Ampics_PL__c.equals('Utilix')) {
        product2ID.add(Product.Id);
    }
}




List<Product2> UpdateProductField = new List<Product2>();

for(Product2 p:[Select Id, Ampics_PL__c,Pieces_in_Pack__c from product2 where Ampics_PL__c = 'Utilix'] )
 {
    Product2.Ampics_PL__c = Product2.Ampics_PL__c;        
     String str = 'Ampics_PL__c';
               String[] sstr = str.split('/');
               system.debug(sstr[0]);
               system.debug(sstr[1]);
}

          
     
update UpdateProductField;   
 
 }