• anu_karthi
  • NEWBIE
  • 25 Points
  • Member since 2009

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

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>