• suresh dupada
  • NEWBIE
  • 275 Points
  • Member since 2014

  • Chatter
    Feed
  • 3
    Best Answers
  • 0
    Likes Received
  • 2
    Likes Given
  • 41
    Questions
  • 28
    Replies
Hi All,

I want to find out the shortcut keys to open up the Apex class pages.Just like 066 would open the VisualForcePages.

Regards,
Seshagiri Rap
I have a pop up that is being shown, however the page is not directing back up to the top (where the pop up is)

I would like the pop up to be shown in the centre of the page when it appears

Can anybody offer any help?

My Css:

.custPopup{
    background-color: white;
    border-width: 2px;
    border-style: solid;
    z-index: 9999;
    left: 50%;
    padding:10px;
    position: absolute;
    /* These are the 3 css properties you will need to change so the popup 
    displays in the center of the screen. First set the width. Then set 
    margin-left to negative half of what the width is. You can add 
    the height property for a fixed size pop up if you want.*/
    width: 500px;
    margin-left: -250px;
    top:100px;
    font-size: 15px; 
    border-color: #da3e00;
}
.popupBackground{
    background-color:black;
    opacity: 0.20;
    filter: alpha(opacity = 20);
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 9998;
}



Thankyou in advance,

Lewis 

Hi All
I am facing issue with code compare between two org
for Example
in Dev_Org: I have pages and classes with custom lables and all developed components will be moving to Package_Org (Where I have created Namespace for managed package to publish into SF app exchange)

my Issue here is I have implemented hundreds of classes and pages. my developers concurrently working in Dev_Org and I should move this changes to Package_Org, I am using eclipse for deployment, but before deployment I always compare code between two org. and what ever the necessary changes I will deploy into another org. I am facing issue with nameSpace prefix. because take  page-1 I have used custom lables in it. and initially i deployed code to Package_Org. but in next deployment I have to move to page-2 but I should consider other changes for this purpose I am comparing code here if you observe I dont have any changes in page-1 right. but in code compare I got page-1 in the code difference list, due to namespace prefix appended in package_org.

Eg.,

page-1 in Dev_org
<apex:page>
     {!Label.HellowMessage}
<apex:page>
page-1 in Package_Org
<apex:page>
     {!Label.Namespace__HellowMessage}
<apex:page>
But like this happens for all the pages. I should really inspect each and every page unnecessarely wihout having code changes in it. what should I do. also I found some of the cusom labels dont have prefixed with nameSpance for them, why?
Eg.,
page-1 in Dev_org
<apex:page>
     {!Label.HellowMessage}
     {!Label.goodMorning}
<apex:page>
page-1 in Package_Org
<apex:page>
     {!Label.Namespace__HellowMessage}
     {!Label.goodMorning}  -  (why this custom lable dont have prefix)
<apex:page>

 

 

 

 


 

Hi All,

1. can any one tell me how to make standardstylesheet to be false from javascript

2. or how can i identify I am in SF Classic view or SF lightening view, from apex when page was loading

actually some we can identify we are in lightening or classic based on some javascript functions, 

3. Actual problem is I implemented one vf page and override with new button, so this page is good for classic view when creating new record, but when i open in lightening view, it is visibling like classic, while create new record. is there any best approach around this.

Hi all,
            I am hitting an heep size limit while serializing my records, I need to send this records as a response, so below my serializePretty method
actually result =[select Id, name ... from object]; ----------------> it returns nearly 8000 records, so i Need to  serializ 8000 records, and send to response in rest resources..... how to over come this issue
 
  return JSON.serializePretty(result);
ex :: below string contain accents
( Et ça sera sa moé  )

How Do i remove accents in apex, I need out put string as below
 ( Et ca sera sa moe )

Hi All

           I am Trying to calculte Total amount as showned below imageUser-added image
 

I want to calculate total amouut field at the end of the row based on row values  
I want to add all vaues starting from 4th cell up to  7 th cell and total should be at 8th cell (Like this In each row)

I would appriciate for any kind of replay

Hi All,
       Just I followed one blog which is

                  http://anuragsfdc.blogspot.in/2015/02/image-croping-tool-with-js-and-jquery.html
This Blog contains image croping, But when i am trying this I am not getting image after click on Crop Button (Cropped image is not saved finally)
in this blog contains some screen shots
I am getting until   (Finally crop Picture) this screen shots, but what ever they given in (cropped picture saved) in this screen shot, I am not getting this output, means cropped image is not saved
Please find solution...................

If you have any code related to this functionality Please share with me

Thanks in Advance

Hi All

     I want to retrieve Magento Orders/Customers into salesforce. How can i make a call  to magento through apex to retrieve,
1. I want to retrieve AccessToken and Token Secret (Also)
2. Retrieve customers/orders
          presently my role is Admin in magento and, am created user and consumerkey and consumerSecret keys

          Right now i am testing Authendication by using Oauth Play ground in test Sandbox. But it is displaying error like

<html>
<head><title>403 Forbidden</title></head>
<body bgcolor="white">
<center><h1>403 Forbidden</h1></center>
<hr><center>nginx/1.6.0</center>
</body>
</html>

if any one having code(In APEX), then please share with me

Thanks in Advance, I would appriciate for any kind of replay

Hi All
     I want to create a visualforce page like below format, Like this I have 4 pages (It is like an application form) I need to generate One Visualforce page, And also if i pass Record Id in url relating to this Obj Then I data need to display with in the cells


User-added image
Hi All
       I am trying to retrieve customers and orders from magento, through API Access, But I am always getting response like "403 Forbidden" as a response status, I am using consumerkey and consumerSecret key and accessToken And Token secret keys to retrieve the data, But when i try to retrive customers from restClinent or POST Man I am getting the status as 200, then it was fine (Using the same keys)
But what was the reason for this error,
I am testing in my sandbox, using OAuthPlayground by installing managed package, one month ago it was worked fine, like it is retrieve everyting what ever i request, but now it is showing 403 Forbidden error,

Please let me know what was the reason for that
Hi All,

     I am monitoring Login History, there I noticed some columns like below i mentioned, Will it cause any API Usage 

           Login Type ,               Browser ,                  Application
  1)   Remote Access 2.0,  Jakarta HTTP Commons,  Workbench
  2)  Remote Access 2.0, Jakarta HTTP Commons,  Cirrus Insight

Please Let me Know why API Usage counts if any, Here Cirrus Insight is for gmail integration app which am using


I would appreciate for any kind of reply
Hi All,

     I am monitoring Login History, there I noticed some columns like below i mentioned, Will it cause any API Usage 

           Login Type ,               Browser ,                  Application
  1)   Remote Access 2.0,  Jakarta HTTP Commons,  Workbench
  2)  Remote Access 2.0, Jakarta HTTP Commons,  Cirrus Insight

Please Let me Know why API Usage counts if any, Here Cirrus Insight is for gmail integration app which am using


I would appreciate for any kind of reply
Hello Everybody!

           I am new to integration part, Now i have an requirement  I have an Sql Server 2012 on Premise, So I would like to pull the data from sql server database to salesforce automaticlly on regular interval basis( 2 to 3 times a day)....... Is there any better approach for this 

We need to move data from sql server to salesforce........... 
     Please specify is there any open source tools or paid tools......

I would appriciate for any kind of replay
 
How to write RexEx for the time MM:HH AM/PM time thould be 12 hours format

Thanks in Advance
                  I would appreciate for any kind of replay
How to write trigger to avoid duplicate email when bulkfying the trigger

my trigger is:

trigger AvoidDuplicate on contact (before insert,before update)
{
   if(Trigger.isInsert||Trigger.isUpdate)
      for(contact a:trigger.new)
     {
         integer count=[select count from contact where email=:a.email];
         if(count>0)
          {
                 a.Email.adderror('This email already exists');
          }
     }
}

this is working fine when inserting single records

but it shows error when working with dataloader...... Please help to to over come this error


I would appriciate for any kind of replay...............
Hai friends,
I want to send an email to the users based on Journey date and time
For example Journey_date is present date and journey time is today 5:30 PM or AM or It may be 24 hour time.
so i would like to send an email before 4 hours based on journey time......... How can i achieve this
ex:
email: abc@gmail.com
Journey_Date__c: 02-24-2016
Journey_Time__c: 5:30 PM


so I want to send an email to a perticular person (abc@gmail.com) at the time of 1:30 PM................
How can i Achieve this scenario
Please Help me out.......

I would appriciate for any kind of replay
 
I have tried a lot scenarios but i Couldn't find out correct solution
I am specifying my code which is working with html components along with visualforce components
1. Html components are works fine with jquery always
2. But visualforce components are not working

      Please help me to work with visualforce components in jQuery........
************************
<apex:page controller="AutoComplete">
    <!--Make sure you have the Javascript in the same order that I have listed below.-->
    <script src="https://code.jquery.com/jquery-1.8.2.js"></script>
    <script src="/soap/ajax/26.0/connection.js" type="text/javascript"></script>
    <script src="https://code.jquery.com/ui/1.9.0/jquery-ui.js"></script>
    <link rel="stylesheet" href="https://code.jquery.com/ui/1.9.1/themes/base/jquery-ui.css"/>
    <script type="text/javascript">
        var j$ = jQuery.noConflict();
    if (j$){
        alert('Jquery loaded Successfully');
    }
      
        var apexAccountList =[];
          <apex:repeat value="{!accountList}" var="accList">
            //Store the name of the account in the array variable.
               apexAccountList.push('{!accList.name}');
        </apex:repeat>
        j$(document).ready(function(){
             
            j$("#name").autocomplete({
                source : apexAccountList
            });
           
        });
       
    </script>
    Enter Txt<input id="autocomplete"/>
 
    <script>
            var tags = apexAccountList;
            j$( "#autocomplete" ).autocomplete({
              source: function( request, response ) {
                      var matcher = new RegExp( "^" + j$.ui.autocomplete.escapeRegex( request.term ), "i" );
                      response( j$.grep( tags, function( item ){
                          return matcher.test( item );
                      }) );
                  }
            });
     </script>
     <script>
      var tags = apexAccountList;
      j$("[id$=myname]").autocomplete({
              source: function( request, response ) {
                      var matcher = new RegExp( "^" + j$.ui.autocomplete.escapeRegex( request.term ), "i" );
                      response( j$.grep( tags, function( item ){
                          return matcher.test( item );
                      }) );
                  }
            });
      
      </script>

 
     
    <apex:form >
     
        <br/><br/><br/>Account Name<input type="text" id="name"/>
        <br/><br/><br/>
        Enter Your Text <apex:inputText id="myname"/><br/><br/>
        
        
    </apex:form>
     
</apex:page>



*******


I Would appriciate for any kind of replay.................
User-added image

This is a standared page please share your view's 

I Would appriciate for any kind of replay............
<apex:page controller="DataTableEditRemoveController">
<apex:form id="form" >
<apex:pageBlock title="Accounts">
  <apex:pageMessages ></apex:pageMessages>
  <apex:pageBlockTable value="{!accs}" var="row">
     <apex:column >
       <apex:outputLink title="" value="/{!row.id}/e?retURL=/apex/{!$CurrentPage.Name}" style="font-weight:bold">Edit</apex:outputLink>&nbsp;|&nbsp;
       <a href="javascript:if (window.confirm('Are you sure?')) DeleteAccount('{!row.Id}');" style="font-weight:bold">Del</a>
     </apex:column>

     <apex:column value="{!row.Name}"/>
     <apex:column value="{!row.BillingStreet}"/>
     <apex:column value="{!row.BillingCity}"/>
     <apex:column value="{!row.BillingPostalCode}"/>
     <apex:column value="{!row.BillingCountry}"/>
  </apex:pageBlockTable>
</apex:pageBlock>

<apex:actionFunction action="{!DeleteAccount}" name="DeleteAccount" reRender="form" >
   <apex:param name="accountid" value="" assignTo="{!SelectedAccountId}"/>
</apex:actionFunction>
</apex:form>
</apex:page>
********************
public class DataTableEditRemoveController {

   public List<Account> accs { get; set; }
 
   //used to get a hold of the account record selected for deletion
   public string SelectedAccountId { get; set; }
 
   public DataTableEditRemoveController() {
       //load account data into our DataTable
       LoadData();
   }
 
   private void LoadData() {
       accs = [Select id, name, BillingStreet, BillingCity, BillingPostalCode, BillingCountry from Account limit 20];
   }
 
   public void DeleteAccount()
   {
      // if for any reason we are missing the reference
      if (SelectedAccountId == null) {
     
         return;
      }
    
      // find the account record within the collection
      Account tobeDeleted = null;
      for(Account a : accs)
       if (a.Id == SelectedAccountId) {
          tobeDeleted = a;
          break;
       }
     
      //if account record found delete it
      if (tobeDeleted != null) {
       Delete tobeDeleted;
      }
    
      //refresh the data
      LoadData();
   }   
 
 
}
I wrote a code for the following output:

<apex:page standardController="Account" recordSetVar="RecordsSet">
<apex:form >
    <apex:pageBlock >
        <apex:pageblocksection >
            <apex:pageblockTable value="{!RecordsSet}" var="rec" id="TableOne">
                <apex:column ><apex:facet name="header"></apex:facet>
                    <apex:commandLink value="{!rec.name}"/>
                </apex:column>
            </apex:pageblockTable>
        </apex:pageblocksection>
    </apex:pageBlock>
</apex:form>
</apex:page>

User-added image


But, Here i need when i click on any of the records then i want to display related contacts for that account in the TableTwo in the same page using PageReference or any other methods.............

I Would appriciate any king of replay..................
Hello All,

I done the security scanning yesterday i got this issues in some classes.i have mentioned one classes below.please can anybody help me for this.

Query: FLS Update

Object: current_week_severe__c in file: /classes/AccountTriggerHandler.cls
L 209: newAccount.Current_Week_Severe__c = mapOfAccountAndSevereCurrentCount.get(newAccount.Id);
Object: add in file: /classes/AccountTriggerHandler.cls
L 262: listOfAccountsToUpdate.add(newAccount);
Object: listofaccountstoupdate in file: /classes/AccountTriggerHandler.cls
L 265: if(isUpdateAccounts && (listOfAccountsToUpdate!=null && !listOfAccountsToUpdate.isEmpty() && listOfAccountsToUpdate.size()>0)){
Object: listofaccountstoupdate in file: /classes/AccountTriggerHandler.cls
L 268: update listOfAccountsToUpdate;
HI

Hi...
I have created a page which will search record date wise...
like i have record

date                            value
10/9/2015--------------------a
11/9/2015--------------------aa
12/9/2015--------------------aaa
14/9/2015--------------------aaaa
15/9/2015--------------------aaaaa
20/9/2015--------------------aaaaaa

if i am searching record on 10/9/2015 the record will be display  'a'
if i am searching record on 11/9/2015 the record will be display  'aa'
if i am searching record on 13/9/2015 the record will be display  'aa'(12/9/2015 record)
if i am searching record on 14/9/2015 the record will be display  'aaaa'
if i am searching record on 20/9/2015 the record will be display  'aaaaaa'
if i am searching record on 19/9/2015 the record will be display  'aaaaa'(15/9/2015 record)

if there is record on particular date it will display if there is no record on that date it will display last date record

for example i have 10/1/2001 record if i am searching 10/1/2001 it will be displayed 10/1/2001.like this
User-added image

As per requirment there is no record in 11/1/ 2001 in m object if i am searching 11/1 2001 record it will be display last day record means 10/1/2001...but i am getting 
User-added image
public with sharing class dateInPBTbaleController {
    public BankBook_Entry__c account{get;set;}
    public List<BankBook_Entry__c> listAccount {get;set;}
   
    //public Date startDate1;
    //public Date endDat1;
    public Double totalRevenue {get;set;}
    public Double totalRevenue1 {get;set;}
    public Double totalRevenuee {get;set;}
    public Double totalRevenuee1 {get;set;}
    public Date dat {get;set;}
    public dateInPBTbaleController() {
        listAccount  = [SELECT id, CB__c,Date__c,Debit__c,Master_Code1__c,Master_Name__c,Bank_Closing_Balance__c
                        FROM BankBook_Entry__c
                        order by Master_Code1__c ASC ];
    }

    public dateInPBTbaleController(ApexPages.StandardController controller){
    
        account = new BankBook_Entry__c();
        totalRevenue = 0;
        totalRevenue1 = 0;
        totalRevenuee = 0;
        totalRevenuee1 = 0;
    }
       
   public void displaingTable(){
        if(account.Date__c != null){
            listAccount  = [SELECT id, CB__c,Date__c,Debit__c,Master_Code1__c,Master_Name__c,Bank_Closing_Balance__c
                                FROM BankBook_Entry__c
                                WHERE Date__c =: account.Date__c order by Master_Code1__c ASC ];
            
            if(listAccount.size() == 0){
                listAccount  = [SELECT id, CB__c,Date__c,Debit__c,Master_Code1__c,Master_Name__c,Bank_Closing_Balance__c
                                FROM BankBook_Entry__c
                                WHERE Date__c <: account.Date__c order by Master_Code1__c ASC LIMIT 1 ];
            }
            
            if(account.Date__c == null){
                listAccount  = [SELECT id, CB__c,Date__c,Debit__c,Master_Code1__c,Master_Name__c,Bank_Closing_Balance__c,LastModified__c
                                FROM BankBook_Entry__c order by Master_Code1__c DESC LIMIT 1];
                                 
            }
        }
        calculateTotalRevenue();
        calculateTotalRevenue1();
        calculateTotalRevenue2();
     }
     public void calculateTotalRevenue() {
     for(BankBook_Entry__c acct2 : listAccount) {
            if(acct2.Bank_Closing_Balance__c!= null)
                totalRevenuee= acct2.Bank_Closing_Balance__c;
                }
        for(BankBook_Entry__c acct : listAccount) {
            if(acct.Debit__c!= null)
                totalRevenue+= acct.Debit__c;
                }
totalRevenuee1=totalRevenuee+totalRevenue;
              
       
        
    }
    
    
    
    public void calculateTotalRevenue2() {
        for(BankBook_Entry__c acct2 : listAccount) {
            if(acct2.Bank_Closing_Balance__c!= null)
                totalRevenuee= acct2.Bank_Closing_Balance__c;
            
              
        }
        
    }
    public void calculateTotalRevenue1() {
        for(BankBook_Entry__c acct1 : listAccount) {
            if(acct1.CB__c!= null)
                totalRevenue1+= acct1.CB__c;
               
        }
        
    }
}

----------------------------

<apex:page docType="html-5.0" standardController="BankBook_Entry__c"  extensions="dateInPBTbaleController">


        <apex:define name="body">
            
            <div style="width:800px;margin: 0px auto 10px auto;border: 1px solid black;">
    <apex:form >
        <apex:pageBlock >
            
                    <b><apex:outputLabel value="Trial Balance Report On: "  style="font-weight: bold;color:red;"/></b>
                     <apex:inputField value="{!account.Date__c}" style="font-weight: bold;color:red;"/>
                     
                     
                   <!--- Trial Balance Report On: <apex:input type="date" value="{!dat}"/>-->
                 
                 <apex:commandButton value="Display" action="{!displaingTable}" reRender="tableId" style="font-weight: bold;color:red;"/><br/><br/><br/>
         
                 <apex:pageblockTable value="{!listAccount }" var="record" id="tableId" >
                    <apex:column value="{!record.Master_Code1__c}" headerValue="Master Code"/>
                    <apex:column value="{!record.Master_Name__c}" headerValue="Master Name"/>
                    <apex:column value="{!record.Debit__c}" headerValue="Debit(+)" style="color:green;" id="tableId">
                     <apex:facet name="footer" >
                    <apex:outputText value="Rs.{0, number, ###,###,###,##0.00}" style="font-weight: bold;color:green;font-size:12px;height=18px;" >
                        <apex:param value="{!totalRevenuee1}"  />
                    </apex:outputText>
                </apex:facet>
            </apex:column>
                    <apex:column value="{!record.CB__c}" headerValue="Credit(-)" style="color:red;">
                    <apex:facet name="footer" >
                    <apex:outputText value="Rs.{0, number, ###,###,###,##0.00}"  style="font-weight: bold;color:red;font-size:12px;height=18px;"  >
                        <apex:param value="{!totalRevenue1}"  />
                    </apex:outputText>
                </apex:facet>
            </apex:column>
             <td  style="background-color: #DAFFFF" ><b> <apex:outputText value="Current Total" /></b></td>
            <!--- <apex:column value="{!record.Bank_Closing_Balance__c}" headerValue="Bank Closing Balance" style="color:green;">
                    <apex:facet name="footer" >
                    <apex:outputText value="Rs.{0, number, ###,###,###,##0.00}"  style="font-weight: bold;color:green;font-size:12px;height=18px;"  >
                        <apex:param value="{!totalRevenuee}"  />
                    </apex:outputText>
                </apex:facet>
            </apex:column>-->
                    
                    
                    </apex:pageblockTable>
             
        </apex:pageBlock>
    </apex:form>
      </div>
        </apex:define>
</apex:page>

 
Hi ,
My question is ,i have two fields in Visual fofrce page. at the time of loading the page the cursor will be displaying in fisrt field. i want to display the cursor in 2nd field .

how to solve this problem?
  • September 10, 2015
  • Like
  • 0
Hi all 
Please help me in this program
 
trigger tgname on Account_Convace__c ( after update)
 {
 
         if(Trigger.IsAfter){
                        if(Trigger.IsUpdate){
 
         // Map <id,Account_Convace__c> anjimap = new Map <id,Account_Convace__c>();
          
        List<Messaging.SingleEmailMessage> mails =    new List<Messaging.SingleEmailMessage>();
                   for(Account_Convace__c abc:Trigger.new)
          {
          if( abc.Account__c != Trigger.oldmap.get(abc.ID).Account__c)
             mails.add(abc.email__c); 
             
         
          //for(Account_Convace__c  abcd : [select id, Email__c from  Account_Convace__c  where id in :UPdatedlist])
          
          Messaging.singleEmailmessage mail = new messaging.singleEmailmessage();
          mail.setToaddress(mails);
          mail.setsubject('Account name hsa been changed.');
          mail.setbody('dfdsfdkjsfdsfds');
         
         
         
          }
          messaging.sendEmail( mails);
          
 
 }
 }
 }


Thanks and regards,

Srikanth Annam..
 

Hi All

           I am Trying to calculte Total amount as showned below imageUser-added image
 

I want to calculate total amouut field at the end of the row based on row values  
I want to add all vaues starting from 4th cell up to  7 th cell and total should be at 8th cell (Like this In each row)

I would appriciate for any kind of replay

How do u stop Recursive trigger 
Hi , Can any body help me to write the test class for my class.Thansk in advance.
public class VerifyDate {
    
    //method to handle potential checks against two dates
    public static Date CheckDates(Date date1, Date date2) {
        //if date2 is within the next 30 days of date1, use date2.  Otherwise use the end of the month
        if(DateWithin30Days(date1,date2)) {
            return date2;
        } else {
            return SetEndOfMonthDate(date1);
        }
    }
    
    //method to check if date2 is within the next 30 days of date1
    private static Boolean DateWithin30Days(Date date1, Date date2) {
        Date date30Days = date1.addDays(30); //create a date 30 days away from date1
        if( date2 > date30Days ) { return false; }
        else { return true; }
    }

    //method to return the end of the month of a given date
    private static Date SetEndOfMonthDate(Date date1) {
        Integer totalDays = Date.daysInMonth(date1.year(), date1.month());
        Date lastDay = Date.newInstance(date1.year(), date1.month(), totalDays);
        return lastDay;
    }

Hi All,

I want to find out the shortcut keys to open up the Apex class pages.Just like 066 would open the VisualForcePages.

Regards,
Seshagiri Rap
i have a method 
public void Genericobject(Sobject obj)
{
----
}

How to call this method?
Well i am calling like this 
a.Genericobject(Account acc)

Thanks in advance
        but an error
expecting a right parentheses, found 'acc'                   
 
Hi,

             I have value already in my Email field and i want to delete the value from that field once i click on submit button.

Thanks in advance.
 
Hi All,
  
I create one custom vf page for portal login and i try to login in that login page.
At that time i am getting this error
           
Error:
That operation is only allowed from within an active site.

Thanks in advance.
How to call another batch apex from one batch apex? i am providing 2 sample batch apexes just for testing purpose, or else can some one provide me a sample batch apex in which another batch will be called

Batch apex 1

public class BatchLeadConverted implements database.Batchable<sobject>
{
    list<lead> llist=new list<lead>();
    public string query='select id,name,status from lead';
    public string flag='Closed - Not Converted';
    
    public database.querylocator start(database.BatchableContext bc){
       return database.getQueryLocator(query); 
  }
    public void execute(database.BatchableContext bc,list<lead> le){
        for(lead l:le){
            if(l.status==flag)
            {
                llist.add(l);
            }
                
        }

      delete llist;            
      database.emptyRecycleBin(llist); 
    }
    public void finish(database.BatchableContext bc){
        
    }
 }

called with below code 

Batchleadconverted b=new BatchLeadConverted();
database.executebatch(b,2); 

Batch Apex 2

public class accno implements database.Batchable<sobject>
{
    integer i=0;
    public string query='select id,name from account';
    public Database.QueryLocator start(Database.BatchableContext bc)
    {
        return database.getQueryLocator(query);   
    }
    public void execute(database.BatchableContext bc, list<account> acc)
    {
        for(account a:acc)
        {            
          a.name=a.name+i;i++; 
        }
     update acc;       
    }
    public void finish(database.BatchableContext bc)
    {
        messaging.SingleEmailMessage ms=New messaging.SingleEmailMessage();
        string[] mailme=new string[]                {'xxxxxx@gmail.com'};
        ms.settoAddresses(mailme); 
        ms.setsubject ('record update');
        ms.setPlainTextBody('ExampleText');
        messaging.sendEmail(new messaging.SingleEmailMessage[]{ms});
    }
 
}

call with below code

accno a=new accno ();
database.executebatch(a)
Can anyone please give me a real time scenario where we use set in apex code to retrieve unique details. As list gives all data including duplicates, and I have used only list in my codings. So I do not want a code but a scenario where set only should be used and not the list..

Hi All

     I want to retrieve Magento Orders/Customers into salesforce. How can i make a call  to magento through apex to retrieve,
1. I want to retrieve AccessToken and Token Secret (Also)
2. Retrieve customers/orders
          presently my role is Admin in magento and, am created user and consumerkey and consumerSecret keys

          Right now i am testing Authendication by using Oauth Play ground in test Sandbox. But it is displaying error like

<html>
<head><title>403 Forbidden</title></head>
<body bgcolor="white">
<center><h1>403 Forbidden</h1></center>
<hr><center>nginx/1.6.0</center>
</body>
</html>

if any one having code(In APEX), then please share with me

Thanks in Advance, I would appriciate for any kind of replay

I have a pop up that is being shown, however the page is not directing back up to the top (where the pop up is)

I would like the pop up to be shown in the centre of the page when it appears

Can anybody offer any help?

My Css:

.custPopup{
    background-color: white;
    border-width: 2px;
    border-style: solid;
    z-index: 9999;
    left: 50%;
    padding:10px;
    position: absolute;
    /* These are the 3 css properties you will need to change so the popup 
    displays in the center of the screen. First set the width. Then set 
    margin-left to negative half of what the width is. You can add 
    the height property for a fixed size pop up if you want.*/
    width: 500px;
    margin-left: -250px;
    top:100px;
    font-size: 15px; 
    border-color: #da3e00;
}
.popupBackground{
    background-color:black;
    opacity: 0.20;
    filter: alpha(opacity = 20);
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 9998;
}



Thankyou in advance,

Lewis 
Hi All
       I am trying to retrieve customers and orders from magento, through API Access, But I am always getting response like "403 Forbidden" as a response status, I am using consumerkey and consumerSecret key and accessToken And Token secret keys to retrieve the data, But when i try to retrive customers from restClinent or POST Man I am getting the status as 200, then it was fine (Using the same keys)
But what was the reason for this error,
I am testing in my sandbox, using OAuthPlayground by installing managed package, one month ago it was worked fine, like it is retrieve everyting what ever i request, but now it is showing 403 Forbidden error,

Please let me know what was the reason for that
Hi,

I am suffering with Salesforce apex LimitException issue. I am fetching thousands of records from few objects and putting it into the collection like Map. Now I have a requirement to generate JSON for same records which will be used for mobile devices to download data from salesforce.
When I tried to serialize those records by using System.JSON.Serialize() method; it is generating a huge JSON string and I am getting System.LimitException error because there will be more memory required than available space.
I tried to catch that issue using try/catch block but here is a reference available which says that System.LimitException can’t be caught by Catch block.
Referral URL: http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_classes_exception_methods.htm
I know that we can check heap size limit through Limits.getHeapSize() method. But is there any work around so that I can handle this issue from apex side.
A code sample or some reference in this regard would be highly appreciated.
Thanks in advanced.

Hi,

 

 Anybody explain am stuck to integrate salesforce with magento am passing parameters using http callout

this is my code am getting this response like :

 

oauth_problem=parameter_absent&oauth_parameters_absent=oauth_consumer_key

 

 

public void resp()
{
http H=new http();
HttpRequest req = new HttpRequest();
//String url= 'http://advaanz.com/magentoapitest/oauth/initiate';
req.setEndpoint('http://advaanz.com/magentoapitest/oauth/initiate');
//string Stringval='OAuth oauth_callback="'+EncodingUtil.urlEncode('https://c.ap1.visual.force.com/apex/megentoapi', 'UTF-8')+'",oauth_consumer_key="6nuzyesqo16saelvdazlodjvknurc2wh",oauth_consumer_secret="5fqgg8xrv9rvt88kz9o31bbe55zw6896"';

string Stringval='OAuth realm="http://advaanz.com/",oauth_consumer_key="6nuzyesqo16saelvdazlodjvknurc2wh",oauth_nonce="15ZN8FFR1700UQ6O",oauth_signature_method="HMAC-SHA1",oauth_timestamp="1367319400",oauth_version="1.0",oauth_signature="4mphBg8VgYCV%2BeMIIMdZ%2BgD%2F6eM%3D"';
req.setMethod('POST');
req.setHeader('Content-length', '1753' );
req.setHeader('Content-Type', 'text/xml;charset=UTF-8');
string bVal=EncodingUtil.Base64Encode(blob.valueof(Stringval));
String authorizationHeader =bval;
req.setHeader('Authorization',bVal);
req.setbody('');
//req.setHeader('Accept','');
//req.setHeader('Host','api.magento.com');
req.setTimeout(50000);
HttpResponse res =h.send(req);
TestVal=res.getbody();
}

 

can any one explain how to integrate maganto using apex code?

 

Thankyou

 

Hi,

I am suffering with Salesforce apex LimitException issue. I am fetching thousands of records from few objects and putting it into the collection like Map. Now I have a requirement to generate JSON for same records which will be used for mobile devices to download data from salesforce.
When I tried to serialize those records by using System.JSON.Serialize() method; it is generating a huge JSON string and I am getting System.LimitException error because there will be more memory required than available space.
I tried to catch that issue using try/catch block but here is a reference available which says that System.LimitException can’t be caught by Catch block.
Referral URL: http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_classes_exception_methods.htm
I know that we can check heap size limit through Limits.getHeapSize() method. But is there any work around so that I can handle this issue from apex side.
A code sample or some reference in this regard would be highly appreciated.
Thanks in advanced.
Hi,

Is it possible to prevent users from editing a record based on a specfic value in a field?  
For example users should not be able to edit a opportunity record if Stage equals 'Won OR Lost'?

Would appreciate any help!!
  • September 03, 2014
  • Like
  • 1