• Vijay s 16
  • NEWBIE
  • 0 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 1
    Replies
Hi Friends,

      I am using the Google Geo Location API (Free Version 2500 request per day) with SFDC for finding the Latitude and Longitude of a given Address.  I have the requirement within 2500 request per day. So I decided to use the free version itself. Now here I am having a Question:

1) Using Google Geo location free version with salesforce cause any license violation (according to google)?
2) I am planning to deploy this to PROD. Please let me know

--
Thanks,
S. Vijay 
Custom Delete in VF pageHi Friends,

        I have developed a Custom apex page(Detail page) for Account. I have a button called "Delete". It perform delete as standard delete button.While deleting the record, It need to ask as javascript confirmation whether to delele or cancel. I have acheived through the following code, but only in some cases it is working. Once the record  has been deleted the page has to navigate to the standard "https://cs1.salesforce.com/001/o" account page. Can you please correct me. The details as below


VF Page:
<apex:commandButton onclick="deleteAcc()"  id="deleteButton" value="Delete"/>
 <apex:actionFunction name="deleteAccountRecord" action="{!deleteAccountRecord}" rerender="out" status="myStatus">
             <apex:param name="accID" value="{!Account.Id}"/>
        </apex:actionFunction>

  function deleteAcc()
       {
           var retVal = confirm("Are you sure to delete ?");
           if( retVal == true ){
              deleteAccountRecord();
              return true;
           }else{
              return false;
           }
       }



Controller:
     public PageReference deleteAccountRecord() {
        String accID  = ApexPages.CurrentPage().getParameters().get('accID');
        
        Account accDelete = [SELECT Id From Account where Id = :accID];
        delete accDelete;

        PageReference pageRef = new PageReference(/001/o');
        pageRef.setRedirect(true);
        return pageRef;
        
     }
Hi Friends,

        I have developed a Custom apex page(Detail page) for Account. I have a button called "Delete". It perform delete as standard delete button.While deleting the record, It need to ask as javascript confirmation whether to delele or cancel. I have acheived through the following code, but only in some cases it is working. Once the record  has been deleted the page has to navigate to the standard "https://cs1.salesforce.com/001/o" account page. Can you please correct me. The details as below


VF Page:
<apex:commandButton onclick="deleteAcc()"  id="deleteButton" value="Delete"/>
 <apex:actionFunction name="deleteAccountRecord" action="{!deleteAccountRecord}" rerender="out" status="myStatus">
             <apex:param name="accID" value="{!Account.Id}"/>
        </apex:actionFunction>

  function deleteAcc()
       {
           var retVal = confirm("Are you sure to delete ?");
           if( retVal == true ){
              deleteAccountRecord();
              return true;
           }else{
              return false;
           }
       }



Controller:
     public PageReference deleteAccountRecord() {
        String accID  = ApexPages.CurrentPage().getParameters().get('accID');
        
        Account accDelete = [SELECT Id From Account where Id = :accID];
        delete accDelete;

        PageReference pageRef = new PageReference(/001/o');
        pageRef.setRedirect(true);
        return pageRef;
        
     }



 

Hi,

 

The Problem I’m having is that the actionSupport function SearchTemplates from my dependent picklist is only running once when I set the value. When I change the values again it does not run my SearchTemplates method. What is happening is that Salesforce is removing the onchange event from my select list after running the action once. I think this maybe a Salesforce bug. Is there a workaround with out changing my data model?

 

Below is a simple code example of what I am trying to do:

 

Visualforce Page

 

<apex:page controller="TemplateCont" >
<apex:form >
<apex:actionRegion >
<apex:inputField value="{!aTemplate.Category__c}"/>
<apex:inputField value="{!aTemplate.Subcategory__c}">
<apex:actionSupport action="{!SearchTemplates}" event="onchange" rerender="matchingTemplates" status="status"/>
</apex:inputField>
<apex:actionStatus startText=" Please wait..." id="status"/>
</apex:actionRegion>

<apex:pageBlock title="Matching Templates" id="matchingTemplates" >

{!MatchingTemplates.size}

</apex:pageBlock>

</apex:form>
</apex:page>

Controller

 

 

public with sharing class TemplateCont {
public Template__c aTemplate{get; set;}
public List<Template__c> matchingTemplates{get; private set;}
public TemplateCont(){ aTemplate = new Template__c(); matchingTemplates = new List<Template__c>(); } public void SearchTemplates(){ matchingTemplates = [SELECT name, category__c, subcategory__c FROM Template__c where category__c=:aTemplate.Category__c and subCategory__c=:aTemplate.Subcategory__c]; } }

 

 

Would be greatfull for any help.

 

Thanks

 

Peter

  • July 30, 2010
  • Like
  • 0