• aaryansri
  • NEWBIE
  • 20 Points
  • Member since 2013
  • Oscar

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 17
    Questions
  • 10
    Replies
Hi,

My bacth class execute method based on mulit select picklist values other filed values should update. I wrote below condition it's getting error. Please help me out.

if(pr.NO_OF_EMPLOYESS__C<100 && (includes(pr.Products__c , 'Antivirus') && includes(pr.Products__c , 'Laptop') && includes(pr.Products__c , 'PC'))){
}

Error:Compile Error: Method does not exist or incorrect signature: includes(String, String) 

Suppose I have one checkbox and one inputfile (Choose File). 
The idea is whenever I select/check the checkbox (checkbox value=true) then the ChooseFile (inputfile) will be automatically displayed in my visualforce page. 
Please Help me for this scenario, I've got the following page code & controller code but it doesn't seem to be working.
<apex:inputCheckbox value="{!option}" > <apex:actionsupport event="onclick" action="{!change}" reRender="pg"/> </apex:inputCheckbox> <apex:inputFile value="AttachFile" rendered="{!bool}"/> public Boolean option {get;set;} public Boolean bool {get;set;} public extHospitals(){ bool = false; } public void change() { if(option == true){ bool = true; } else { bool = false; } }when i'm executing this code i'm getting this Error..
Visualforce Error:  
apex:inputFile can not be used in conjunction with an action component, apex:commandButton or apex:commandLink that specifies a rerender or oncomplete attribute.

Is there any solution to achieve this type of scenario
Hi 

  Some buddy help me how many types controllers in salesforce and what are the uses of them with example
 
I have a 2 fields in Communication__c (Custom object).
field 1: Select_Contact__c (Lookup) (from Contact Object)
field 2: Account_Name__c (Text).
In VisualForce Page, when ever user selects the contact from lookup , automatically fetch the Related Account name...and Displayed in Account_Name__C (Apex: OutputText)
How to achieve this by using SOQL Query.
Hi All

           I need a help to write a trigger for update the Activite to  People object in the related list.The person selected in the field Assigned to (lookup to User, std field) matches the peoplekey  of that new lookup to People. Actually, the lookup to people should remain in the backend and be updated automatically every time the Assigned To changes. In other words, we’ll need to:
To find a match to the User Assigned To among the records in People object, and put that matching record into the new lookup.


Hi All,

   I need a help in below image Total Deal Potentila Value is a custome filed in Opportunity object it's a formula(currency) standed Amount value which we giving in local currency value is population in it. Now what i required is the value which showing Total Deal Potentila Value local currency  should show in Opportunity child object related list new filed only local curreny value. How to get local currency value only into related list currency field.

          Image
Hi 


   Opportunity is parent object and Approvel by source is a child object. Under one parent object  multiple  child objects are there. Child object having  "source of child" picklist field values are(CCI,Risk,Revenu,SD).  Parent object also having "source" it is  text field.

 One parent is having multiple childs all the "source of child" values should  update to parent "source"  field seprated by comma. Dupplictes should not be repeat and even we update child  "source of child" that should update in related parent "source" text filed and even if we deleted child record  parent filed should based on that.


  Please help me on the above trigger.


  
Currently the field is displayed as Number.  We want the amount to be displayed in USD or any other currency on the deal. Below is the Nubmer formula


IF(OM_R1_Work_Hours__c <> 0, OM_R1_Services_Revenue__c / OM_R1_Work_Hours__c, 0)
Hi

  I need Mock Response for Testing Web Service Callouts and  test class for below  webservice code can some body help on that the class code covrage is showing 0%.


//Class used to get component record ID to be used in custom buttons without hardcode.//

Global without sharing class GetComponentId{  
WebService static string GetIDbyComponentName(String ComponentName, String ComponentType) {       
   if(ComponentType == 'Report'){        
   String ComponentId = [SELECT Id FROM Report WHERE DeveloperName = :ComponentName LIMIT 1].Id;         
  return ComponentId;     
}else
{            String ComponentId = 'error';  
         return ComponentId;      
  }
  }
}
Hi ,


  I need to write test class for webservice code can some body help on that below is the class code and purpose of the class

Class used to get component record ID to be used in custom buttons without hardcode.

Global without sharing class GetComponentId{   
WebService static string GetIDbyComponentName(String ComponentName, String ComponentType) {        
   if(ComponentType == 'Report'){         
   String ComponentId = [SELECT Id FROM Report WHERE DeveloperName = :ComponentName LIMIT 1].Id;          
  return ComponentId;      
}else
{            String ComponentId = 'error';   
         return ComponentId;       }}}

 Define a Validation on Book Sobject that will not allow to create more than 10            books with cost greater that 500


For this i tried out below trigger code getting error
trigger count on book__c (before insert) {
integer d=[select count() from book__c];
 for(book__c c : trigger.new){

system.debug('***********************'+d);
if(c.price__c >=500)
{system.debug('***********************'+c.price__c);
 insert c;   
}

else
{
 c.adderror('not allowed');
}
}
}

 

Hi

Normally when entering password text shows  in dot format. What i want is instead of dots it should show’ X or * marks and text of each letter should show 5 seconds before converting in to x or *.

  I have 2 sobjects faculty and student. In that faculty is parent and student is child and relation ship is master relation ship. I want to delete parent records with out   deleting linked child records  using DML  operations.

Hi

  Trying to write a trigger for my sobject. If record created time is more than 2 minitus for modified date and time it should not allow to edit.
already i have returned a trigger code,it's not working properly and try to change the existing code it getting error . please some budy help to resolve the issue. The code is below

 trigger Hourschange on transaction__c (before update) {
for(transaction__c s :Trigger.new){
double tm;
tm=((  System.now()-  s.CreatedDate.getTime() ) *1440);
//tm=double.ValueOf(system.NOW()- s.CreatedDate.GetTime())/365;

system.debug('hi::::::::::::::'+DateTime.now());
system.debug('hi::::::::::::::'+s.LastModifiedDate );
system.debug('hi::::::::::::::'+s.CreatedDate ); 

system.debug('hi::::::::::::::'+tm);

if(tm<=1){
system.debug('hi::::::::::::::'+tm);
s.payment_discription__c=' hi';
}
else
{
system.debug('bye::::::::::::::');
s.adderror('Alredy more than 60 minitus');
}
}
}


Before i worked the codition is  
double tm;
 tm= Math.Floor(integer.valueOf( s.LastModifiedDate.getTime()  -  s.CreatedDate.getTime() ) *1440);

hi i am using below code to insert more than governor limits.
getting error of System.LimitException: Too many DML statements: 151: AnonymousBlock: line 12, column 1.

faculty__c fac=new faculty__c();
for(integer i=0;i<=300;i++){
string name='raja';
integer salary=10000;
try{

fac.name=name;
fac.salary__c=salary;
insert fac;
}
catch(Exception e){
system.debug('Hello');
}
}
For the below triggers after insert is written .Please help me to after update. 


1) Enable account team member
follow navigation  setup==>customize==>account====>Account teams .
once you enable this accountteam member object is added to related list of account.
2) create one check box VPA on account object.
now the requirement is:

create one record in account (call parent record) mention VPA enable and don't select parent look up field.
create  one more record in account(call child) uncheck VPA and select (parent record) as parent for this child record using look up.
here VPA is enable means that record is parent other wise it's a child record...

Need to be achieve:
1) once you create a child record then owner of parent record should be add to child   related accountteam member.(parent owner should be insert as accounteam meber to child)
2) if you change the owner in parent it should replace the old owner with new onwer.
I have sobject called Shipment in that city is one record in that already data entered throw staticly contains 'Mumbai''Chenni''Bengalore'and some other cites. In that want to change 'Mumbai' into 'Bombay' 'Chenni' To 'Madras' and 'Bengalore' To 'Bangalore'. Can some body help me how to update the names.
Hi,

My bacth class execute method based on mulit select picklist values other filed values should update. I wrote below condition it's getting error. Please help me out.

if(pr.NO_OF_EMPLOYESS__C<100 && (includes(pr.Products__c , 'Antivirus') && includes(pr.Products__c , 'Laptop') && includes(pr.Products__c , 'PC'))){
}

Error:Compile Error: Method does not exist or incorrect signature: includes(String, String) 
Hi 


   Opportunity is parent object and Approvel by source is a child object. Under one parent object  multiple  child objects are there. Child object having  "source of child" picklist field values are(CCI,Risk,Revenu,SD).  Parent object also having "source" it is  text field.

 One parent is having multiple childs all the "source of child" values should  update to parent "source"  field seprated by comma. Dupplictes should not be repeat and even we update child  "source of child" that should update in related parent "source" text filed and even if we deleted child record  parent filed should based on that.


  Please help me on the above trigger.


  

 Define a Validation on Book Sobject that will not allow to create more than 10            books with cost greater that 500


For this i tried out below trigger code getting error
trigger count on book__c (before insert) {
integer d=[select count() from book__c];
 for(book__c c : trigger.new){

system.debug('***********************'+d);
if(c.price__c >=500)
{system.debug('***********************'+c.price__c);
 insert c;   
}

else
{
 c.adderror('not allowed');
}
}
}

 

Hi

Normally when entering password text shows  in dot format. What i want is instead of dots it should show’ X or * marks and text of each letter should show 5 seconds before converting in to x or *.

Hi

  Trying to write a trigger for my sobject. If record created time is more than 2 minitus for modified date and time it should not allow to edit.
already i have returned a trigger code,it's not working properly and try to change the existing code it getting error . please some budy help to resolve the issue. The code is below

 trigger Hourschange on transaction__c (before update) {
for(transaction__c s :Trigger.new){
double tm;
tm=((  System.now()-  s.CreatedDate.getTime() ) *1440);
//tm=double.ValueOf(system.NOW()- s.CreatedDate.GetTime())/365;

system.debug('hi::::::::::::::'+DateTime.now());
system.debug('hi::::::::::::::'+s.LastModifiedDate );
system.debug('hi::::::::::::::'+s.CreatedDate ); 

system.debug('hi::::::::::::::'+tm);

if(tm<=1){
system.debug('hi::::::::::::::'+tm);
s.payment_discription__c=' hi';
}
else
{
system.debug('bye::::::::::::::');
s.adderror('Alredy more than 60 minitus');
}
}
}


Before i worked the codition is  
double tm;
 tm= Math.Floor(integer.valueOf( s.LastModifiedDate.getTime()  -  s.CreatedDate.getTime() ) *1440);

hi i am using below code to insert more than governor limits.
getting error of System.LimitException: Too many DML statements: 151: AnonymousBlock: line 12, column 1.

faculty__c fac=new faculty__c();
for(integer i=0;i<=300;i++){
string name='raja';
integer salary=10000;
try{

fac.name=name;
fac.salary__c=salary;
insert fac;
}
catch(Exception e){
system.debug('Hello');
}
}