• Ispita_Navatar
  • PRO
  • 2802 Points
  • Member since 2010

  • Chatter
    Feed
  • 110
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1054
    Replies

Unable to fetch the data.

public class AccountUpdater {

  //Future annotation to mark the method as async.
  @Future(callout=true)
  public static void updateAccount(String id, String name) {

    //construct an HTTP request
    HttpRequest req = new HttpRequest();
    req.setEndpoint('http://cheenath.com/tutorial/sfdc/sample1/data.txt');
    req.setMethod('GET');

    //send the request
    Http http = new Http();
    HttpResponse res = http.send(req);

    //check the response
    if (res.getStatusCode() == 200) {

      //update account
      Account acc = new Account(Id=id);
      acc.Description = res.getBody();
      update acc;
    } else {
      System.debug('Callout failed: ' + res);
    } 
  }
}

 Description is blank. I have used trigger to call this class. and also have added the URL in Remote site. I have checked  Apex Job,it shows job status Completed. I am trying from developer account

Hello,

in master detail relationship can we delete the master object and the child object.If yes how?

 

 

 

 

 

gaurav gulanjkar

 

 

/*****************************************************************************
Name     : Update Owner Manager on the opportunity from the User object

Purpose  : defaults the Owner Manager field of the opportunity from the User


******************************************************************************/
trigger UpdateOwnerManager on Opportunity (before insert, before update ){
  /**
  1. For each opportunity being inserted add User Id value in in Set of User Ids.
  2. Fetch all Users whose Id is in the Set.
  3. Add these fetched Users in a Map <User Id, User object>
  4. for each opportunity being inserted get User from the map and update the field values  
  **/  
  

 //holds User Ids
  Set<Id>setUserIds=new Set<Id>();
  
  //holds a list of Users
  List<User> listUser = new List<User>();
  
  //holds key value pairs of User Id and User Object
  Map<Id, User> mapUserObj = new Map<Id, User>();

  //holds User object
  User UserObj;
   
  //For each opportunity being inserted add User Id value in in Set of User Ids.
  for(Opportunity oppObj : Trigger.new){
    if(oppObj.OwnerId != null){
      setUserIds.add(oppObj.OwnerId);
    }
  }
  
  //Fetch all Users whose Id is in the Set.
  listUser = [Select u.Manager.Email, u.ManagerId From User u];
  if(listUser.size() == 0){
    return;  
  }
  
  //Add these fetched Users in a Map <User Id, User object>
  for(User usrObj : listUser){
    mapUserObj.put(usrObj.Id, usrObj);  
  }
  
  //for each opportunity being inserted get User from the map and update the field values
  for(Opportunity oppObj : Trigger.new){
    //get User object
    if(oppObj.OwnerId != null){
      if(mapUserObj.containsKey(oppObj.OwnerId)){
        UserObj = mapUserObj.get(oppObj.OwnerId);
        //map opportunity fields to User fields
        oppObj.Manager_of_record_owner__c = UserObj.Manager.Email;
      }  
    }
  }
}

Does anyone know how to send an email, from a template, via apex code, as someone other than the currently logged in user? Maybe using a company org-wide email?

Hello,

    Is there any way to assign tasks to multiple users besides creating other custom field?

  

 

TIA!!!

Hello,

I am trying to use a variable in the order by clause of a SOQL statement, like this:

 

enrollmentLongArr = [select E.Id, E.Name, E.Course__c, E.Course__r.Name, E.Case__c, E.Repeat_Class__c, E.Number_Of_Cases__c, E.Enrollment_Status__c, E.Date_of_Withdrawal__c, E.CreatedDate, E.Final_Grade__c from Enrollment__c E where E.Student__c = :accountId order by E.Course__r.Name :direction ];

 

where :direction will either be asc or desc.

 

I keep getting an error when I try to save my class:

save error: unexpected token ':'

 

What am I doing wrong?

  • November 21, 2011
  • Like
  • 0

I was trying to build a weekly report of of completed activities.  I want to know WHEN the status was changed to Completed.  When I went in to create a new report, History was no whereto be found.  So I thought History Tracking was not turned on on the Activity object, but when I went to check, I found that it was not an option.  No worries, I thought I would just go in and create a new report type to solve the problem, but can't seem to do it there either.  

 

Any advice here?  Again, I'm not looking for a simple list of completed activities, I'm looking for the date that represetns WHEN the status was changed to Completed.  I think on a custom object, I would just turn history on and report against those records, but having problems doing that on the Activity object.

 

TB

I have looked through a number of board discussions and read through the related articles but cannot seem to get a solution to work so any help is really appreciated!  I have a VF that I have built that works great.  The only issue I have is that when it requires more than one page, it most often puts the page break in the middle of one of the tables.  Is there anyway to have a dynamic page break that is not driven by number of records?  I ask this because I want it as much on a single page as possible but there are two tables and I do not know how to do number of records when I am dependent on two different tables populating that will have a different number of records each time? 

 

Also, if possible to add page numbers that would be great but not as important as the dynamic page break.

 

Below is the code of the page I need this on.

 

Thanks!!

 

<apex:page renderas="PDF" standardController="Account" showHeader="false" sidebar="false">
<p><b><font size="4">{!Account.Name}</font></b></p>
<p><b><font size="2">Claim Check as of {!if(Month(Today())=1,"January","")}{!if(Month(Today())=2,"February","")}{!if(Month(Today())=3,"March","")}{!if(Month(Today())=4,"April","")}{!if(Month(Today())=5,"May","")}{!if(Month(Today())=6,"June","")}{!if(Month(Today())=7,"July","")}{!if(Month(Today())=8,"August","")}{!if(Month(Today())=9,"September","")}{!if(Month(Today())=10,"October","")}{!if(Month(Today())=11,"November","")}{!if(Month(Today())=12,"December","")} {!Day(Today())}, {!Year(Today())}
</font></b></p>
<p></p>
<p><b>RELATED POLICIES:</b></p>
<table border="1" cellspacing="2" cellpadding="5">
<tr>
<th>Policy Number</th>
<th>Policy Period</th>
<th>Underwriter</th>
<th>Underwriting Branch Office</th>
</tr>
<apex:repeat var="rp" value="{!Account.Policies5__r}">
<tr>
<td>{!rp.Name} </td>
<td><apex:outputText value="{0,date,MM/dd/yyyy}"><apex:param value="{!rp.Effective_Date__c}"/></apex:outputText> - <apex:outputText value="{0,date,MM/dd/yyyy}"><apex:param value="{!rp.Expiration_Date__c}"/></apex:outputText></td>
<td>{!rp.Underwriter__r.Name}</td>
<td>{!rp.Underwriting_Branch_Office__c}</td>
</tr>
</apex:repeat>
</table>
<p><b>RELATED CLAIMS:</b></p>
<table border="1" cellspacing="2" cellpadding="5">
<tr>
<th>Claim Number</th>
<th>Insured</th>
<th>Claimant Name</th>
<th>Policy Number</th>
<th>Claim Status</th>
<th>Date Reported</th>
<th>Examiner</th>
</tr>
<apex:repeat var="rc" value="{!Account.Claims__r}">
<tr>
<td>{!rc.Name} </td>
<td>{!rc.Insured_Lookup__r.name}</td>
<td>{!rc.Claimant_Name__c}</td>
<td>{!rc.Policy__r.name}</td>
<td>{!rc.Status__c}</td>
<td><apex:outputText value="{0,date,MM/dd/yyyy}"><apex:param value="{!rc.Date_Reported__c}"/></apex:outputText></td>
<td>{!rc.Owner.name}</td>
</tr>
</apex:repeat>
</table>
<p/>
<div class="bPageFooter" id="bodyFooter"><div class="footer">Privileged and Confidential - LVL Claims Services, LLC</div></div>
</apex:page>

  • November 16, 2011
  • Like
  • 0

I want to disable all Chatter emails for my users when they are created (we load our users via daily feed).

 

I can't seem to identify the correct field in the user object which holds the setting.  I see the one which auto-subscribes users to records/feeds, but I can't find the one which disables Chatter emails completely.

 

Anyone know?

  • November 16, 2011
  • Like
  • 0

In a Task an email notification can be sent but it is sent when the event is created. Is there a way to create a rule to make it so that the email is sent 24 hours before the task is due?

 

 

I have a piece of HTML string which needs to be rendered as PDF. This piece of HTML is dynamic, i.e., the contents are not known in advance.

 

I am using the following code to render as pdf and prevent escaping of HTML:

 

<apex:page controller="ControllerPdf" renderAs="pdf">

  <apex:outputText value="{!HTMLString}" escape="false"></apex:outputText>

</apex:page>

 

This works perfectly in developer mode! But when I access via Sites the HTML is escaped! It just spits out the HTML as it is in the PDF.

Is this a limitation of Sites or is there any setting related to Sites that I should be looking at?

Thanks in advance.

Can I modify the page layout to include Account when hitting the NEW button following a lookup search?  I cant find it anywhere.

 

Scenario - I have a lookup field to Contacts on a custom object.  I enter the 1st part of a name and hit the lookup/magnifying glass to see if locates a match.  It does not, so I hit NEW.  That opens up a window similar to a mini page view...but Account is not on it.  

 

Can I modify this layout to include Account?  If so, where?  If not, any other (simple) suggestions?

 

Thanks!

Hello,

 

I want to create an appexchange application where I will be able to enable/disable features. More specific, initially, I want to have some features enabled and some disabled. Then I will provide a key to the user, so that the enabled features will be disabled and vise verca. Is that possible in a managed package in a Salesforce application?

 

Thanks,

Mike.

  • November 14, 2011
  • Like
  • 0

Hello all

 

I try to make a custom field in contact that can execute some JavaScript code when it is clicked to realize a click to dial phone number field.

 

With a custom field in contacts with the following formula I could already invoke JavaScript but this also opens a new empty window:HYPERLINK("javascript&colon;alert('I should dial to  " & Phone & "  now')", Phone)

HYPERLINK("javascript&colon;alert('I should dial to  " & Phone & "  now')", Phone)

 Is there a way doing that without opening a new window?

 

In HTML it should look for example like this:

<a href="DialTo:(111)222-3333" onClick="alert('I should dial to (111)222-3333');return false;">(111)222-3333</a>

 

 

Thank you for suggestions,

Matthias

  • November 14, 2011
  • Like
  • 0

I want check country account this page is match country visited object. But it not work not show when click save

 

 

public PageReference save()
    {
    
    Account AccS = [Select id,Country__c from Account Where id =: objCus[0].AccountID__c];
    String CountryName = Accs.Country__c;
    Boolean CheckCountry = False;
    List<Country_Visited__c> lstCRV = [Select id,Name from Country_Visited__c Where Customer_Visit_ReportID__c =:    objCus[0].Customer_Visit_ReportID__c];
    
    for(Country_Visited__c CRV : lstCRV){
        if(CRV.Name == CountryName){
            CheckCountry = True;
        }
    }
    
    if(CheckCountry == True){
      
        if(objCus.size()>0)
        {  
            CountryVisited();      
            
            List<Customer_Visited__c > lstCV = [Select id from Customer_Visited__c Where AccountID__c =: objCus[0].AccountID__c];
            
            objCus[0].Nums__c = lstCV.size();        
            insert objCus;
            CusID = objCus[0].id;
            
            
        }
        insertExistingProduct(); 
        insertNewProduct();
        insertTask();
        CreateOpportunity();       
        
        return Cancel();
        }
        showmessage = 'True';
        return null;
    }
    
    public string showmessage
    {
        get;set;
    }

 Page 

 

<apex:pageBlock id="pageBlock" mode="edit">
        <apex:pageBlockButtons >
                <apex:commandButton value="Save" action="{!save}"   rerender="error" onclick="showmsg()"/>
                <apex:commandButton value="Cancel" action="{!Cancel}" rerender="error"/>                                           
        </apex:pageBlockButtons>
</apex:pageBlock>


<script> 
function showmsg(){
if('{!showMessage}'=='True'){

    alert('your message!'); 
    return false;

}
}
</script> 

 Thank so much.

Hi

 

i want to hide the salesforce provided Help link which is available in all pages.

especially i want  to hide th link in Relates list, for example"Open Activities Help" in Open Activities related list.

 

is there any option to hide this link by configuring Layouts or through profiles or any options for this?

 



 

Thank you for the Help..

Hi 

i am trying to open an another vf page in the same window and after doing my wrk in that page i want to return back to the same page but i am unable to do it right now my page is opening in a new window and after saving it is continuing in the new page.

Can any one help me with this.

<apex:page standardController="Opportunity" extensions="ContactRolesShowController">
  <style type="text/css">
     .style1{ font-size: 12px;
            font-family: arial;
            color: black;
            font-weight:normal; }   
     .style2{ font-size: 12px;
            font-family: arial;
            color: Yellow;
            font-weight:normal; }
 </style>

<script language="javascript">
        function confirmDelete(IdVal){
            if(confirm('Are you sure you want to delete?'))
                callRemoveFn(IdVal);
            else
                return false;
        }
    </script>

  <apex:form id="contactRoleForm">
  <p align="center" >
     <apex:commandButton value="Add/Edit Contact Roles" onclick="window.open('/apex/ContactRolePage?id={!opty.Id}')"/>
  </p>

       <apex:outputPanel id="msg"> 
        <apex:pageMessages /> 
     </apex:outputPanel>  
        <apex:pageBlock mode="maindetail">
           <apex:pageBlockTable id="table" value="{!OpportunityContactRoleRecords}" width="1000px" var="ocr" columns="7" cellpadding="5px" rendered="{!isNoOcr == False}" rows="{!rowsToDisplay}"> 
               <apex:column id="removeColumn" width="50px">     
                   <apex:facet name="header">&nbsp;&nbsp;&nbsp;&nbsp;Action&nbsp;&nbsp;&nbsp;&nbsp;</apex:facet>  
      
                      <apex:commandlink value="Edit" onclick="window.open('/apex/ContactRolePage?Id={!opty.Id}')" style="color:blue"/>  
                       &nbsp;|&nbsp; 
                      <apex:commandlink value="Del" onclick="confirmDelete('{!ocr.Id}');" style="Color:Blue" rerender="msg">
                      </apex:commandlink>
              </apex:column>
             
              
              <apex:column id="contactColumn">
                  <apex:facet name="header">Contact</apex:facet>          
                   <apex:outputLink target="_top" value="/{!ocr.ContactId}">{!ocr.Contact.Name}
                   </apex:outputLink>
              </apex:column> 
                            
              <apex:column id="clientColumn">
                  <apex:facet name="header">Client</apex:facet>          
                   <apex:outputLink target="_top" value="/{!opty.Local_Client__c}">{!opty.Local_Client__r.Name}
                   </apex:outputLink>                   
              </apex:column> 
              
              <apex:column id="emailColumn">
                  <apex:facet name="header">Email</apex:facet>          
                  <apex:outputText value="{!ocr.Contact.Email}"/>
              </apex:column> 
              
              <apex:column id="phoneColumn">
                  <apex:facet name="header">Phone</apex:facet>          
                  <apex:outputText value="{!ocr.Contact.Phone}"/>
              </apex:column>
                           
              <apex:column id="roleColumn">
                  <apex:facet name="header">Role</apex:facet>          
                  <apex:outputText value="{!ocr.Role}"/>
              </apex:column>
                            
              <apex:column id="isPrimaryColumn">
                  <apex:facet name="header">Primary</apex:facet>          
                  <apex:inputCheckbox value="{!ocr.isPrimary}" disabled="true"/>
              </apex:column>              
          </apex:pageBlockTable>
           
            <apex:actionFunction action="{!remove}" name="callRemoveFn" rerender="contactRoleForm,msg">
              <apex:param value="" name="ocrId"/>
            </apex:actionFunction>
           
          <br/>
          <apex:outputPanel id="noOcr" rendered="{!isNoOcr}">
            <apex:outputText value="No ContactRoles" />  
          </apex:outputPanel> 
          <apex:outputPanel style="margin:0px;padding:10px;padding-top:5px;" rendered="{!isShowMore}"> 
               <apex:commandlink Value="xxx"  target="_top"  oncomplete="window.top.location = '/apex/ContactRoleRecordsListPage?optyId={!opty.Id}'"/>
          </apex:outputPanel>  
     </apex:pageBlock>   
  </apex:form>
</apex:page>
public with sharing class ContactRolesShowController {
    
    public Opportunity opty{get;set;}
    public String ocrId{get;set;}
    public Boolean isNoOcr{get;set;}
    public Integer rowsToDisplay{get;set;}
    public Boolean isShowMore{get;set;}
    public Integer totalOCR{get;set;}
    public boolean noshowRemove{get;set;}
    public Boolean hasAccess{get;set;}
    private ID oppId;
       
    public ContactRolesShowController(ApexPages.StandardController stdctrl) {
    
        Opportunity optyRecord;
        Id optyId = ApexPages.currentPage().getParameters().get('optyId');    
        oppId=optyId;
        System.debug('---OpportunityID------'+optyId);
        if(optyId !=null)
            optyRecord = new Opportunity(Id = optyId);
        else
            optyRecord = (Opportunity)stdctrl.getRecord();
        
        opty = [select Name, AccountId,Local_Client__c,Local_Client__r.Id,Local_Client__r.Name,OwnerId from Opportunity where Id =: optyRecord .Id];
        isNoOcr = false;
        getOpportunityContactRoleRecords();
        System.debug('---constructor------');
        List<Profile> noEditAccessProfiles = [select Id,Name from Profile where Name ='LEGAL_USER' or Name = 'FINANCE_USER'];
        
        for(Profile p : noEditAccessProfiles) {
            if(p.Id == UserInfo.getProfileId()) {
                noshowRemove = true;
                break;
            }   
        }
       
        if(getCheckSystemAdmin()) 
            noshowRemove = false;
        else if(opty.OwnerId == UserInfo.getUserId())
            noshowRemove = false;   
        else {
            List<AccountTeamMember> teamMemberList = [Select a.UserId, a.TeamMemberRole, a.SystemModstamp, a.LastModifiedDate, 
                a.LastModifiedById, a.IsDeleted, a.Id, a.CreatedDate, a.CreatedById, a.AccountId, 
                a.AccountAccessLevel From AccountTeamMember a where a.accountId =: opty.Local_Client__c];
            
            if (teamMemberList != null && teamMemberList.size() > 0 ) {
                Map<String, String> teamMembersMap = new Map<String, String>();
                for (Integer i=0; i< teamMemberList.size(); i++) {
                    teamMembersMap.put(teamMemberList[i].userId, teamMemberList[i].userId);
                }
                String myUserId = teamMembersMap.get(UserInfo.getUserId());
                if (myUserId != null ) {
                    noshowRemove = false;
                }
                else
                    noshowRemove = true;
            }
        }       
    }
    
/*    public PageReference ContactRolePage(){
        PageReference p;
        oppId = ApexPages.currentPage().getParameters().get('Id');    
        p = new PageReference('/apex/ContactRolePage?id='+oppId);
        return p;
    }
*/    
    public Boolean getCheckSystemAdmin()
    {
     List<Profile> Prof;
      Prof = [Select id from Profile where Name = 'System Administrator' or Name = 'L2_LOB/REGION_SYS_ADMIN'];
      
        for(Profile p :Prof)
        {
            if (UserInfo.getProfileId()== p.Id)
                return true;
        }
        
        return false;
    }
    public List<OpportunityContactRole> getOpportunityContactRoleRecords() {
        
        rowsToDisplay = 0;
        totalOCR = 0;
        List<OpportunityContactRole> ocrList = new List<OpportunityContactRole>();
        ocrList = [select Id,ContactId,role,OpportunityId,IsPrimary,Contact.Email,Contact.Phone,Contact.Name from OpportunityContactRole where OpportunityId =: opty.Id];    
        if(ocrList.size() == 0)
            isNoOcr= true;  
        
        if(ocrList.size() > 5) { 
            rowsToDisplay =5;
            isShowMore = true;
        }   
        else {
            rowsToDisplay = ocrList.size();
            isShowMore = false;
        }
        totalOCR = ocrList.size();
        return ocrList;        
    }
    
    
    
    public void remove()
    {
        ocrId = ApexPages.currentPage().getParameters().get('ocrId');    
        System.debug('-------ocrId-------'+ocrId);
        OpportunityContactRole delOcrRecord = new OpportunityContactRole(Id = ocrId);
        try {
            delete delOcrRecord;
        }
        catch (DMLException de)
            {
              if(de.getMessage().contains('INSUFFICIENT_ACCESS_OR_READONLY') || de.getMessage().contains('INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY'))
              {
                ApexPages.addMessage(new ApexPages.Message (ApexPages.Severity.Info, 
                                   'Insufficient privileges - You do not have the level of access necessary to perform the operation you requested. Please contact the owner of the record or your administrator if access is necessary. ' ));
              }
              else {
                ApexPages.addMessage(new ApexPages.Message (ApexPages.Severity.ERROR, 
                                   'DML Error: '+ de.getMessage ()));
              }
            }      
        getOpportunityContactRoleRecords();
    }
    
    public pageReference goToList() {
        PageReference pageRef = new PageReference('/apex/ContactRoleRecordsListPage?optyId='+opty.Id);  
        pageRef.setRedirect(true);
        return  pageRef; 
    
    }
    
    public PageReference cancel() {
        PageReference pageRef = new PageReference('/'+opty.Id);
        pageRef.setRedirect(true);
        return  pageRef;
    }   
    
}

 

 

 

  • November 10, 2011
  • Like
  • 0

Hi all,

 

I am starting to create a visualforce page to create a tabbed account page and this is my code for the style and the relevant code for the visualforce page:

 

<apex:page standardController="Account" showHeader="true" tabStyle="Account" standardStyleSheets="false">
	
	<!-- Defino estilos para los tabs del segundo Panel -->
	<style>
              .activeTab2 {color:black; background-image:{!$Resource.TabAmarilloDifuminadoActiva}}
              .inactiveTab2 {background-color: #F2F5A9; color:black; background-image:none}
         </style>

<apex:tabPanel switchType="client" selectedTab="tabdetails" id="AccountExtraTabPanel" tabClass="activeTab2"
	inactiveTabClass="inactiveTab2">
		
		<apex:tab label="Administrative/Finance" name="AdministrativeInfo" id="AdministrativeInfo">
		</apex:tab>		
		
		<apex:tab label="Commercial" name="CommercialInfo" id="commercialInfo">label for commercial
		</apex:tab>
		
		<apex:tab label="Operational" name="OperationalInfo" id="OperationalInfo">
		</apex:tab>
		
		<apex:tab label="Technical" name="TechnicalInfo" id="TechnicalInfo">
		</apex:tab>
		
		<apex:tab label="Product Profile" name="ProductInfo" id="ProductInfo">
		</apex:tab>
		
		<apex:tab label="Destinos" name="DestinosInfo" id="DestinosInfo">
		</apex:tab>
	
	</apex:tabPanel>
	
</apex:page>

 

Because in the standard tab panel options, in the tabs salesforce degradates the colour from green to grey. I want to do the same but from yellow to grey in the tabs of my panel. So i created an image, called TabAmarilloDifuminadoActiva but I still see it with the green Salesfroce defatul image.

 

Could you please help me for my image to be loaded in the active tab?

 

Thanks a lot!

 





Hi All,

 

            Is there anyway to make the text field value to appear as link to record in standard Salesforce report functionality. Similar to standard 'Name' fields. So that user can navigate to related record by clicking on the link.

 

 

- Logesh

  • November 10, 2011
  • Like
  • 0

Hello everyone,

 

Is there any way to let a user convert leads only if he is the owner?

 

Thanks in advance!

  • November 10, 2011
  • Like
  • 0

Unable to fetch the data.

public class AccountUpdater {

  //Future annotation to mark the method as async.
  @Future(callout=true)
  public static void updateAccount(String id, String name) {

    //construct an HTTP request
    HttpRequest req = new HttpRequest();
    req.setEndpoint('http://cheenath.com/tutorial/sfdc/sample1/data.txt');
    req.setMethod('GET');

    //send the request
    Http http = new Http();
    HttpResponse res = http.send(req);

    //check the response
    if (res.getStatusCode() == 200) {

      //update account
      Account acc = new Account(Id=id);
      acc.Description = res.getBody();
      update acc;
    } else {
      System.debug('Callout failed: ' + res);
    } 
  }
}

 Description is blank. I have used trigger to call this class. and also have added the URL in Remote site. I have checked  Apex Job,it shows job status Completed. I am trying from developer account

Hi,

 

Why do the ID for Static Resource is changed everytime it is updated?

 

Also if I add Static Resource e.g. Javascript file, use it in a Custom Home Page Component and add Custom Home Page Component to Package then:

1. Will Static Resource be added automatic to the Package or we need to add it manually?

2. When a package with Static Resource is deployed, will the ID for Static Resource change?

 

Thanks,

Prasad

Hi All,

 

I am new to apex Web service development. So pleases help me out in understanding best practices for the apex web service development. And what are thing which we should keep in mind while writting the services.

 

Thanks,

Kunal.

I have been advised I need an Apex Trigger.

 

I have a custom field on both Accounts and Leads (text field) called Reg Num and I also have another custom field (check-box) on Leads called Reg Num matches an account.

I would like the check-box to show a tick if the Reg Num on the Lead matches the Reg Num of any account.

How / where do I do this?

Thanks in advance.

I need to get new button in lookup window for custom object.

  • November 25, 2011
  • Like
  • 0

hey Ragjesh your code helped me a lot but am getting null value in my controller can you suggest me the exact solution of this problem

 

 

here is my code:

Apex Code:

<apex:actionFunction name="sendTimeStamp" action="{!sendTimeStamp}">
    <apex:param name="x" value="x" assignTo="{!timeStampValue}" />
    </apex:actionFunction>

javascript code:

timeStamp = Number(new Date());
          sendTimeStamp(timeStamp);

controller code:


public string sendTimeStamp() 
    {
        return timeStampValue;
    }
    public string timeStampValue{
    get
    {
        timeStampValue = timeStamp;
        return timeStampValue;
    }
    set;}

 please Help me i am newbie in salesforce

 

i dont know where i am making mistakes?

Hi,

    I wanna write a trigger .This trigger gets fired when I change a field (a1__C) in custom object A.This trigger should write thje following message

" a1__c has been changed in A".This message is stored in notes feild (B1__c)  of custom object B. Every time there is a change in A , a new entry is made in B. B has only one field i.e B1 which is of text area type.

        Please help me on this it's urgent!!!!

Thanks

Hi,

 

1) I have an question, will roll up fields work in the back end and similarly if i have referenced some fields via rollup in an workflow and if i do not display the same on the page layout will these WF run.

2) Suppose i keep a roll up field on the page layout for the system admin and if i have a different page layout for other users then will the related workflow run for the other profiles/page layouts....

 

 

Hello All...

 

                       Can anyone tell me how to add a Validation to a PickList.

The Scenario is something Like this. I have a Areas fields of type Multi select Picklist and Probably 10 Values. At the time of Creation i should be able to Select a maximum of Three areas only.

 

                      How can i add the validation to the Multiselect Picklist

Hello,

in master detail relationship can we delete the master object and the child object.If yes how?

 

 

 

 

 

gaurav gulanjkar

I am getting issue while dealing with record types.

 

i have an object Estimate.

followng are the fields...

Name

Date

Desctiption

and Approve (Check box)....

 

i have two different pagelayouts based on Approve check box...

(i am using record type and assigning them layout and based on workflow rule i am updating the field type)

 

 

it works fine in my dev org,,, but when i am creating package and installing it in new org then i am not getting such kind of assignment for Recordtypes as i did in my org....

what i am doing wrong?

1. The eclipse Git plugin seems to have no way of removing files from source control except by command line.

 

2. I don't want to keep managed packages in source control, but I am unable to remove them even if I DO use the command line! They just keep coming back.

 

I want to roll out Git to the company I work with, and these are looking like show-stoppers, I've spent days ... maybe just missing something obvious? Any help much appreciated!

 

 

 

 

  • November 24, 2011
  • Like
  • 0

Hi,

 

I have a requirement where we set a custom Fiscal Year in the Fiscal year settings and I need to access this in the formula fields but I'm unable to do that. Can you please suggest any work around for this. 

 

Thank You

 

 

/*****************************************************************************
Name     : Update Owner Manager on the opportunity from the User object

Purpose  : defaults the Owner Manager field of the opportunity from the User


******************************************************************************/
trigger UpdateOwnerManager on Opportunity (before insert, before update ){
  /**
  1. For each opportunity being inserted add User Id value in in Set of User Ids.
  2. Fetch all Users whose Id is in the Set.
  3. Add these fetched Users in a Map <User Id, User object>
  4. for each opportunity being inserted get User from the map and update the field values  
  **/  
  

 //holds User Ids
  Set<Id>setUserIds=new Set<Id>();
  
  //holds a list of Users
  List<User> listUser = new List<User>();
  
  //holds key value pairs of User Id and User Object
  Map<Id, User> mapUserObj = new Map<Id, User>();

  //holds User object
  User UserObj;
   
  //For each opportunity being inserted add User Id value in in Set of User Ids.
  for(Opportunity oppObj : Trigger.new){
    if(oppObj.OwnerId != null){
      setUserIds.add(oppObj.OwnerId);
    }
  }
  
  //Fetch all Users whose Id is in the Set.
  listUser = [Select u.Manager.Email, u.ManagerId From User u];
  if(listUser.size() == 0){
    return;  
  }
  
  //Add these fetched Users in a Map <User Id, User object>
  for(User usrObj : listUser){
    mapUserObj.put(usrObj.Id, usrObj);  
  }
  
  //for each opportunity being inserted get User from the map and update the field values
  for(Opportunity oppObj : Trigger.new){
    //get User object
    if(oppObj.OwnerId != null){
      if(mapUserObj.containsKey(oppObj.OwnerId)){
        UserObj = mapUserObj.get(oppObj.OwnerId);
        //map opportunity fields to User fields
        oppObj.Manager_of_record_owner__c = UserObj.Manager.Email;
      }  
    }
  }
}

I have a contact with a lookup to an account - when the user selects the lookup, I need him to be able to see all accounts - not just recent or those beginning with a certain letter.

 

Is there any way to do this?

 

The plan is to then use the enhanced lookup filter to allow him to filter on the town and city fields.

Hi,

 

I am trying to use the LastLoginDate from user object to be used in a custom object. But i cant seem to find the field in the formula editor.

 

Is there a way we can do it?

  • November 17, 2011
  • Like
  • 0

Hi Friends,

                      I want to create Visualforce page that when given a contact ID will display that contact, the account that it is associated to, as well as the billing addresses of each (which should be the same).  Can anyone help me out to write this..........Thanks in advance

We've removed the Outlook plug in for Salesforce from a user's machine, but he keeps getting a message box that need to click about ten times to remove it when Outlook is initially launched.  The message is

 

Salesforce Outlook Edition 3

 

Error 1325. Favorites is not a valid short filename

 

Anyone have any tips?

I just installed Salesforce for Outlook on all of our users computers today. The problem I'm running into is that I uploaded all of our contacts. They can see them when they log into Salesforce but they are not seeing them in their Outlook. Now when I had one of the users follow a couple of the contacts they then appeared in their contacts.

 

How can I get it for each user to see all our of contacts without having to go through and follow every single one?

I downloaded and installed offline access for our users and created a new briefcase configuration for different users - but when users are in their set-up mode they can't select the briefcase configuration I created. I made sure to activate the briefcase configurations. Am I supposed to assign it to them?