• bellpoll
  • NEWBIE
  • 0 Points
  • Member since 2012

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 5
    Replies

Hi,

 

I  have the requirement, hide the custom buttons in account Details page usiung jquery,depending up on the picklist value inthe lead object. dont use VFPage(without VFPage)

 

ex:  suppose stage is tha picklist in Lead object with the values (Order, Buy), i have button name is  Continue..

 

so, this button will display only when stage vale equals to "Buy".otherwise button should be in hidden state

 

please give the solution for this requirement

 

 

Thanks  in advance

BABU :)

 

I have the requirement  create a trigger on Attachment object, when i add new attachment ,check the attchment alredy aded or not?

 

i write like this ,please suggest me, is it correct or not?

 

 

trigger dntAddDuplicateAttchmnt on Attachment (before insert) {
if(trigger.isBefore){
for(Attachment atch:Trigger.new){
String parentID=atch.ParentId;
String atchName=atch.Name;
List<Attachment> listatch=[SELECT Name,ParentId FROM Attachment];
if(parentID==trigger.oldmap.get(parentID).ParentId && atchName==trigger.oldmap.get(parentID).Name){
atch.addError(' This file already having with same name in your attachmntes');
}
else if{
for(Attachment at:listatch){
if(at.Name==atchName && at.ParentId==parentID){
atch.addError('This file already having with same name in your attachmntes');
}
}
}

}
}

}

Hi,

 

I  have the requirement, hide the custom buttons in account Details page usiung jquery,depending up on the picklist value inthe lead object. dont use VFPage(without VFPage)

 

ex:  suppose stage is tha picklist in Lead object with the values (Order, Buy), i have button name is  Continue..

 

so, this button will display only when stage vale equals to "Buy".otherwise button should be in hidden state

 

please give the solution for this requirement

 

 

Thanks  in advance

BABU :)

 

I have the requirement  create a trigger on Attachment object, when i add new attachment ,check the attchment alredy aded or not?

 

i write like this ,please suggest me, is it correct or not?

 

 

trigger dntAddDuplicateAttchmnt on Attachment (before insert) {
if(trigger.isBefore){
for(Attachment atch:Trigger.new){
String parentID=atch.ParentId;
String atchName=atch.Name;
List<Attachment> listatch=[SELECT Name,ParentId FROM Attachment];
if(parentID==trigger.oldmap.get(parentID).ParentId && atchName==trigger.oldmap.get(parentID).Name){
atch.addError(' This file already having with same name in your attachmntes');
}
else if{
for(Attachment at:listatch){
if(at.Name==atchName && at.ParentId==parentID){
atch.addError('This file already having with same name in your attachmntes');
}
}
}

}
}

}