• Suneel14
  • NEWBIE
  • 0 Points
  • Member since 2011

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

Hi, 

 

I wrote a trigger(After Insert) which updates one fields of Lead, but after implementing trigger Auto Response Rule stop working, i searched about it and i found some soluction but that soluction is not working. Could any one help me regarding this.

following is the code : 

 

*/
trigger LeadTrigger on Lead (after insert) {
try {
if(trigger.isAfter) {
set<Id> leadId = new set<Id>();
list<String> clubName = new list<String>();
list<Account> accList = new list<Account>();
list<Lead> leadList = new list<Lead>();
list<Lead> leadListUpdate = new list<Lead>();

for(Lead leadObj : Trigger.new) {

leadId .add(leadObj.Id);
clubName .add(leadObj .Club__c);
}
accList = [select id , Name from Account where Name IN : clubName];

leadList = [select id , Club__c,P_Club__c from Lead where ID IN : leadId ];
for(Lead ldObj :leadList) {


Database.DMLOptions dlo = new Database.DMLOptions();
dlo.EmailHeader.triggerAutoResponseEmail = true;
ldObj.setOptions(dlo);


for(Account accObj :accList) {
if(ldObj.Club__c == accObj.Name) {
ldObj.P_Club__c = accObj .Id;
leadListUpdate.add(ldObj);
}
}

}
if(leadListUpdate.size() >0) {
update leadListUpdate;
}
}

} catch(Exception e) {
}
}

 

Hi All, 

 

I have created a button on button click a thick box will open on this window i am showing a vf page and Save button after clicking on save i want to close thick box  but using this code it is not working 

 

this is Button code:

 

{!REQUIRESCRIPT("/resource/1340776059000/JQueryZip/jquery.js")} 
{!REQUIRESCRIPT("/resource/1340776059000/JQueryZip/thickbox.js")} 
$("body","html").css({height: "100%", width: "100%"}); 

$("body").append("<div id='TB_window' style='position: fixed;background: #ffffff;z-index: 102;color:#000000;border: 2px solid #525252;text-align:left;top:40%;left:40%; width:30%; height:20%'><iframe src='/apex/scheduleInvoice?id={!Opportunity.Id}' height='100%' width='100%'/></div>");

 

in VF Page :

 

<apex:form >
<script language="javascript" type="text/javascript">
function CloseAndRefresh(){
window.opener.location.href="/{!$CurrentPage.parameters.id}";
window.top.close();
}
</script>

 

<apex:pageBlockButtons >
<apex:commandButton value="Save" action="{!Save}" oncomplete="javascript&colon;CloseAndRefresh()"/>


Hi ,

I have created a Conga PPTX Template bcz I have a report which holds photos i want to show photos in separate slide of PPT Template is working fine when report contains more than one record, but as reports holds one single record it is not working.

Template is like this :

{{Photo_Name}}       {{Photo_URL}}
                                       
                                      {{SlideRepeat:ReportData}}


Please help me.

Thank you!

Hi , 

 

i created a Custom Object "Photo" i am saving photo in attctment of this obj. by using formula filed filed i am populating url of image but i want to pass Hieght and widh for image in this url ... i think this is not passible in formula field 

 

'https://c.cs6.content.force.com/servlet/servlet.FileDownload?file=' + Photo_ID__c . Photo_ID__c  is field which is calculating ID of PHOTO obj by Trigger.

 

is there any way to calculate url with hieght and width ..

   

 

thank you !!


Hi ,

 

I am adding contact from account detailpage by clicking a button contact list I am showing in new window after saving I am closing this window and refreshing parent window.

 

Here is code :

 

<script language="JavaScript" type="text/JavaScript">
function Refresh(){
window.opener.location.href="/{!$CurrentPage.parameters.id}";
window.top.close();
}
</script>

 

<apex:pageBlockButtons >
<apex:commandButton value="Save" action="{!Save}" oncomplete="Refresh()"/>
</apex:pageBlockButtons>

 

it is working properly in chrome and fire fox but not working in IE any one can help me.

and in opera even window is closing.

 

Thank You !!!

Hi ,

 

I have created a class in sand box without test class and it is working properly but as per the my requirement I want to inactive this class for a while but I am not able to do it it is throwing error.

 

Hi all,

 

Problem : I have created a custom profile as "Sales Role", i don't want to give permission to this profile user to create or update Contact Role for opportunity, for this i was trying to write trigger on opportunityContactRole object and show error.

it is not possible to write trigger on opportunityContactRole . Is there is any to add a custom button so i can show error msg on button click for this profile user i was also tyring to add button but we can not customize Contact Role Related list from Opportunity Page layout so this is not possible to add custom button, or there is any other way to implement this please help me. 

 

Thank You !!

Hi ,

 

Case : I have created a custom object Users__c with three Field First Name, Last Name, User Name , I have created a VF page with First Name, Last Name , User Name .

 1) After entering Fisrt Name, Last Name  & User Name if User name is already created in records i am using Java Script Remoting and showing a msg 'Available', 'Not Available'  when user will enter user name in User name text box i am calling a function on event onchange this is working .

 

Requerment : in my case i want also show some suggestion value if that user name is not  Not Available . Example scotttiger is already in record suggestion should be Scotttiger.14,scotttiger123 like this .

 

please help me regarding this . 

 

Class:

 

global with sharing class checkusernameTest{
public String Firstname { get; set; }
public String Lastname { get; set; }
public String username { get; set; }
public static Users__c us { get; set; }
public checkusernameTest() {
}
@ RemoteAction
global static Users__c getuser(String username){
system.debug('---------------------'+username);
us = [select id,User_Name__c from Users__c where User_Name__c = :username];
return us;
}
public Pagereference save(){
list<Users__c> uselist = new list<Users__c>();
Users__c u = new Users__c();
u.First_Name__c = Firstname;
u.Last_Name__c = Lastname;
u.User_Name__c = username;
system.debug('========='+u.First_Name__c);
uselist.add(u);
system.debug('*******************Insert Opration');
try{
insert uselist;
}
catch(DMLException e){
ApexPages.addMessages(e);
return null;
}
return null;
}
}

 

 

VF page :

<apex:page controller="checkusernameTest">
<script type="text/javascript">
function getusernameJS() {
var UsernameJS = document.getElementById('{!$Component.form1.block.sec.usernam}').value;
alert('&&&&'+UsernameJS);
if(UsernameJS){
checkusernameTest.getuser(UsernameJS, function(result, event){
if(event.status){
document.getElementById('accid').innerHTML ="Not available";
}
else{
document.getElementById('accid').innerHTML ="Available";
}
}, {escape:true});
}
}
</script>
<apex:form id="form1">
<apex:pageBlock id="block">
<apex:pageMessages />
<apex:pageBlockButtons >
<apex:commandButton value="save" action="{!save}"/>
</apex:pageBlockButtons>
<apex:pageBlockSection id="sec">
<apex:inputText label="First Name" value="{!Firstname}"/>
<apex:inputText label="Last Name" value="{!LastName}"/>
<apex:inputText label="User Name" value="{!username}" onchange="getusernameJS()" id="usernam"/>
<apex:outputLabel title="hi" id="op"/>
</apex:pageBlockSection>
<apex:pageBlockSection id="sec1">
<apex:pageBlockSectionItem id="theFirstItem">
<span id="accid"/>
</apex:pageBlockSectionItem>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>

 

 

Thanks,

Hi ,

 

I have create a VF Page on page i am fetching First Name, Last Name ,User Name from My custom Object User 

i want when i type username if that user name is already stored in user record then it will show a message this user name already exist .

 

Thank You !!

Hi ,

I want after seleting one List View for any object edit link of that view button URL. I want pass in VF page . Is it possible ??

 

Thanks!

Hi,

      I want  a button on my detail page of Account . After click that button I want a VF page which will display name of list view and criteria of list view for that particular record. or only criteria of that list view 

 

Thanks,

Hi , 

       I want to create a VF page in this VF Page I want show all account in a Google map . I have implement a In line VF page in Account which is showing map of every particular account . When I add its page in related list of account .

But I want all account in one VF page with Google map 

here is the code which display particular account location in Google map in related list after adding this page from page lay out : 

 

<apex:page standardController="Account">

<head>

<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script> 
<script type="text/javascript"> 

$(document).ready(function() {
  
  var myOptions = {
    zoom: 15,
    mapTypeId: google.maps.MapTypeId.ROADMAP,
    mapTypeControl: false
  }
  
  var map;
  var marker;
  
  var geocoder = new google.maps.Geocoder();
  var address = "{!Account.BillingStreet}, " + "{!Account.BillingCity}, " + "{!Account.BillingPostalCode}, " + "{!Account.BillingCountry}";
  
  var infowindow = new google.maps.InfoWindow({
    content: "<b>{!Account.Name}</b><br>{!Account.BillingStreet}<br>{!Account.BillingCity}, {!Account.BillingPostalCode}<br>{!Account.BillingCountry}"
  });

  geocoder.geocode( { address: address}, function(results, status) {
    if (status == google.maps.GeocoderStatus.OK && results.length) {
      if (status != google.maps.GeocoderStatus.ZERO_RESULTS) {
      
        //create map
        map = new google.maps.Map(document.getElementById("map"), myOptions);
      
        //center map
        map.setCenter(results[0].geometry.location);
        
        //create marker
        marker = new google.maps.Marker({
            position: results[0].geometry.location,
            map: map,
            title: "{!Account.Name}"
        });
        
        //add listeners
        google.maps.event.addListener(marker, 'click', function() {
          infowindow.open(map,marker);
        });
        google.maps.event.addListener(infowindow, 'closeclick', function() {
          map.setCenter(marker.getPosition()); 
        });
        
      }
      
    } else {
      $('#map').css({'height' : '15px'});
      $('#map').html("Oops! {!Account.Name}'s billing address could not be found, please make sure the address is correct.");
      resizeIframe();
    }
  });
  
  function resizeIframe() {
    var me = window.name;
    if (me) {
      var iframes = parent.document.getElementsByName(me);
      if (iframes && iframes.length == 1) {
        height = document.body.offsetHeight;
        iframes[0].style.height = height + "px";
      }
    }
  }
  
});
</script>

<style>
#map {
  font-family: Arial;
  font-size:12px;
  line-height:normal !important;
  height:250px;
  background:transparent;
}
</style>

</head>
 
<body>
<div id="map"></div> 
</body> 
</apex:page>

Hi All, 

 

I have created a button on button click a thick box will open on this window i am showing a vf page and Save button after clicking on save i want to close thick box  but using this code it is not working 

 

this is Button code:

 

{!REQUIRESCRIPT("/resource/1340776059000/JQueryZip/jquery.js")} 
{!REQUIRESCRIPT("/resource/1340776059000/JQueryZip/thickbox.js")} 
$("body","html").css({height: "100%", width: "100%"}); 

$("body").append("<div id='TB_window' style='position: fixed;background: #ffffff;z-index: 102;color:#000000;border: 2px solid #525252;text-align:left;top:40%;left:40%; width:30%; height:20%'><iframe src='/apex/scheduleInvoice?id={!Opportunity.Id}' height='100%' width='100%'/></div>");

 

in VF Page :

 

<apex:form >
<script language="javascript" type="text/javascript">
function CloseAndRefresh(){
window.opener.location.href="/{!$CurrentPage.parameters.id}";
window.top.close();
}
</script>

 

<apex:pageBlockButtons >
<apex:commandButton value="Save" action="{!Save}" oncomplete="javascript&colon;CloseAndRefresh()"/>


Hi ,

I have created a Conga PPTX Template bcz I have a report which holds photos i want to show photos in separate slide of PPT Template is working fine when report contains more than one record, but as reports holds one single record it is not working.

Template is like this :

{{Photo_Name}}       {{Photo_URL}}
                                       
                                      {{SlideRepeat:ReportData}}


Please help me.

Thank you!

Hi ,

 

I have created a class in sand box without test class and it is working properly but as per the my requirement I want to inactive this class for a while but I am not able to do it it is throwing error.

 

Hi ,

 

I have create a VF Page on page i am fetching First Name, Last Name ,User Name from My custom Object User 

i want when i type username if that user name is already stored in user record then it will show a message this user name already exist .

 

Thank You !!