• Kiran Kumar Gottula
  • NEWBIE
  • 4 Points
  • Member since 2012
  • Sr.Software Enginner
  • Appshark

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 39
    Questions
  • 29
    Replies
Hi folks,
please help out.

When I click on standard convert button on lead. i want to check the Cancel_Workflow__c check box field and updating it. after that it will navigate to standard lead convert page with auto update the opportunity name with some field in lead record. which is given below. while saving the vf page. i have some error message. am I miss anyhting?

Error : Error: Syntax error. Found '['

FYI:

<apex:page standardController="Lead" > 
<apex:form > 
  <div style="visibility:hidden;"> 
    <apex:inputField value="{!Lead.Cancel_Workflow__c}" id="cancelWorkflow" style="visibility:hidden; "/> 
  </div> 
  <apex:actionFunction name="quickSave" action="{!quickSave}" oncomplete="standardConvert();"/> 
  <apex:actionFunction name="standardConvert" 
    action="{{!URLFOR("/lead/leadconvert.jsp", lead.id, 
    [&sem="1",&noopptt=Lead.FirstName, Lead.LastName - Lead.Departure_City_Leg_1__c-Lead.Arrival_City_Leg_1__c - Lead.Departure_Date_Leg_1__c,&IsReminderSet_fu="0"] , [retURL=$CurrentPage.parameters.retURL], true)}}" />
  <script language="JavaScript"> 
    var previousOnload = window.onload; 
    window.onload = function() { 
      if (previousOnload) previousOnload(); 
      fixLead(); 
    } 
    function fixLead() { 
      var elemCancelWorkflow = document.getElementById('{!$Component.cancelWorkflow}'); 
      elemCancelWorkflow.checked = true; 
      quickSave(); 
    } 
  </script> 
</apex:form> 
</apex:page>



 

Hi ,

 

I am facing 

 

"The image is not available because:

You don't have privileges to see it or

It has been removed from the system."

 

This error message is displaying in the image box, but not displaying image in the atricle details.

 

Please help me. why it is displaying..!

 

How to display the article Details in VF Page from Controller. After this , how can we print all Article Details in the PDF format. Appreciate for your help.

How to display the article Details in VF Page from Controller.

 

After this , how can we print all Article Details in the PDF format.

 

Appreciate for your help.

I already used ,

 

cache="true" sidebar="false" expires="0" standardstylesheets="false

" contentType="application/vnd.ms-powerpoint#Test.ppt" 

 

But ,I am not getting results.and refere so many blogs and boards also...

 

So please help me for getting PPT format with slides also.

 

Thanks in advance.

I want to display 2 weeks Opportunities  data in the fallowing table.

 

How to display ....?

Please help me 

 

 

    Statistics                                                      This Week (opportunities)           Previous Week (opportunities)    

 

Total Amount(Sum of Amount )                                             4000                           4500

 No of Opp (Count)                                                                     10                                 12

Hi All,

 

How to create a record lookup for acount in flows.

 

Please show me steps wise.

 

Plz help me , I have no idea about aggregate results.

 

display last two weeks opportunities sum(amount) group by stagename="closed won" and stagename ="closed lost"

 

 

week wise   closed wons  closed losts

 

1st week        2000/-              100/-             ( total opportunities in 1st week )

 

2nd week       2500/-               250/-            (total opportunities in 2st week)

 

 

please post controller

How to display sum of closes won's sum(amount) , closed lost's sum(amount)  from opportunity in a table.

 

Closedwons  Closedlost

1000/-                    2000/-

200/-                       100/-

 

Based on weekly report

 

Evert week we need to display like that.

 

lz help me

 

childobject__c is a custom object. and Opportunity is a standard object.

 

Opportunity having M_01__c,M_02__c,M_03__c,........M_24__c fields.

 

I want to insert each opportunity field  in every record in childobject__c.

 

(dont use comparing of  'i' values in for loop, I want to passs dynamically i value in api names)

The fallowing approch is correct or not..! if not show me best way.

 

Please help me ..............

 

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

 

trigger rampScheduler on Opportunity (after insert, after update){

if(RecursiveUtilitycls.startramp == true){
RecursiveUtilitycls.startramp = false;


List<childobject__c> insertobjchild = new List<childobject__c>();

if(Trigger.newMap.keySet().size()>0){

for(Opportunity opp : Trigger.new){

for(Integer i=1;i<25;i++){


childobject__c r = new childobject__c();


r.Opportunity__c = opp.Id;

if(i<10){
r.No_of_seats__C = opp.'M_0'+i+'__c';
}else{
r.No_of_seats__C = opp.'M_'+i+'__c';
}

insertobjchild.add(r);
}
}
if(insertobjchild.size()>0)
insert insertobjchild;
}
}
}

I am getting this error while writing test class for a trigger on opportunity for trigger events like after insert , befre insert , after update.before update

 

Please help me.......

 

System.DmlException: Insert failed. First exception on row 0; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, OpportunityOneTrigger: execution of AfterInsert.

 

Class.TestAutoLaunchApprovalTrg.myUnitTest: line 80, column 1

 

@isTest
private class TestAutoLaunchApprovalTrg {
 
    static testMethod void myUnitTest() {
        list<RecordType> rectype = [select Id,name from RecordType where SobjectType='Opportunity'];
        map<string,Id> mprecname = new map<string,Id>();
        for(RecordType rec:rectype){
            mprecname.put(rec.Name,rec.Id); 
        }
        decimal MgmtQuarterlyFees = 20000;   
        decimal Expected = 1000;        
        Account acc = [select Id,name from Account limit 1];
        User uUnderwriter = [select Id from User where UserRole.Name = 'Global Coverage Underwriter' and IsActive = true limit 1];
//Inserting Opportunity 
        Opportunity opp = new Opportunity(); 
        opp.RecordTypeId = mprecname.get('META Documentation');
        opp.MEA_vs_Global__c = 'Global';
        opp.MGEC_Anticipated_Funding_Date__c = system.today();
        opp.Customer_Reply_Deadline__c = system.today();
        opp.Country__c = 'Algeria';
        opp.Name = 'Test Auto Launch Approval Trg'; 
        opp.AccountId = acc.Id;
        opp.MGEC_Confidence__c = '10%';
        opp.StageName = 'Prospecting';
        opp.MGEC_Vs_Customer__c = 'Both';
        opp.Comments_Next_Steps__c = 'cmts';
        opp.Opportunity_Source__c = 'EFS';
        opp.Risk_Closing_Memo_Attached__c = true;
        opp.Legal_Checklist_attached__c = true;
        opp.Final_Pricing__c = true;
        opp.KYC_Docs_Attached__c = true;
        opp.Tax_Checklist_Attached__c = true;
        opp.IC_Minutes_Attached__c = true;
        opp.Commitment_Fee_closing__c = 30;
        opp.Adjusted_ROE_closing__c = 23;
        opp.Adjusted_ROI_Closing__c = 18;
        opp.EBITDA_Closing__c = 13;
        opp.Spread_bps_closing__c = 12;
        opp.Anchor_Fee_closing__c = 11;
        opp.Loss_Provision_closing__c = 10;
        opp.MGEC_Asset_Class__c = 'Equity';
        opp.Deal_Pole__c = 'MEA';
        opp.MGEC_Deal_Category__c = 'Retro';  
        opp.MGEC_Vertical__c = 'SME';
        opp.Fixed_Floating__c = 'Fixed';
        opp.Lease_Loan__c = 'Loan';
        opp.CurrencyIsoCode = 'USD';
        opp.MGEC_Commitment_Amount__c = MgmtQuarterlyFees;
        opp.Expected_O_S__c = Expected;
        opp.MGEC_MNPI__c = 'Yes';
        opp.MGEC_Confidential__c = 'No';
        opp.CloseDate = system.today();        
        opp.ERM__c = true;
        opp.Program_New_Exist__c = 'New';
        opp.Compliance_Approvers__c = 'Pierre Abinakle';        
        opp.MDC_Representative_META__c = 'MDC Rep';
        opp.GE_Representative_META__c = 'GE Rep';
        opp.Underwriter__c = uUnderwriter.Id; 
        insert opp;
        Opportunity opp1 = opp.clone(false,true);
        opp1.RecordTypeId = mprecname.get('META Term Sheet'); 
        insert opp;
        opp1.RecordTypeId = mprecname.get('META underwriting');
        update opp1;
    }
}

 

 

When I run test class, i faces these exception of below,

 

Error meassage :  System.QueryException: List has no rows for assignment to SObject .

 

How to overcome from this error..

 

plz help me anyone....

 

 

public with sharing class rampschedularcls {

public opportunity opp{get;set;}
public boolean check {get;set;}
public string opportunityid = ApexPages.currentPage().getParameters().get('oppid');
public opportunity opp1 = [select id,Ramp_schedule_start_with_current_month__c from opportunity where id=:opportunityid ];

 



//This is the constructor of rampschedularcls
public rampschedularcls(){

if(opp1.Ramp_schedule_start_with_current_month__c == true )
check = true;
else
check = false;
}

//updating the current opportunity
public pagereference save(){

//opp = [select id,Ramp_schedule_start_with_current_month__c from opportunity where id=:opportunityid ];
if(check == true){
opp1.Ramp_schedule_start_with_current_month__c =true;
}else{
opp1.Ramp_schedule_start_with_current_month__c = false;
}
update opp1;

return (new pagereference('/'+opportunityid).setredirect(true));
}


// Test Class
static testMethod void rampschedularcls() {

account acc = new account();
acc.Name = 'test account';
acc.Account_Type__c = 'test type';
acc.New_Existing_Client__c = 'test client';
acc.Prospect_Source__c = 'test source';
acc.Market__c = 'test market';
acc.CurrencyIsoCode = 'EUR';
insert acc;

opportunity opp = new opportunity();
opp.Name = 'test opportunity';
opp.AccountId = acc.id;
opp.Language__c = 'English';
opp.StageName = 'test stage';
opp.Signed_Contract_Attached__c = 'NO';
opp.AHR__c = 3;
opp.Ramp_schedule_start_with_current_month__c = true;
opp.CurrencyIsoCode = 'EUR';
opp.CloseDate = System.today();
insert opp;

opportunity opp1 = new opportunity();
opp1.Name = 'test opportunity';
opp1.AccountId = acc.id;
opp1.Language__c = 'English';
opp1.StageName = 'test stage';
opp1.Signed_Contract_Attached__c = 'NO';
opp1.AHR__c = 3;
opp1.Ramp_schedule_start_with_current_month__c = false;
opp1.CurrencyIsoCode = 'EUR';
opp1.CloseDate = System.today();
insert opp1;

rampschedularcls rampcls = new rampschedularcls();
rampcls.opportunityid = opp.Id;
rampcls.check = true;
rampcls.save();

rampschedularcls rampclss = new rampschedularcls();
rampclss.opportunityid = opp1.Id;
rampclss.check = false;
rampclss.save();

}
}

 

 

 

how to avoid duplicate phone number in contact.

 

please help me.

trigger on Projects  :--

 

parent object  : Projects

child object  : Milestone

child to child object  : tasks

 

When  after updating  a record in project (change any field value),  then first update the tasks records which is related to this updating project record, then after update the milestone record with help of recent updated tasks which is related to this updating project record.

 

please help me by using trigger only

 

Hi frndz ! 

                      How to upload a content document file in any object through only developer console.

 

                      Please help me that code.

Hi Every one,

                         In my account object  "Total Amount" field is there,

                         and in opportunity "amount" field  is there,

                         

                        I want to dispaly sum of amount of all child  opportunities in the total amount field in the parent account.

 

                       So please help me, how to write trigger for that.

Auto completion  works good on standard object lookup , 

 

But Not work on custom object (user) lookup.

 

Please help me. why it happen like this.

How to Make the leadsource picklist as resctricted picklist on contact object ??????????

we Assign task to multiple users right.
When one of user complete the task then automatically change that  task’s status into complete of all user.

 

Please send me the trigger......... ......

we Assign task to multiple users right.
When one of user complete the task then automatically change that  task’s status into complete of all user.

 

Please send me the trigger......... .......

Hi guys I am trying to inovke a webservice call using the classes generated from the wsdl2apex and I get the following error and I am not sure what exactly the issue is when I use soapui I get a response any help here would be appreciated
Hi folks,
please help out.

When I click on standard convert button on lead. i want to check the Cancel_Workflow__c check box field and updating it. after that it will navigate to standard lead convert page with auto update the opportunity name with some field in lead record. which is given below. while saving the vf page. i have some error message. am I miss anyhting?

Error : Error: Syntax error. Found '['

FYI:

<apex:page standardController="Lead" > 
<apex:form > 
  <div style="visibility:hidden;"> 
    <apex:inputField value="{!Lead.Cancel_Workflow__c}" id="cancelWorkflow" style="visibility:hidden; "/> 
  </div> 
  <apex:actionFunction name="quickSave" action="{!quickSave}" oncomplete="standardConvert();"/> 
  <apex:actionFunction name="standardConvert" 
    action="{{!URLFOR("/lead/leadconvert.jsp", lead.id, 
    [&sem="1",&noopptt=Lead.FirstName, Lead.LastName - Lead.Departure_City_Leg_1__c-Lead.Arrival_City_Leg_1__c - Lead.Departure_Date_Leg_1__c,&IsReminderSet_fu="0"] , [retURL=$CurrentPage.parameters.retURL], true)}}" />
  <script language="JavaScript"> 
    var previousOnload = window.onload; 
    window.onload = function() { 
      if (previousOnload) previousOnload(); 
      fixLead(); 
    } 
    function fixLead() { 
      var elemCancelWorkflow = document.getElementById('{!$Component.cancelWorkflow}'); 
      elemCancelWorkflow.checked = true; 
      quickSave(); 
    } 
  </script> 
</apex:form> 
</apex:page>



 
Hi guys i am having picklist with the values shipment and picked.
whenever shipment is selected one text box should be enabled and when ever we select the picked the text box should be disabled how is it possible ? is it possible through customization

hi,
any one implemented Account hirearchy view in a tree format, please share the code, I have found some code but those are not working. please help

here my input like this given below ;
1.string d1=27/11/2014 14:23:16

2.string d2=11/27/2014 14:23:16

3.strind d3=2014/11/27 14:23:16

4.string d4=2014/27/11 14:23:16
i need a like this output please help me any
Output
=============================================
final output like this : 11/27/2014 9:06 AM
here my input like this given below ;
1.string d1=27/11/2014 14:23:16

2.string d2=11/27/2014 14:23:16

3.strind d3=2014/11/27 14:23:16

4.string d4=2014/27/11 14:23:16
i need a like this output please help me any
Output
=============================================
final output like this : 11/27/2014 9:06 AM
i need to send an e-mail to a particular user every day? Please suggest me posible ways to do this?????



Thanks in advance.
  • November 28, 2014
  • Like
  • 0
how to apply a validation rule for existing records??? Please suggest me how to do this.


Thanks in advance.
  • November 28, 2014
  • Like
  • 0
Hi, I come across a need to fill this requirement.

1. Create a custom Link that will redirect users to a custom report - DONE
2. Apex code to pass the parameter for the report to the custom link

Can anybody give me an idea how to do step #2?

Thanks :)
  • November 28, 2014
  • Like
  • 0
Hello,
Can anyone help me out, I am stuck in  problem, I want to upload attachment in professional org, I can do this by "apex data loader" but salesforce org API has been disabled, So there is last option of jitter data loader.

But whenever i upload attachment , It attached in "byte" form, Attachment is not being uploaded in proper size, I have tried everything from google also i converted my csv file "fields" in to Base64EncodeFile("<TAG>Sources/Files/One attachment.csv (16)</TAG>",...) , Even though it's giving same result, Please help me out. I would be very thankful

 

How to display the article Details in VF Page from Controller. After this , how can we print all Article Details in the PDF format. Appreciate for your help.

childobject__c is a custom object. and Opportunity is a standard object.

 

Opportunity having M_01__c,M_02__c,M_03__c,........M_24__c fields.

 

I want to insert each opportunity field  in every record in childobject__c.

 

(dont use comparing of  'i' values in for loop, I want to passs dynamically i value in api names)

The fallowing approch is correct or not..! if not show me best way.

 

Please help me ..............

 

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

 

trigger rampScheduler on Opportunity (after insert, after update){

if(RecursiveUtilitycls.startramp == true){
RecursiveUtilitycls.startramp = false;


List<childobject__c> insertobjchild = new List<childobject__c>();

if(Trigger.newMap.keySet().size()>0){

for(Opportunity opp : Trigger.new){

for(Integer i=1;i<25;i++){


childobject__c r = new childobject__c();


r.Opportunity__c = opp.Id;

if(i<10){
r.No_of_seats__C = opp.'M_0'+i+'__c';
}else{
r.No_of_seats__C = opp.'M_'+i+'__c';
}

insertobjchild.add(r);
}
}
if(insertobjchild.size()>0)
insert insertobjchild;
}
}
}

When I run test class, i faces these exception of below,

 

Error meassage :  System.QueryException: List has no rows for assignment to SObject .

 

How to overcome from this error..

 

plz help me anyone....

 

 

public with sharing class rampschedularcls {

public opportunity opp{get;set;}
public boolean check {get;set;}
public string opportunityid = ApexPages.currentPage().getParameters().get('oppid');
public opportunity opp1 = [select id,Ramp_schedule_start_with_current_month__c from opportunity where id=:opportunityid ];

 



//This is the constructor of rampschedularcls
public rampschedularcls(){

if(opp1.Ramp_schedule_start_with_current_month__c == true )
check = true;
else
check = false;
}

//updating the current opportunity
public pagereference save(){

//opp = [select id,Ramp_schedule_start_with_current_month__c from opportunity where id=:opportunityid ];
if(check == true){
opp1.Ramp_schedule_start_with_current_month__c =true;
}else{
opp1.Ramp_schedule_start_with_current_month__c = false;
}
update opp1;

return (new pagereference('/'+opportunityid).setredirect(true));
}


// Test Class
static testMethod void rampschedularcls() {

account acc = new account();
acc.Name = 'test account';
acc.Account_Type__c = 'test type';
acc.New_Existing_Client__c = 'test client';
acc.Prospect_Source__c = 'test source';
acc.Market__c = 'test market';
acc.CurrencyIsoCode = 'EUR';
insert acc;

opportunity opp = new opportunity();
opp.Name = 'test opportunity';
opp.AccountId = acc.id;
opp.Language__c = 'English';
opp.StageName = 'test stage';
opp.Signed_Contract_Attached__c = 'NO';
opp.AHR__c = 3;
opp.Ramp_schedule_start_with_current_month__c = true;
opp.CurrencyIsoCode = 'EUR';
opp.CloseDate = System.today();
insert opp;

opportunity opp1 = new opportunity();
opp1.Name = 'test opportunity';
opp1.AccountId = acc.id;
opp1.Language__c = 'English';
opp1.StageName = 'test stage';
opp1.Signed_Contract_Attached__c = 'NO';
opp1.AHR__c = 3;
opp1.Ramp_schedule_start_with_current_month__c = false;
opp1.CurrencyIsoCode = 'EUR';
opp1.CloseDate = System.today();
insert opp1;

rampschedularcls rampcls = new rampschedularcls();
rampcls.opportunityid = opp.Id;
rampcls.check = true;
rampcls.save();

rampschedularcls rampclss = new rampschedularcls();
rampclss.opportunityid = opp1.Id;
rampclss.check = false;
rampclss.save();

}
}

 

 

 

Is there a way to access public calendar and resources from APEX? 

 

Here is what I trying to do:

 

Given a event, I want to find the name of the public calendar and also find the name of the resource invited to the event. Event.OwnerId gives me the public calendar id. But, I not able to find the public calendar name. Likewise, I can query EventAttendee to find the AttendeeId, but I can't seem to find a way find to find the resource name.

 

Any thoughts / suggestions? Thanks a lot.

  • April 09, 2011
  • Like
  • 0

 

We are currently a user of Echosign for Salesforce and we are in the process of automating the creation of echosign details with a click of a button.
What we would like is to create the Echosign's agreement record, fill up all the necessary fields, create the agreement record and then attach the document and possibly send the document to the recepient all in one go via Force.com Sites.
Everything is currently working quite well like the agreement record gets created and the attachment automatically attached but the problem is that when I try to click the "Send to Echosign", it doesn't send anything to me although the status says that it was already sent.
I tried creating one manually using the exact information inside Salesforce via the Agreemnt tab and it was able to send me the email notification that I have an agreement to sign.
Any ideas if there are any difference between creating a record manually vs. creating it via code? It seems like the Agreement tab only uses the standard Salesforce pages.
You could refer to my code below.
echosign_dev1__SIGN_Agreement__c agmt = new echosign_dev1__SIGN_Agreement__c();
agmt.Name = 'Sample Agreement';
agmt.Social_Ads_Campaign__c = currentSACId; // Custom lookup field 
agmt.echosign_dev1__Recipient__c = getselectedSAC().Delivery_Partner_Contact__c;// Contact field
agmt.echosign_dev1__RemindRecipient__c = 'Every Day, Until Signed'; 
agmt.echosign_dev1__SenderSigns__c = true;
agmt.echosign_dev1__Message__c = 'Please sign the attached Insertion Order';
agmt.echosign_dev1__SignatureType__c = 'e-Signature';
agmt.echosign_dev1__PasswordProtectSign__c = false; 
agmt.echosign_dev1__SenderSigns__c = true;           
agmt.echosign_dev1__PasswordProtectPDF__c = false;  
agmt.echosign_dev1__SignatureOrder__c = 'I sign, then the Recipient signs';
agmt.echosign_dev1__Status__c = 'Draft';
insert agmt;

 

We are currently a user of Echosign for Salesforce and we are in the process of automating the creation of echosign details with a click of a button.


What we would like is to create the Echosign's agreement record, fill up all the necessary fields, create the agreement record and then attach the document and possibly send the document to the recepient all in one go via Force.com Sites.
Everything is currently working quite well like the agreement record gets created and the attachment automatically attached but the problem is that when I try to click the "Send to Echosign", it doesn't send anything to me although the status says that it was already sent.

 

I tried creating one manually using the exact information inside Salesforce via the Agreemnt tab and it was able to send me the email notification that I have an agreement to sign.

 

Any ideas if there are any difference between creating a record manually vs. creating it via code? It seems like the Agreement tab only uses the standard Salesforce pages.


You could refer to my code below:

 

echosign_dev1__SIGN_Agreement__c agmt = new echosign_dev1__SIGN_Agreement__c();
agmt.Name = 'Sample Agreement';
agmt.Social_Ads_Campaign__c = currentSACId; // Custom lookup field 
agmt.echosign_dev1__Recipient__c 			= getselectedSAC().Delivery_Partner_Contact__c;// Contact field
agmt.echosign_dev1__RemindRecipient__c 		= 'Every Day, Until Signed'; 
agmt.echosign_dev1__SenderSigns__c			= true;
agmt.echosign_dev1__Message__c 				= 'Please sign the attached Insertion Order';
agmt.echosign_dev1__SignatureType__c 		= 'e-Signature';
agmt.echosign_dev1__PasswordProtectSign__c 	= false; 
agmt.echosign_dev1__SenderSigns__c 			= true;           
agmt.echosign_dev1__PasswordProtectPDF__c 	= false;  
agmt.echosign_dev1__SignatureOrder__c 		= 'I sign, then the Recipient signs';
agmt.echosign_dev1__Status__c 				= 'Draft';
insert agmt;

PageReference pdfPage = Page.SocialAdCampaignIOPDF;
pdfPage.getParameters().put('id', currentSACId);
Blob pdfBlob = Blob.valueOf('Sample PDF');
pdfBlob = pdfPage.getContentAsPDF();
String filename = agmt.Name + ' ' + DateTime.Now().format('MM-dd-yy') + '.pdf';
Attachment a = new Attachment(parentId = agmt.id, name=filename, body = pdfBlob, ContentType = 'application/pdf');
insert a;