• anu_karthi
  • NEWBIE
  • 25 Points
  • Member since 2009

  • Chatter
    Feed
  • 1
    Best Answers
  • 3
    Likes Received
  • 0
    Likes Given
  • 93
    Questions
  • 80
    Replies

Hi I would like to know if you can create dynamic reports in native sf where you can pass a parameter from example a vf page or another salesforce page (passing through Querystring) that creates a dynamic report?

 

 

Or should i look at the Google charts toolkit to do this?

for(Integer i=1;i<leadrecords.size();i++)
          {
          
           lat= leadrecords[i].Latitude__c;
           longt=leadrecords[i].Longitude__c;
            if (i<leadrecords.size())
            {
              Integer j=i++;
              lat1=leadrecords[j].Latitude__c;
            }
           
           
          }

where leadrecords is the list and it is as follows...

 private List<Lead> leadrecords;
 
    public List<Lead> getLeadrecords()
    {
        return leadrecords;
    }

String query = 'SELECT  City,Latitude__c,Longitude__c FROM Lead WHERE City LIKE \''+city+'%\'';
        
        leadrecords = Database.query(query);

for(Integer i=1;i<leadrecords.size();i++)
          {
          
           lat= leadrecords[i].Latitude__c;
           longt=leadrecords[i].Longitude__c;
            if (i<leadrecords.size())
            {
              Integer j=i++;
              lat1=leadrecords[j].Latitude__c;
            }
           
           
          }

Now iam having two records in salesforce dbase whose city=bangalore..So i want to fetch each of these places corresponding  latitude value which is in my LIST LEADRECORDS BUT WHEN IAM DOING AS ABOVE iam always getting the latitude value of the ist records  but not the  2nd record of the loop please some one tell me how to iterate and pass the values to different strings so that i can catch those values in my javascript variables of my visualforce page..

Help me with an example so that i can clearly work out it..

                               Thanking You,
       

Hi everyone i have a list in my Apex class which has soql query result..

        

String query = 'SELECT  City,Latitude__c FROM Lead WHERE City LIKE \''+city+'%\'';
       
        leadrecords = Database.query(query);   

 

Eg :in the above line leadrecords is alist of lead type

 

    private List<Lead> leadrecords;

 

So now iam trying to pass this list to ajavascript variable so dat javascript variable should have query  output...but when i have done like this iam able to pass the list but when iam tryong to display that it is displaying the  ids  but i want to display the field city and latitude which are storesd in that list how to do it please someone help me with the solution... to javascript variable so how to pass this list to javascript variable

  

Hi everyone i have created 2 visualforce pages as follows..code is as below..

 

Parent window(visualforce page 1)

 

<apex:page >

<form method=post action='' name=f1>
<table border=0 cellpadding=0 cellspacing=0 width=550> <tr>
<td ><font size=2 face='Verdana'>Your Name</font><input type=text name='p_name' size='8'>
<!--<a href="#" NAME="My Window Name" title=" My title here "
onClick=window.open("https://chiranjeevi.ap1.visual.force.com/apex/childwindow","Ratting",
"width=550,height=170,left=150,top=200,toolbar=1,status=1,");>Click here to open the child window</a>-->
<A href="javascript:void(0)"
onclick="window.open('https://chiranjeevi.ap1.visual.force.com/apex/childwindow')">
Open a new window</A>

</td></tr> </table></form>

</apex:page>

 

Child Window (visualforce page 2)

 

<apex:page >
<html>
<head>

<script langauge="javascript">
window.onLoad=new function()
{
post_value();
}
function post_value(){
opener.document.f1.p_name.value = document.frm.c_name.value;
self.close();
}
</script>

<title>(Type a title for your page here)</title>
</head>


<body bgcolor="#ffffff" text="#000000" link="#0000ff" vlink="#800080" alink="#ff0000">

<form name="frm" method=post action=''>
<table border=0 cellpadding=0 cellspacing=0 width=250>


<tr><td align="center"> Your name<input type="text" name="c_name" size=12 value=test>
 <body onload="post_value()"  style="font-family: Arial;border: 0 none;">
<input type=button value='Submit' onclick="post_value();">
<!-- <form action="#" onsubmit="post_value(); return false">-->
</td></tr>
</table></form>
</apex:page>

 

So in parent window when i click on link i can navigate to new window which is nothing but child window...

 

Now in child windowif i enter some input value and click submit button iam not able to pass this parti8cular value to the parent window but i want to pass values to the parent window whenevcer i click submit button...

 

So please help me to  do it..

 

                                                                                     Thanks and regards,

                                                                                              Anu...

Hi,

 

In my appliction two objects are there.

SeafootNote:Any Refund(checkbox),SFN Number(text)

Refund:Refund Amount(Input Field(Number)),

           SFN Number(lookup filed)which is looking over to SFN Number in SeafootNote

 

If i enter the  value in SFN Number and Refund amount in Refund object i want to make true in the Any refund field of correspondingSFN Number record in SeaFootNote object.But my trigger is not working properly.If i enter the new record in SeaFootNote ,though i didnt select the checkbox in Any Refund input field after saving the record Any Refund field is checked.

 

Plz tell me where i am going wrong in my code.

 

My code is as follows:

trigger refund on chiranjeevi__Sea_Foot_Note__c (before insert,before update) {

 List<chiranjeevi__Refund__c> refundlist=new List<chiranjeevi__Refund__c>();
 for (chiranjeevi__Sea_Foot_Note__c a : Trigger.new)
 refundlist=[SELECT  chiranjeevi__Refund_Amount__c from chiranjeevi__Refund__c where chiranjeevi__SFN_Number__c=:a.chiranjeevi__SFN_number__c];
 if(refundlist<>null)
 {
  for (chiranjeevi__Sea_Foot_Note__c a : Trigger.new)
  a.chiranjeevi__Any_refund__c=true;
 }
 }
 Thanks in advance,

 Anu..

Hi,

 

I am finding accumulated sum in some objects.My logic is worked in some objects.In some other objects the following error is raising.

 

Review all error messages below to correct your data.
Apex trigger chiranjeevi.mbltotal caused an unexpected exception, contact your administrator: chiranjeevi.mbltotal: execution of BeforeInsert caused by: System.NullPointerException: Attempt to de-reference a null object: Trigger.chiranjeevi.mbltotal: line 10, column 15

 

my code is as follows:

 

trigger mbltotal on chiranjeevi__Sea_Foot_Note__c (before insert,before update) {
Double objBtotal = 0;
List<chiranjeevi__Master_Bill_Of_Ladding__c> objAlist=new List<chiranjeevi__Master_Bill_Of_Ladding__c>();
for(chiranjeevi__Sea_Foot_Note__c b : Trigger.new)
objAlist=[SELECT chiranjeevi__Console_charges__c,chiranjeevi__SFN_no__c FROM chiranjeevi__Master_Bill_Of_Ladding__c Where chiranjeevi__SFN_no__c =: b.Id];
for (chiranjeevi__Sea_Foot_Note__c objA : Trigger.new)
{
for (chiranjeevi__Master_Bill_Of_Ladding__c objB : objAlist)

 objBtotal += objB.chiranjeevi__Console_charges__c;
   objA.chiranjeevi__Total_service_charges__c=objBtotal;

}    
}


If any one find out the solution plz help me.

 

Thanks in advance,

Anu..

 

hi,

 

in my application  object A have SFN Number of type input text field and object B have SFN Number which is looking over to objectA SFN Number.i am comparing the Object B SFN Number with ID of object A.At the time of saving the record the following error is raising

Too many SOQL queries: 21

trigger summation on chiranjeevi__Obj_A__c (before insert,before update) {
Double objBtotal = 0;
List<chiranjeevi__Obj_A__c> objAlist=new List<chiranjeevi__Obj_A__c>();
List<chiranjeevi__Obj_B__c> objBlist=new List<chiranjeevi__Obj_B__c>();

chiranjeevi__Obj_A__c[] id=[select ID from chiranjeevi__Obj_A__c];
for(chiranjeevi__Obj_A__c b : id)
{
objBlist=[SELECT chiranjeevi__Amount__c,chiranjeevi__SFN_Number__c FROM chiranjeevi__Obj_B__c Where chiranjeevi__SFN_Number__c =: b.id];
}
for (chiranjeevi__Obj_A__c objA : Trigger.new)
{
 for (chiranjeevi__Obj_B__c objB : objBlist)
 objBtotal += objB.chiranjeevi__Amount__c;
 {
  objA.chiranjeevi__Total_Amount__c=objBtotal; 
 
 }
}
}

If i check with particular id name it is working poperly.

 

If any one knows plz help me.

 

Thanks in advance,

Anu..

 

 

 

Hi every one,

 

I want to find sum of different input fields from different objects and assign total sumto one field in main object using salesforce.All objects have one common field like SFN Number.In main object this SFN Number is input field.Remaing all other objects have SFN Number field look over to main object SFN Number.Main object have Total amount input field.Remaining all objects have amount inputfield.i want to find the sumof all amounts which have same SFN Numbers and assign it to the total amount field which is in main object corresponding SFN Number record.

 

Plz give me some guidance how to achieve this functionality.

 

Thanks in advance

 

 

Hi Every one,

 

I am new to write triggers.In my application 3 objects are there Obj A,Obj B,Obj C.

Obj A-SFN Number(Input field(text),Total Amount(Number))

Obj B-SFN Number(lookup(ObjA),Amount(Number))

Obj C-SFN Number(lookup(ObjA),Amount(Number))

 

Here i need to calculate sum of amount from Obj B and Obj C and assign the total value to Total Amount in

Obj A by using triggers.

 

Exception is raising as follows:

 

contact your administrator: chiranjeevi.summation: execution of BeforeInsert caused by: System.QueryException: List has no rows for assignment to SObject: Trigger.chiranjeevi.summation: line 4, column 96

 

My code is as follows:

 

trigger summation on chiranjeevi__Obj_A__c (before insert,before update) {
decimal ObjATotal,ObjBAmount,ObjCAmount;
for(chiranjeevi__Obj_A__c a : Trigger.new)
ObjBAmount=[Select Amount__c from chiranjeevi__Obj_B__c where SFN_Number__c =:a.SFN_Number__c].Amount__c;
for(chiranjeevi__Obj_A__c b : Trigger.new)
ObjBAmount=[Select Amount__c from chiranjeevi__Obj_C__c where SFN_Number__c =:b.SFN_Number__c].Amount__c;

for(chiranjeevi__Obj_A__c c : Trigger.new)
c.Total_Amount__c=ObjBAmount+ObjCAmount;
}

 

If any one knows plz help me.

 

Thanks & Regards,

Anu..

 

Hi everyone,

 

i have 2 objects for example Object A ,Object B.Now my requirement is in such a way , that object A & B are not related to each other....No masterdetail relationship is  there between A& B.But i want to write a trigger in such a way,that when the trigger (afer insert,after,update,before insert,before update)  on Object A fires then i want to update the fields in object B (For example updating a checkbox field in object B).....  

 

SO as iam new to triggers in salesfo.rce, please help me with an example code.....for doing cross field updation

 

Thanks&Regards,

Anu..

Hi everyone,

 

I have developed a app in salesforce.com in developer edition and i created  a user for that app with profile standard user permissions ...So that i can deploy that app and make available to the user with the standard user permissions..

 

Here my problem lies, lookupfields is behaving strange  in my salesforce.com IDE with standard user profile and salesforce.com IDE with SystemAdministrator profile.when i created records in my Salesforce.com app for a particular object..and saved it,for every lookuup in my app in  system admin IdE the lookup is seeing all the records which i saved..But in my Standard user Ide lookup not pointing to all the records which i saved...in my system admin Ide..So is it required to set any adnminpermissions for accesing all the records which i save in my system admins IDe..

 

Please tell me is it possible to do that by changing some security settings..

 

                                                                                                                                                    Thanks&Regards,

 

                                                                                                                                                          Anu.... 

Hi everyone,

 

I have 2 input fields in my standard salesforce apps customobject ..In my custom object 2 input fields for example ....1.AnyIssues(checkbox datatype ) and  2..Issuedetails(ltextdatatype)..

 

Functionality which iam expecting is when i checkthe field anyissues then only my inputfield issuedetails to be enabled or else it should be in blockstate..that is as if iam doing dependency between 2 picklistfields...i want the dependency between the above 2 fields....

 

So please tell  me whether this functionality can be achieved or not in standard salesforce as i can do in visuaklforce i dont know whether its possible in salesforce..if possible please help me in doing it withthe approach

 

                                                                                                                         Thanks&Regards,

                                                                                                                                     Anu...

Hi everyone ,

 

I want to pass input fieldvalue (of lookup datatype) from visualforce page to controller..can anyone help me in doing this with an example code as iamnew to vpage development...

 

 

                                                                                                          Thanks&Regards,

                                                                                                                      Anu....

Hi everyone,

I am working with lookup field in my page which is looking to the same object and wen i selectesd some value using lookup field then i want the rest of input fields values of my visualforce page to be automatically populated once i click button ..so as iam new to visual force development i dont have any idea whether its possible if possible how to do that ..just give an example of achieving it......

 

   my code is as follows....

<apex:page standardController="CAF_Bank__c">
<script>
function autopopulate()
{
<!--it should autopopulatethe rest of fields related to the object which iam looking over through the lookup-->

}
</script>
    <apex:form >
        <apex:pageBlock title="My Content">
            <apex:pageBlockSection title="My Content Section" columns="2">
              <apex:pageBlockSectionItem >
               <!-- <apex:outputLabel value="Lookup to an Contact" for="theLookup"/>-->
                <!--<apex:inputField id="theLookup" value="{!CAF_Bank__c.caf_lookup__c}"/>-->
                <apex:outputLabel value="BranchCode" for="theLookup"/>
                <apex:inputField id="theLookup" value="{!CAF_Bank__c.caf_lookup__c}"/>
               
              </apex:pageBlockSectionItem>
               <apex:pageBlockSectionItem >
              <apex:outputLabel value="Bank Name "/>
                <apex:inputField id="bname" value="{!CAF_Bank__c.Bank_Name__c}"/>
              </apex:pageBlockSectionItem>
              <apex:pageBlockSectionItem >
              <apex:outputLabel value="Branch Name "/>
                <apex:inputField id="branchname" value="{!CAF_Bank__c.Branch_Name__c}"/>
              </apex:pageBlockSectionItem>
            </apex:pageBlockSection>
        </apex:pageBlock>
        <apex:commandButton  value="Autopopulate" onclick="autopopulate()"/>
    </apex:form>
</apex:page>

 

                                                                                                                                           Thanks&Regards,

                                                                                                                                                 Anu......

Hi  everyone,

I want to  have pagination for list of records that are displayed ina search result....

In example search button controller:

 

<apex:page tabStyle="Account" controller="massAccountUpdateCon">
<apex:sectionHeader title="Accounts Mass Update"></apex:sectionHeader>
<apex:form >
<apex:pageBlock title="" id="pageBlock">
<!-- This block will show the search textbox and the Search button -->
<apex:pageBlockButtons location="top">
<apex:inputText value="{!keywords}" style="height:15px;"></apex:inputText>
<apex:commandButton value="Search" action="{!ViewData}" id="theButton" rerender="pageBlock" status="status"></apex:commandButton>
</apex:pageBlockButtons>
<!-- To show page level messages -->
<apex:pageMessages ></apex:pageMessages>

<!-- The below tag will provide a javascript method which when is called in turn will call a controller's method -->
<apex:actionFunction action="{!UpdateRecords}" name="updateRecords" rerender="pageBlock" status="status"></apex:actionFunction>

<!-- This table contains columns which have inputfield components -->
<apex:pageBlockTable value="{!accounts}" var="a" rendered="{!NOT(ISNULL(accounts))}">
<apex:column>
<apex:facet name="header">Name</apex:facet>
<apex:inputField value="{!a.Name}" onchange="updateRecords();"></apex:inputField>
</apex:column>
<apex:column >
<apex:facet name="header">Phone</apex:facet>
<apex:inputField value="{!a.Phone}" onchange="updateRecords();"></apex:inputField>
</apex:column>
<apex:column>
<apex:facet name="header">Billing City</apex:facet>
<apex:inputField value="{!a.BillingCity}" onchange="updateRecords();"></apex:inputField>
</apex:column>
<apex:column>
<apex:facet name="header">Billing Country</apex:facet>
<apex:inputField value="{!a.BillingCountry}" onchange="updateRecords();"></apex:inputField>
</apex:column>
<apex:column>
<apex:facet name="header">Industry</apex:facet>
<apex:inputField value="{!a.Industry}" onchange="updateRecords();"></apex:inputField>
</apex:column>
</apex:pageBlockTable>

</apex:pageBlock>

<!-- The action status to show when the AJAX postback is wroking. -->
<apex:actionStatus id="status" startText="Requesting..."/>
</apex:form>
</apex:page>


And controller as follows:

 

public class massAccountUpdateCon {

private List<Account> accounts;

public List<Account> getAccounts() {
return accounts;
}

public string keywords {
get;
set;
}

public PageReference ViewData() {
//dynamically build the query to insertthe filter values
String query = 'Select id, name, type, ownership, industry, phone, BillingCity, billingCountry FROM account WHERE name LIKE \'' + keywords + '%\'';

accounts = Database.query(query);

return null;
}

public PageReference UpdateRecords() {
// this simple line of code finds out which column was changed and update the
// relevant account record accordingly!
update accounts;
return null;
}
}

 

 In this particular page wen i search for records  all records related to my search  will be displayed but i want to

limit the  no of records displayed and want to have pagination concept here ie (previous and next buttons )

to see all records.... but for search results iam not able to dat please help me with asn example code in creating pagination for my searchresults..as iam  a learner of apex and visualforce page iam not able to do this..

 

So someone help me ....

                                                                                                                                       Thanks in advance,

                                                                                                                                                     Anuu.

           

                 

 

Hi I have a vpage as follows..


<apex:outputLabel style="font-weight:bold;" value="Search By Branch Code" ></apex:outputLabel>
        <apex:inputText value="{!textData}"/>

 

Iam trying to pass this input textfield value(what ever i enter) to the controller by using getters and setters but iam not able to pass the value its passing  just anull value

 

Getters and setters as below

 

private String textdata = null;

    public String getTextData() { return textdata; }
    public void setTextData(String data) { textdata = data; }
 

 So Some one plz help me in passing myy in put field value to controller so that i want to use that value in my soql query

 

Eg:

CAF_Bank__c [] currentbanknames=[SELECT  Bank_Name__c FROM CAF_Bank__c  where Branch_Code__c=:textdata];

            So plz tell me with an example.............

 

       

 

                                                                                                    Thanks& Regards

                                                                                                          Anu...

My list is as follows

List<CAF_Bank__c> BankRecordList=new List<CAF_Bank__c>();
CAF_Bank__c[] records = [SELECT Address_1__c,Address_2__c,    
Area__c,Bank_Name__c,Branch_Name__C,City__c,Country__c,Credit_Limit__c,Fax__C, Branch_Code__c FROM CAF_Bank__c];

for (CAF_Bank__c c :records) {

BankRecordList.add(c);

}
public CAF_Bank__c[] getBankRecordList() {
return BankRecordList;

}

 

 

 

 

Now iam passing this list to my visual forcepage and assigning it to a array andtrying to retrieve each field from the  array  using for loop but iam not able to retrieve it ...as array has multiple fields with n number of values..

 

 please tell me how to write for loop to retrieve individual fields from the array list in visualforce page..

 

 var myArray2= new Array();
           myArray2 = '{!BankRecordList}';

var i=0;
          
           for ( i=0; i< myArray2.length; i++)
              {
                  if(myArray2[i].Branch_Code__c == bc)<! Branch_Code__c is a custom  field)-->
                  {
                alert('its coming');
                  }
                 var x =myArray2[i].Bank_Name__c;
                   alert ('iam here');
                               
                          var x =myArray2[i].Bank_Name__c; <!--  Bank_Name__c    is a custom field -->                        document.getElementById('{!$Component.form1.iField}').value=x;

                        alert('code working');
                         return false;

 

 

here this line is not working    if(myArray2[i].Branch_Code__c == bc)

 

So plz give me a example in retrieving the field vallues fro the array...   

Hi everyone,

 

I am having avisualforce page with customfields,and i want to assign  a value stored in a variable ti it iam tryimg to do it like this but its not working plz help me with an example...

 

var duplicate=anu;

 

 document.getElementById('{!$Component.form1.name}').value=duplicate;

 

<apex:inputField id="name" value="{!CAF_Bank__c.Bank_Name__c}">

 

can i do this ..

 

  plz some one help me how can i assign a variable  to the current field in a form...

         

                                                                                        Thanks&Regards,

                                                                                                Anu...

 

 

   

 

 

Hi i have developed a visualforce page ...and i have defined acommandbutton (New).UP on command button i invoked an action called newrecord().

and code for newrecord() is as follows .

 

public PageReference newRecord()
{
PageReference pr = System.Page.caftest6; // or 'new PageReference('url');//

pr.setRedirect(true);
return pr;

}
and  my command button is as follows. 

<apex:commandButton disabled="{!isNewButtonDisabled}" value="New" action="{!newRecord}" />

 

Now when ever i click new button its redirected back to d same page...so as u know redirection will take moretime instead of redirection i want to be in d same page but want to define a new mode for d page.so dat wen i click new button standard new button functionality is achieved ..So what i expect is without redirecting to d same page again i want to be in d same pagein new mode.. I have tried it by clearing d fields but den d page is not in new mode.....

 

   So someone plz help me with an saqmple example of defining new mode for new button instead of redirecting to the same page again...

 

 

 

Hi everyone,

 

MY requirement is up on button action i want to change my apex output text value if he click edit button i want to display output text as "Edit mode' .If i click new button i want to display d output as 'New Mode'....Soi want to change the output text value up on command button i tried by assigning likedis in the clear field function

 document.getElementById('{!$Component.form1.head}').Value='CANCEL MODE';

but its not working So plz help me to achieve this with an example code...

My vpage is as follows

<apex:page standardController="CAF_Bank__c" extensions="variable">
<script>

    function clearflds()
    {

   document.getElementById('{!$Component.form1.head}').Value='CANCEL MODE';
   document.getElementById('{!$Component.form1.name}').value=null;
    document.getElementById('{!$Component.form1.iField}').value=null;
    document.getElementById('{!$Component.form1.bname}').value=null;
    document.getElementById('{!$Component.form1.credit}').value=null;
    }
    </script>
<apex:form id="form1" >
 <table width="100%"> <tr>
      <td width="17%"></td>
      <td align="left" valign="top" height="45"><font style="font-family:Tahoma, Geneva, sans-serif; font-size:16px; line-height:24px; color:#900;"><apex:outputText id="head"  title="Search Mode" value="Search Mode" > </apex:outputText>

   
           </font> </td>
   
      <td></td>
  </tr></table>                                       
<table width="100%">
    <tr>
      <td width="5%"></td>
      <td>
          <table width="100%" align="center">
       

               <tr>
                   <td height="30" width="170px"><apex:outputLabel value="Bank Name">
     </apex:outputLabel></td>
                   <td><apex:inputField id="name" value="{!CAF_Bank__c.Bank_Name__c}">
                    <apex:actionSupport event="onkeyup" action="{!disableEnable}" rerender="buttonSection"/>
                   </apex:inputField>
                   </td>
               </tr>
               <tr>
                   <td height="30"><apex:outputLabel value="Branch Code">
      </apex:outputLabel></td>
                   <td><apex:outputPanel id="branchcoding">
     <apex:inputField id="iField" value="{!CAF_Bank__c.Branch_Code__c}">
      <apex:actionSupport event="onkeyup" action="{!disableEnable}" rerender="buttonSection"/>
      </apex:inputfield>
      </td></tr>
      <script>document.getElementById('{!$Component.iField}').disabled = {!disableInput}; </script>
      </apex:outputPanel> 
              
               <tr>
                   <td height="30"><apex:outputLabel value="Branch Name">
     </apex:outputLabel></td>
                   <td><apex:inputField id="bname" value="{!CAF_Bank__c.Branch_Name__c}">
                    <apex:actionSupport event="onkeyup" action="{!disableEnable}" rerender="buttonSection"/>
                   </apex:inputfield>
                   </td>
                 </tr>
                  </table>
<table align="left"><tr><td align="center">

</td></tr></table>

</td><td width="5%"></td></tr>

</table>
<table width="100%"> <tr>
      <td width="12%"></td>
      <td align="left" valign="top" height="45">
        <apex:outputpanel id="buttonSection">
    <apex:commandButton disabled="{!isNewButtonDisabled}" value="New" onclick="newmode();" action="{!newRecord}" />
      <apex:commandButton disabled="{!isEditButtonDisabled}" value="Edit" action="{!disableCloseDateInput}" onclick=" focussing()"  rerender="branchcoding, buttonSection"/>
              <apex:commandButton disabled="{!isSaveButtonDisabled}" id="button2" action="{!save }" value="Save"   />
      <apex:commandButton value="Cancel"  onclick="clearflds()"  reRender="form1" />

 
  <apex:commandButton action="{!cancel}" value="Exit"/>


  </apex:outputpanel>
      </td>
       </apex:form>
  </tr></table>
 
</apex:page>

 

My controller as follows

 

public class variable {

private static final Boolean DISABLED = false;
private static final Boolean ENABLED = true;
public Boolean disableInput {get; set;}
 boolean isSaveButtonDisabled = false;
  boolean isNewButtonDisabled = false;
  boolean isEditButtonDisabled = false;
List<String> BankBranchList = new List<String>();
ApexPages.StandardController con;
public  variable(ApexPages.StandardController controller){ 
setButtonStatus('save', DISABLED);
setButtonStatus('edit', DISABLED);

setButtonStatus('new',ENABLED);
this.con = controller;
}
Public pageReference move()
{

   PageReference newpage=page.variableheading;
   newPage.setRedirect(true);
   return newpage;
  
   }
 public void save() {

try
{

 con.save();
setButtonStatus('save', DISABLED);
setButtonStatus('edit', ENABLED);
setButtonStatus('new', ENABLED);

}
catch(Exception ex1)
{
}


}

public PageReference newRecord()
{
PageReference pr = System.Page.variableheading; // or 'new PageReference('url');//

pr.setRedirect(true);
return pr;

}
public PageReference hmpgmove()
{
PageReference pr =new PageReference('https://ap1.salesforce.com/home/home.jsp'); // or 'new PageReference('url');//

pr.setRedirect(true);
return pr;


public PageReference create()
{

setButtonStatus('save', DISABLED);
setButtonStatus('edit', DISABLED);
setButtonStatus('new',  DISABLED);
enableCloseDateInput();

return move();

}
public boolean getIsSaveButtonDisabled()
{
  return isSaveButtonDisabled;
}
public boolean getIsEditButtonDisabled()
{
  return isEditButtonDisabled;
}
public boolean getIsNewButtonDisabled()
{
  return isNewButtonDisabled;
}
public boolean getIsDeleteButtonDisabled()
{
  return isDeleteButtonDisabled;
}
  public void disableCloseDateInput()
  {
    setButtonStatus('new', DISABLED);
    disableInput = true;
   
    
 }
   
 
    public void enableCloseDateInput(){
        disableInput = false;
    }
 
public void setButtonStatus(String buttonName, Boolean status) {

status = !status;

if (buttonName == 'save') {

isSaveButtonDisabled = status;

} else if (buttonName == 'new') {

isNewButtonDisabled = status;

} else if (buttonName == 'edit') {

isEditButtonDisabled = status;

}
else if(buttonname=='delete')
{
  isDeleteButtonDisabled = status;
}

}
public void disableEnable() {
setButtonStatus('save', ENABLED);
}
}

 

 

                                                                                                                                          Thanks&Regards,

                                                                                                                                                 Anu....

 

 

 

 

Hi Everyone,

 

I have created a page for a custom object with all its custom fields as input fields...Now i want to fetch d current input field value in to my controller so to compare  d current   input field value  with d corresponding stored values in salesforce dbase ..iam unable to fetch the current input field value from visual force page to d

apex controller..

 

 Can some one plz provide me with an example code in fetching d input field values from d   

visualforce page to d controller....

 

                                                                                                                    Thanks & Regards,

                                                                                                                                  Anu......

for(Integer i=1;i<leadrecords.size();i++)
          {
          
           lat= leadrecords[i].Latitude__c;
           longt=leadrecords[i].Longitude__c;
            if (i<leadrecords.size())
            {
              Integer j=i++;
              lat1=leadrecords[j].Latitude__c;
            }
           
           
          }

where leadrecords is the list and it is as follows...

 private List<Lead> leadrecords;
 
    public List<Lead> getLeadrecords()
    {
        return leadrecords;
    }

String query = 'SELECT  City,Latitude__c,Longitude__c FROM Lead WHERE City LIKE \''+city+'%\'';
        
        leadrecords = Database.query(query);

for(Integer i=1;i<leadrecords.size();i++)
          {
          
           lat= leadrecords[i].Latitude__c;
           longt=leadrecords[i].Longitude__c;
            if (i<leadrecords.size())
            {
              Integer j=i++;
              lat1=leadrecords[j].Latitude__c;
            }
           
           
          }

Now iam having two records in salesforce dbase whose city=bangalore..So i want to fetch each of these places corresponding  latitude value which is in my LIST LEADRECORDS BUT WHEN IAM DOING AS ABOVE iam always getting the latitude value of the ist records  but not the  2nd record of the loop please some one tell me how to iterate and pass the values to different strings so that i can catch those values in my javascript variables of my visualforce page..

Help me with an example so that i can clearly work out it..

                               Thanking You,
       

Hi I have a vpage as follows..


<apex:outputLabel style="font-weight:bold;" value="Search By Branch Code" ></apex:outputLabel>
        <apex:inputText value="{!textData}"/>

 

Iam trying to pass this input textfield value(what ever i enter) to the controller by using getters and setters but iam not able to pass the value its passing  just anull value

 

Getters and setters as below

 

private String textdata = null;

    public String getTextData() { return textdata; }
    public void setTextData(String data) { textdata = data; }
 

 So Some one plz help me in passing myy in put field value to controller so that i want to use that value in my soql query

 

Eg:

CAF_Bank__c [] currentbanknames=[SELECT  Bank_Name__c FROM CAF_Bank__c  where Branch_Code__c=:textdata];

            So plz tell me with an example.............

 

       

 

                                                                                                    Thanks& Regards

                                                                                                          Anu...

Hi everyone i have a list in my Apex class which has soql query result..

        

String query = 'SELECT  City,Latitude__c FROM Lead WHERE City LIKE \''+city+'%\'';
       
        leadrecords = Database.query(query);   

 

Eg :in the above line leadrecords is alist of lead type

 

    private List<Lead> leadrecords;

 

So now iam trying to pass this list to ajavascript variable so dat javascript variable should have query  output...but when i have done like this iam able to pass the list but when iam tryong to display that it is displaying the  ids  but i want to display the field city and latitude which are storesd in that list how to do it please someone help me with the solution... to javascript variable so how to pass this list to javascript variable

  

Hi everyone i have created 2 visualforce pages as follows..code is as below..

 

Parent window(visualforce page 1)

 

<apex:page >

<form method=post action='' name=f1>
<table border=0 cellpadding=0 cellspacing=0 width=550> <tr>
<td ><font size=2 face='Verdana'>Your Name</font><input type=text name='p_name' size='8'>
<!--<a href="#" NAME="My Window Name" title=" My title here "
onClick=window.open("https://chiranjeevi.ap1.visual.force.com/apex/childwindow","Ratting",
"width=550,height=170,left=150,top=200,toolbar=1,status=1,");>Click here to open the child window</a>-->
<A href="javascript:void(0)"
onclick="window.open('https://chiranjeevi.ap1.visual.force.com/apex/childwindow')">
Open a new window</A>

</td></tr> </table></form>

</apex:page>

 

Child Window (visualforce page 2)

 

<apex:page >
<html>
<head>

<script langauge="javascript">
window.onLoad=new function()
{
post_value();
}
function post_value(){
opener.document.f1.p_name.value = document.frm.c_name.value;
self.close();
}
</script>

<title>(Type a title for your page here)</title>
</head>


<body bgcolor="#ffffff" text="#000000" link="#0000ff" vlink="#800080" alink="#ff0000">

<form name="frm" method=post action=''>
<table border=0 cellpadding=0 cellspacing=0 width=250>


<tr><td align="center"> Your name<input type="text" name="c_name" size=12 value=test>
 <body onload="post_value()"  style="font-family: Arial;border: 0 none;">
<input type=button value='Submit' onclick="post_value();">
<!-- <form action="#" onsubmit="post_value(); return false">-->
</td></tr>
</table></form>
</apex:page>

 

So in parent window when i click on link i can navigate to new window which is nothing but child window...

 

Now in child windowif i enter some input value and click submit button iam not able to pass this parti8cular value to the parent window but i want to pass values to the parent window whenevcer i click submit button...

 

So please help me to  do it..

 

                                                                                     Thanks and regards,

                                                                                              Anu...

Hi,

 

In my appliction two objects are there.

SeafootNote:Any Refund(checkbox),SFN Number(text)

Refund:Refund Amount(Input Field(Number)),

           SFN Number(lookup filed)which is looking over to SFN Number in SeafootNote

 

If i enter the  value in SFN Number and Refund amount in Refund object i want to make true in the Any refund field of correspondingSFN Number record in SeaFootNote object.But my trigger is not working properly.If i enter the new record in SeaFootNote ,though i didnt select the checkbox in Any Refund input field after saving the record Any Refund field is checked.

 

Plz tell me where i am going wrong in my code.

 

My code is as follows:

trigger refund on chiranjeevi__Sea_Foot_Note__c (before insert,before update) {

 List<chiranjeevi__Refund__c> refundlist=new List<chiranjeevi__Refund__c>();
 for (chiranjeevi__Sea_Foot_Note__c a : Trigger.new)
 refundlist=[SELECT  chiranjeevi__Refund_Amount__c from chiranjeevi__Refund__c where chiranjeevi__SFN_Number__c=:a.chiranjeevi__SFN_number__c];
 if(refundlist<>null)
 {
  for (chiranjeevi__Sea_Foot_Note__c a : Trigger.new)
  a.chiranjeevi__Any_refund__c=true;
 }
 }
 Thanks in advance,

 Anu..

Hi,

 

I am finding accumulated sum in some objects.My logic is worked in some objects.In some other objects the following error is raising.

 

Review all error messages below to correct your data.
Apex trigger chiranjeevi.mbltotal caused an unexpected exception, contact your administrator: chiranjeevi.mbltotal: execution of BeforeInsert caused by: System.NullPointerException: Attempt to de-reference a null object: Trigger.chiranjeevi.mbltotal: line 10, column 15

 

my code is as follows:

 

trigger mbltotal on chiranjeevi__Sea_Foot_Note__c (before insert,before update) {
Double objBtotal = 0;
List<chiranjeevi__Master_Bill_Of_Ladding__c> objAlist=new List<chiranjeevi__Master_Bill_Of_Ladding__c>();
for(chiranjeevi__Sea_Foot_Note__c b : Trigger.new)
objAlist=[SELECT chiranjeevi__Console_charges__c,chiranjeevi__SFN_no__c FROM chiranjeevi__Master_Bill_Of_Ladding__c Where chiranjeevi__SFN_no__c =: b.Id];
for (chiranjeevi__Sea_Foot_Note__c objA : Trigger.new)
{
for (chiranjeevi__Master_Bill_Of_Ladding__c objB : objAlist)

 objBtotal += objB.chiranjeevi__Console_charges__c;
   objA.chiranjeevi__Total_service_charges__c=objBtotal;

}    
}


If any one find out the solution plz help me.

 

Thanks in advance,

Anu..

 

Hi every one,

 

I want to find sum of different input fields from different objects and assign total sumto one field in main object using salesforce.All objects have one common field like SFN Number.In main object this SFN Number is input field.Remaing all other objects have SFN Number field look over to main object SFN Number.Main object have Total amount input field.Remaining all objects have amount inputfield.i want to find the sumof all amounts which have same SFN Numbers and assign it to the total amount field which is in main object corresponding SFN Number record.

 

Plz give me some guidance how to achieve this functionality.

 

Thanks in advance

 

 

Hi Every one,

 

I am new to write triggers.In my application 3 objects are there Obj A,Obj B,Obj C.

Obj A-SFN Number(Input field(text),Total Amount(Number))

Obj B-SFN Number(lookup(ObjA),Amount(Number))

Obj C-SFN Number(lookup(ObjA),Amount(Number))

 

Here i need to calculate sum of amount from Obj B and Obj C and assign the total value to Total Amount in

Obj A by using triggers.

 

Exception is raising as follows:

 

contact your administrator: chiranjeevi.summation: execution of BeforeInsert caused by: System.QueryException: List has no rows for assignment to SObject: Trigger.chiranjeevi.summation: line 4, column 96

 

My code is as follows:

 

trigger summation on chiranjeevi__Obj_A__c (before insert,before update) {
decimal ObjATotal,ObjBAmount,ObjCAmount;
for(chiranjeevi__Obj_A__c a : Trigger.new)
ObjBAmount=[Select Amount__c from chiranjeevi__Obj_B__c where SFN_Number__c =:a.SFN_Number__c].Amount__c;
for(chiranjeevi__Obj_A__c b : Trigger.new)
ObjBAmount=[Select Amount__c from chiranjeevi__Obj_C__c where SFN_Number__c =:b.SFN_Number__c].Amount__c;

for(chiranjeevi__Obj_A__c c : Trigger.new)
c.Total_Amount__c=ObjBAmount+ObjCAmount;
}

 

If any one knows plz help me.

 

Thanks & Regards,

Anu..

 

Hi everyone,

 

i have 2 objects for example Object A ,Object B.Now my requirement is in such a way , that object A & B are not related to each other....No masterdetail relationship is  there between A& B.But i want to write a trigger in such a way,that when the trigger (afer insert,after,update,before insert,before update)  on Object A fires then i want to update the fields in object B (For example updating a checkbox field in object B).....  

 

SO as iam new to triggers in salesfo.rce, please help me with an example code.....for doing cross field updation

 

Thanks&Regards,

Anu..

Hi,

 

I have requirement where in onclick of command button a Pop-up VF is required to open where in user will Find the new user using the Custom application which i have already developed in Apex and VF.

 

Now the User which comes as a result of search on new VF page, User will select the checkboxes in front of them and click save.

 

On click of Save, the new window should get closed and the selected on the selected user should get added onto the previous page from where i opened the VF page of searching the user.

 

Any help will be greaatly appreciated.

 

Thanks

 

 I'm trying to pass the current value of the inputfield id TechCenter to my apex controller, but my code below passes in null (which i assume because the field hasn't been assigned yet. I want to pass the value in this field, not the previous value to my apex class. This is an actionsupport rerender on a panel, so it's a partial page update.

 

<apex:pageblockSectionItem >
<apex:outputLabel value="Tech Center" for="TechCenter"></apex:outputLabel>
<apex:actionRegion >
<apex:inputField id="TechCenter" value="{!bc.Technical_Center__c}" required="true">
<apex:actionSupport event="onchange" rerender="AddressPanel" status="status1">
<apex:param id="tc" value="{!bc.Technical_Center__c}"/>
</apex:actionSupport>
</apex:inputField>
</apex:actionRegion>
</apex:pageblockSectionItem>