-
ChatterFeed
-
0Best Answers
-
0Likes Received
-
0Likes Given
-
14Questions
-
23Replies
-
- Ganu
- February 25, 2010
- Like
- 0
- Continue reading or reply
SF to mysql
-
- Ganu
- March 09, 2009
- Like
- 0
- Continue reading or reply
SF to Mysql
I am able to Synchronize the Account table from Salesforce to Mysql using Xampp. The records are getting inserted. If I add new fields in SF, I would like my PHP to automatically create the fields in Mysql. Please guide me.
-
- Ganu
- March 06, 2009
- Like
- 0
- Continue reading or reply
VF page to Site
<apex:page showHeader="false" sidebar="false"> <apex:form > <apex:flash src="{!$Resource.Gaugesemicircular}" flashvars="Maxi" width="110%" height="150%" play="true"/> </apex:form> </apex:page>
Please let me know where I commited mistakes?
-
- Ganu
- December 22, 2008
- Like
- 0
- Continue reading or reply
flex component integration
<apex:page> <apex:flash height="55%" width="80%" src="{!$Resource.Gaugesemicircular}"></apex:flash> </apex:page>
-
- Ganu
- December 18, 2008
- Like
- 0
- Continue reading or reply
PE issues
In PE, I have overridden the Standard New button(opportunity) by Vforce page, And in Contact related list for opportunity I have created a custom list button and I remove the standard button from the view(which is overridden by vf page i.e. New), I have assign an scontrol for the custom button. When hit this custom button it call VF page rather than scontrol. Please give your suggestion!
--
Ganu
-
- Ganu
- December 15, 2008
- Like
- 0
- Continue reading or reply
SMS from SF to Mobile
-
- Ganu
- December 15, 2008
- Like
- 0
- Continue reading or reply
Lead Status
-
- Ganu
- November 26, 2008
- Like
- 0
- Continue reading or reply
Reg:sandbox
-
- Ganu
- November 10, 2008
- Like
- 0
- Continue reading or reply
Test Method for OpportunityContactRole
{
if(Trigger.isInsert || Trigger.isupdate)
{
for (Opportunity opp :Trigger.new)
{
Id OppId;
OppId = opp.Id;
Date Contactdate;
Double totgift=0;
OpportunityContactRole[] ThisOppRole = [select ContactId,Opportunity.Amount,Opportunity.CloseDate From
OpportunityContactRole WHERE Opportunity.Id = :opp.Id];
if (ThisOppRole.size()>0)
{
OpportunityContactRole[] ThisOppRole1=[select Id,ContactId,Opportunity.Amount,Opportunity.CloseDate From
OpportunityContactRole WHERE ContactId= :ThisOppRole[0].ContactId order by Opportunity.CloseDate DESC];
if (ThisOppRole1.size()>0)
{
Contactdate = ThisOppRole1[0].Opportunity.CloseDate;
for(integer i=0;i<ThisOppRole1.size();i++)
{
totgift+=ThisOppRole1[i].Opportunity.Amount;
}
Contact CurrentContact = [select Id,Last_Donation_Date__c,Total_of_all_gifts_given__c from Contact
where Id=:ThisOppRole1[0].ContactId];
CurrentContact.Total_of_all_gifts_given__c=totgift;
CurrentContact.Last_Donation_Date__c=Contactdate;
update CurrentContact;
}
}
}
}
Test Method:
public class DonationUpdateoncontacttest
{
public static testMethod void DonationUpdateonContact()
{
Id OppId;
Date Contactdate;
Double totgift=0;
Id ContactId=null;
integer i=0;
Account acc=new Account(Name='NewAcc');
insert acc;
Contact cp= new Contact(LastName='ContactTest',AccountId=acc.Id,Contact_type__c='Donor',Donor_Status__c='Active',Last_Donation_Date__c=system.today(),Total_of_all_gifts_given__c=12,Boardmember_type__c='Board chair',Member_Type__c='Current',Staff_Status__c='Current staff');
insert cp;
Opportunity oppc=new Opportunity (Name='Newopp',StageName='Posted',closedate=system.today(),Amount=10);
insert oppc;
OpportunityContactRole oppr=new OpportunityContactRole(Role='Donor',OpportunityId=oppc.Id,ContactId=cp.Id,Isprimary=true);
insert oppr;
OpportunityContactRole[] ThisOppRole = [select ContactId,Opportunity.Amount,Opportunity.CloseDate From
OpportunityContactRole WHERE Opportunity.Id = :oppc.Id];
OpportunityContactRole[] ThisOppRole1 = [select Id,ContactId,Opportunity.Amount,Opportunity.CloseDate From
OpportunityContactRole WHERE ContactId= :ThisOppRole[0].ContactId order by Opportunity.CloseDate DESC];
for(i=0;i<ThisOppRole1.size();i++)
{
totgift+=ThisOppRole1[i].Opportunity.Amount;
}
Contactdate = ThisOppRole1[0].Opportunity.CloseDate;
Contact CurrentContact = [select Id,Last_Donation_Date__c,Total_of_all_gifts_given__c from Contact
where Id=:ThisOppRole1[0].ContactId];
CurrentContact.Total_of_all_gifts_given__c=totgift;
CurrentContact.Last_Donation_Date__c=Contactdate;
update CurrentContact;
}
}
-
- Ganu
- November 04, 2008
- Like
- 0
- Continue reading or reply
Lookup layout
-
- Ganu
- October 09, 2008
- Like
- 0
- Continue reading or reply
rollupTrigger
Hi would anyone happen to know how to write a testmethod for my trigger below:
trigger rollupTrigger on Commitment_Draw__c (after insert, after update, after delete)
{
double totalSum = 0;
Commitment_Draw__c[] c = trigger.new;
if(Trigger.isUpdate || Trigger.isInsert)
{
for(Commitment_Draw__c cd : c)
{
for(Opportunity parent : [select Id,Name from Opportunity where Id = :cd.Opportunity__c])
{
for(Commitment_Draw__c childObject : [select Id,Opportunity__c,Amount__c from Commitment_Draw__c where Opportunity__c = :parent.Id])
{
totalSum += childObject.Amount__c;
}
parent.Rollup__c = totalSum;
update parent;
}
}
}
else if(Trigger.isDelete)
{
Commitment_Draw__c [] cold = Trigger.old;
for(Commitment_Draw__c oldobj :cold)
{
for (Opportunity parentObject : [select Id,Name from Opportunity where Id= :oldobj.Opportunity__c])
{
for (Commitment_Draw__c childObject : [select Id,Opportunity__c,Amount__c from Commitment_Draw__c where Opportunity__c = :parentObject.Id])
{
totalSum += childObject.Amount__c;
}
parentObject.Rollup__c = totalSum;
update parentObject;
}
}
}
}
-
- Ganu
- September 05, 2008
- Like
- 0
- Continue reading or reply
Triggers
Need Help on Apex class,
I need to create record in object A with the lookup reference in object B(Connector object) with some other fields in both the objects,
when i create a record in object A, it should create on B also.
now am running a trigger with (before insert,before update).
More helpfull when u send a sample code.
Thanks,
Ganu
-
- Ganu
- August 25, 2008
- Like
- 0
- Continue reading or reply
New Menu button on the View Page
-
- Ganu
- February 07, 2008
- Like
- 0
- Continue reading or reply
Display and Hide Fields
Hi,
I am a newbe here and i dont know if this is the right place to ask, but i will ask anyway.
I want to create 2 fields that appear in the Contact layout only when a 3rd field has a certain value, at all other times they are hidden or at least unaccesable.
How can i do that ?
Eran
- CCFI_Admin
- September 24, 2009
- Like
- 0
- Continue reading or reply
Invoking approval process from apex trigger
Hi,
I am encountering the following error when trying to invoke an approval process from a trigger.
changeAmounts: execution of AfterUpdate caused by: System.DmlException: Process failed. First exception on row 0; first error: ALREADY_IN_PROCESS, Cannot submit object already in process.: Trigger.changeAmounts: line 11, column 41
Here is the trigger code. I have tried several variations always with the same result. I have confirmed there is not an active approval process for the record.
trigger changeAmounts on Opportunity (after update) { Opportunity opp; opp = Trigger.old[0]; if (Trigger.old[0].Amount <> Trigger.new[0].Amount) { Approval.ProcessSubmitRequest req1 = new Approval.ProcessSubmitRequest(); req1.setComments('Submitting request for approval.'); req1.setObjectId(opp.id); Approval.ProcessResult result1 = Approval.process(req1); } }
Any help is appreciated.
Thanks.
- Kevinp211
- May 20, 2009
- Like
- 0
- Continue reading or reply
VF page to Site
<apex:page showHeader="false" sidebar="false"> <apex:form > <apex:flash src="{!$Resource.Gaugesemicircular}" flashvars="Maxi" width="110%" height="150%" play="true"/> </apex:form> </apex:page>
Please let me know where I commited mistakes?
- Ganu
- December 22, 2008
- Like
- 0
- Continue reading or reply
flex component integration
<apex:page> <apex:flash height="55%" width="80%" src="{!$Resource.Gaugesemicircular}"></apex:flash> </apex:page>
- Ganu
- December 18, 2008
- Like
- 0
- Continue reading or reply
SMS from SF to Mobile
- Ganu
- December 15, 2008
- Like
- 0
- Continue reading or reply
http call flex to salesforce
flex code: <—XML version="1.0" encoding="UDF-8"–> <Max:Application comeliness:Max="http://www.Adobe.Com/2006/maximal" layout="absolute" comeliness:salesforce="http://www.salesforce.com/" creationComplete="login(event)"> <salesforce:Connection id="apex" serverUrl="https://www.salesforce.com/services/Soap/u/x.x"/> <mx:Script> <![CDATA[ import mx.collections.ArrayCollection; import com.salesforce.results.QueryResult; import mx.utils.ObjectUtil; import mx.controls.Alert; import com.salesforce.AsyncResponder; import com.salesforce.objects.LoginRequest; import mx.rpc.events.FaultEvent; import mx.rpc.events.ResultEvent; private function login(event:Event):void { var lr:LoginRequest = new LoginRequest(); lr.server_url = parameters.server_url; lr.session_id = parameters.session_id; lr.username="uid"; lr.password="pwd+token"; lr.callback = new AsyncResponder(loadData, handleFault); apex.login(lr); } [Bindable] private var accountList:ArrayCollection = new ArrayCollection(); private function handleFault(fault:Object):void { Alert.show(ObjectUtil.toString(fault)); } private function loadData(lr:Object):void { apex.query("Select Name, Phone, Type From Account", new AsyncResponder( function(qr:QueryResult):void { if (qr.size > 0) { accountList = qr.records; } }, handleFault) ); test.send(); } public function yahoo(res:ResultEvent):void { Alert.show(res.result as String); } public function yahooFault(evt:FaultEvent):void { Alert.show(evt.fault.message); } ]]> </mx:Script> <mx:DataGrid dataProvider="{accountList}" left="10" right="10" top="10" bottom="10"> <mx:columns> <mx:DataGridColumn headerText="Name" dataField="Name"/> <mx:DataGridColumn headerText="Phone" dataField="Phone"/> <mx:DataGridColumn headerText="Type" dataField="Type"/> </mx:columns> </mx:DataGrid> <mx:HTTPService id="test" url="http://yahoo.com" resultFormat="text" result="yahoo(event)" fault="yahooFault(event)" method="GET" useProxy="false"/> </mx:Application> VF CODE: <apex:page sidebar="false" showHeader="false" title="FlexT"> <apex:form > <apex:flash width="1122" height="500" flashvars="session_id={!$Api.Session_ID}&server_url={!$Api.Partner_Server_URL_90}&buildingId={!building}" src="{!$Resource.s5}" /> </apex:form> </apex:page> Here am trying to make an http call to flex to salesforce. when am running my application in flex it is geting data and generating http response .but when am integrating flex resource as static resourses in salesforce ,am geting data on flex page.but their is no http reponse .I am geting the security error. faultCode:Channel.Security.Error faultString:'Security error accessing url' faultDetail:destination: DefaultHTTP' 1) I installed flex tool kit in proper place and enabled remote sitisetting and rigestered my site also. any one tell some solution for it˜.it is possible comunicate salesforce using http form flex to salesforce.
- gv007
- December 12, 2008
- Like
- 0
- Continue reading or reply
Is there a way to de-dup when mass loading contacts
- Gray
- November 25, 2008
- Like
- 0
- Continue reading or reply
Need help with getting owner profile ID on Case extract
I've been pulling my hair out on this one for the past few hours.
I'm running a CMD line data loader job to extract case data to send to Oracle. I need to be able to extract the Owner Profile ID so that I can filter my results later in SQL.
Right now, my best sample SOQL I have for testing is this:
Select Id, CaseNumber, ContactId, AccountId, OwnerId, Case.Owner.ProfileID FROM Case WHERE CaseNumber = '00836387'
However the return for Case.Owner.ProfileID comes back as a blank field even though it has a value elsewhere.
Am I missing something here.
Cheers,
Ward
- geis6
- November 21, 2008
- Like
- 0
- Continue reading or reply
Query Error In Custom Object
from Dongle__c,
where (Name = 'dongNum')");
- David Somekh
- November 20, 2008
- Like
- 0
- Continue reading or reply
Trigger issue updating fields
{
}
- James_Adapx
- November 18, 2008
- Like
- 0
- Continue reading or reply
Reg:sandbox
- Ganu
- November 10, 2008
- Like
- 0
- Continue reading or reply
Test Method for OpportunityContactRole
{
if(Trigger.isInsert || Trigger.isupdate)
{
for (Opportunity opp :Trigger.new)
{
Id OppId;
OppId = opp.Id;
Date Contactdate;
Double totgift=0;
OpportunityContactRole[] ThisOppRole = [select ContactId,Opportunity.Amount,Opportunity.CloseDate From
OpportunityContactRole WHERE Opportunity.Id = :opp.Id];
if (ThisOppRole.size()>0)
{
OpportunityContactRole[] ThisOppRole1=[select Id,ContactId,Opportunity.Amount,Opportunity.CloseDate From
OpportunityContactRole WHERE ContactId= :ThisOppRole[0].ContactId order by Opportunity.CloseDate DESC];
if (ThisOppRole1.size()>0)
{
Contactdate = ThisOppRole1[0].Opportunity.CloseDate;
for(integer i=0;i<ThisOppRole1.size();i++)
{
totgift+=ThisOppRole1[i].Opportunity.Amount;
}
Contact CurrentContact = [select Id,Last_Donation_Date__c,Total_of_all_gifts_given__c from Contact
where Id=:ThisOppRole1[0].ContactId];
CurrentContact.Total_of_all_gifts_given__c=totgift;
CurrentContact.Last_Donation_Date__c=Contactdate;
update CurrentContact;
}
}
}
}
Test Method:
public class DonationUpdateoncontacttest
{
public static testMethod void DonationUpdateonContact()
{
Id OppId;
Date Contactdate;
Double totgift=0;
Id ContactId=null;
integer i=0;
Account acc=new Account(Name='NewAcc');
insert acc;
Contact cp= new Contact(LastName='ContactTest',AccountId=acc.Id,Contact_type__c='Donor',Donor_Status__c='Active',Last_Donation_Date__c=system.today(),Total_of_all_gifts_given__c=12,Boardmember_type__c='Board chair',Member_Type__c='Current',Staff_Status__c='Current staff');
insert cp;
Opportunity oppc=new Opportunity (Name='Newopp',StageName='Posted',closedate=system.today(),Amount=10);
insert oppc;
OpportunityContactRole oppr=new OpportunityContactRole(Role='Donor',OpportunityId=oppc.Id,ContactId=cp.Id,Isprimary=true);
insert oppr;
OpportunityContactRole[] ThisOppRole = [select ContactId,Opportunity.Amount,Opportunity.CloseDate From
OpportunityContactRole WHERE Opportunity.Id = :oppc.Id];
OpportunityContactRole[] ThisOppRole1 = [select Id,ContactId,Opportunity.Amount,Opportunity.CloseDate From
OpportunityContactRole WHERE ContactId= :ThisOppRole[0].ContactId order by Opportunity.CloseDate DESC];
for(i=0;i<ThisOppRole1.size();i++)
{
totgift+=ThisOppRole1[i].Opportunity.Amount;
}
Contactdate = ThisOppRole1[0].Opportunity.CloseDate;
Contact CurrentContact = [select Id,Last_Donation_Date__c,Total_of_all_gifts_given__c from Contact
where Id=:ThisOppRole1[0].ContactId];
CurrentContact.Total_of_all_gifts_given__c=totgift;
CurrentContact.Last_Donation_Date__c=Contactdate;
update CurrentContact;
}
}
- Ganu
- November 04, 2008
- Like
- 0
- Continue reading or reply
Is it possible to change the name of the Standard Field?
- Kaja
- September 22, 2008
- Like
- 0
- Continue reading or reply
How to Import Activites
- Mark R.ax392
- September 16, 2008
- Like
- 0
- Continue reading or reply
Need Help with ISPICKVAL Validation Formula
- kfran
- September 06, 2008
- Like
- 0
- Continue reading or reply
Validation Rule: "Filter" valid Lookup options from Account Lookup
- BrianWK
- August 29, 2008
- Like
- 0
- Continue reading or reply
Apex Rollup Summary Fields
I wrote the following code (replaced object/field names for simplicity) to handle rollup summary fields in Apex. It works pretty well but I frequently get errors when operating on bulk records or if no records exist (out of bounds, etc).
ParentObject__c :has_many Objects__c
Can anyone provide input as to whether or not I'm handling this type of task properly?
trigger rollupTrigger on Object__c (after insert, after update, after delete) { double totalSum = 0; Object__c myObjects = trigger.new; if(Trigger.isUpdate || Trigger.isInsert) { for(Object__c object : myObjects) //assume more than 1 record in trigger.new { for(ParentObject__c parent : [select Id, Name from ParentObject__c where Id = :object.Parent_Object__c]) //get the parent object { for(Object__c childObject : [select Id, Name, Number__c where Parent_Object__c = :parent.Id]) //get all the objects that belong to the parent object { totalSum += childObject.Number__c; //sum the field of choice } parent.Total__c = totalSum; //set the total in the parent update parent // update the parent } } } else if(Trigger.isDelete) { Object__c [] oldObjects = Trigger.old; for(Object__c oldObject :oldObjects) //assume deletion of more than 1 record { for (ParentObject__c parentObject : [select id, Name, Number__c, Total__c where Id = :oldObject.Parent_Object__c]) //get the parent object(s) { for (Object__c childObject : [select id, Name, Number__c from Object__c where Parent_Object__c = :parentObject.id]) //get the records that belong to the parent { totalSum += childObject.Number__c; //sum the fields after a record has been deleted } parentObject.Total__c = totalSum; //set new total in parent update parentObject; //update parent } } //end oldObject for loop } //end else if } //end trigger
Thanks!
- Colin Loretz
- July 23, 2008
- Like
- 0
- Continue reading or reply
Flex Builder Standalone - "Security error accessing url" error
[FaultEvent fault=[RPC Fault faultString="Security error accessing url" faultCode="Channel.Security.Error" faultDetail="Destination: DefaultHTTP"] messageId="274B3986-6992-1A79-1276-D7DF53D645C3" type="fault" bubbles=false cancelable=true eventPhase=2]
The login function I'm using is below:
private function doLogin():void { var lr:LoginRequest = new LoginRequest(); lr.username = "devlogin@blablabla.com"; lr.password = "devloginpassword"; lr.server_url = "http://www.salesforce.com/services/Soap/u/9.0"; lr.callback = new AsyncResponder(loginResult, loginFault); conn.login(lr); }What am I doing wrong?
Thanks for any help,
Mike
- Force2b_Mike
- October 25, 2007
- Like
- 0
- Continue reading or reply