• chandra2ravi
  • NEWBIE
  • 25 Points
  • Member since 2010

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 19
    Questions
  • 19
    Replies
Custom Button(new contact) (aura not possible with lwc?) experiencing a lot of issues with record edit form. buttons are off and scrolling for 5 more fields. 
Note: working fine if we use standard button
@rajvakati
Hi,

I am getting following error while using the parse xml.

Exception

null Exception: Failed to parse XML due to: entity reference name can not contain character ' (position: TEXT seen ...<WKItemDescBaseLang>m&h ... @6:37)

XML:

<Header>
<ItemID>
<ID>SOFT-FAN-LTS-V3.00-AMADA</ID>
</ItemID>
<WKItemDescBaseLang>m&h MEASURING CYCLES "LASER TOOL MEASUREMENT"</WKItemDescBaseLang>
<BaseUOMCode>EA</BaseUOMCode>
<LotControlIndicator>1</LotControlIndicator>
</Header>

Apex:

Dom.Document doc = new Dom.Document();
doc.load( xml );

This error is due to & symbol in xml. But i'm uanble to fix this issue.
Thanks
Ravi
How can i get the installed packages in org using apex. I nedd to avoi package fileds.

Thanks,
Ravi
Hi,

How to Retrieve list of installed packages in apex or any API (tooling api)

Thanks,
Ravi

Gauge Chart Scale is not showing Correctly

I need like 1 2 3 4 .... (scale =1)

But it is showing like 0,2,3,5,6,8....

 

===== VF Page ===============

<apex:page  Controller="GaugeChartController">
<apex:chart name="MyChart" height="300" width="450" animate="true" data="{!data}">
<apex:axis type="Gauge" position="gauge" title="Points" minimum="0" maximum="{!total }"/>
<apex:gaugeSeries dataField="size" donut="50" colorSet="#78c953,#ddd"/>
</apex:chart>
<script>
MyChart.on('beforeconfig', function(config) {
config.axes[0].margin=-10;
});
</script>
</apex:page>

 

======= Controller ==============

public class GaugeChartController {
public integer total {get;set;}

public List<gaugeData> getData() {
total =15;
List<gaugeData> data = new List<gaugeData>();
data.add(new gaugeData(10 + ' Opptys', 5));
system.debug('test $$$$ '+data);
return data;
}

public class gaugeData {
public String name { get; set; }
public Integer size { get; set; }

public gaugeData(String name, Integer data) {
this.name = name;
this.size = data;
}
}
}

 

Please correct me any thing wrong here. 

http://screencast.com/t/iI11VSFyCj4

Hi All,

 

how to add vf page to Quote Template else Quote Template to vf page.

 

regards,

Nad

Hi all,

 

How to display blob value into VF Page.

 

public list<blob> strValue=new list<blob>();

PageReference PageRef1 = Page.test;

PageRef1.getParameters().put('id','001Q000000GJ839');

 

 PageRef1.setRedirect(true);
    Blob b1 = PageRef1.getContent(); 
 strValue.add(b1);

 

 PageRef1.setRedirect(true);  

 Blob b1 = PageRef1.getContent(); 

strValue.add(b1);

 

I got following error.

core.filemanager.ByteBlobValue@1c76af7, core.filemanager.ByteBlobValue@13f938e, core.filemanager.ByteBlobValue@f08289, core.filemanager.ByteBlobValue@a231e, core.filemanager.ByteBlobValue@18794f3, core.filemanager.ByteBlobValue@440d7d]

Hi All,

 

I am using inputfile ,inputtext 

i am submit the button inputtext previous values erased. how to stop this.

without input file this is working fine.but  i want input file also.

 

 

<apex:inputFile value="{!document.body}" filename="{!document.name}" id="file"/>

 

regards,

ravi.

Hi,

 

How to find validation rules on Sobject. through apex code.

 

Validation rule:

NOT(ISPICKVAL(PRIORVALUE(Industry),'Agriculture'))

 

regards,

Ravi.

Hi,

 

I want to abort the Ajax request cause by clicking a commandLink.

 

<apex:commandLink action="{!status}" oncomplete="window.close();" />

 

how to stop async javascript. if i clcik status my popoup window close if request true or false. how to stop this.

 

thaks,

Ravi.

 

Hi All,

 

 I create one button on Contact(example) it send to Dynamic SOQL vfpage, but i am creating this button on every object. how to send  object name dynamically through url or any other stuff.

in controller i am using dynamic SOQL.

Example:

window.location ='/apex/DynamicSOQL?type={!$SObject}';

 

Regards,

Ravi.

Hi All,

Break is not working. 

Apex:

Power=string.valueof(lstproduct2[i].test__c) + ' ' + 'KW' + '<br />' + string.valueof(lstproduct2[i].Rating__c) + ' ' + 'KVA' + '<br />' + string.valueof(lstproduct2[i].Hp__c) + ' ' + 'Hp';

VF:

  <apex:outputLabel value="{!Power}" />

Out put 

Out put coming like this but i want break line.

300 Kv<br />150 KA<br />2000 Hp

 

Html:

 

label>

 

1000 KW&lt;br&gt;&lt;/br&gt;500 KVA&lt;br&gt;&lt;/br&gt;2000 Hp</label>

label>1000 KW&lt;br&gt;&lt;/br&gt;500 KVA&lt;br&gt;&lt;/br&gt;2000 Hp</label>

 

 

HI All,

 

Location__c=http://www.developerforce.com/assets/developerforcesite/developerforce_home/images/developerforce_logo.png

 

 

<apex:repeat value="{!bigphoto}" var="big">
<tr>
<td>{!big.Location__c}"</td>
</tr>
</apex:repeat>

 

<apex:repeat value="{!bigphoto}" var="big">

 <tr> <td>{!big.Location__c}"</td> </tr>

 </apex:repeat>

 

pdf is not generating and throw error not valid  markup

 

 

 

 

HI All,

 

string res = 'I ' m a Apex Dev.';

 

how to replace single quote(') to \'.

this value send to visual force page javascript validations.

 

Regards

Ravi

 

Hi All,
Please answer the following questions if u know.
  • MS project intergration into SFDC.
  • VF drag and drop for creating dependancies on tasks.

HI All,

 

I am working on quotes object.  How to add Logo in pdf(Quote Template).

 

Thanks,

ravichandra. 

Hi All,

 

In my vf page 3 buttons when i click first button, hilight first button how to do this.

How to active first or change color dynamically?

 

 

 <td ><apex:commandButton id="First" value="1" action="{!setFirstMonth}"/></td>
                    <td ><apex:commandButton id="Third" value="3" action="{!setThirdMonth}"/></td>
                    <td ><apex:commandButton id="Sixth" value="6" action="{!setSixthMonth}"/></td> 

 

 <td ><apex:commandButton id="First" value="1" action="{!setFirst}"/></td>                    <td ><apex:commandButton id="Third" value="3" action="{!setThird}"/></td>                    <td ><apex:commandButton id="Sixth" value="6" action="{!setSixth}"/></td> 

 

Regards,

Ravi

Hi All,

 

Merge My Contacts (Duplicate Records) through Apex Code using ExternalId. This is urgent requirement.

 

Regards,

Ravi.

HI ALL,

I am beginner in sfdc.

 

In the following code i am updating contact records. but following error is coming. i am updating interested_tech__c.

 

Apex trigger CreateContactAccountInsert caused an unexpected exception, contact your administrator: CreateContactAccountInsert: System.LimitException: Too many future calls: 11

 

if(trigger.isupdate)

    {

           String s = 'test'; 

        Set<id> ownerIds = new Set<id>();

        for (Contact a :[Select Id,LastName from Contact where lastname like :(s+'%')])

           ownerIds.add(a.Id);   

 

      Contact[] owners = [Select Id,interested_tech__c from Contact Where Id in :ownerIds for update];  

 

       for (Contact Cnt: owners  ){

       Cnt.interested_tech__c='C';

       system.debug('TestMethod'+ Cnt.interested_tech__c);

       update Cnt;

       }

    }

 

How can i get the installed packages in org using apex. I nedd to avoi package fileds.

Thanks,
Ravi

I created a project in Force IDE using Prod credentials. Then I created an Apex Class(Class A) in IDE. The Apex Class compiles fine, but can't be copied onto the server, due to code coverage issues. So I then created another Apex Class(Class B) to test Class A. What's weird is that the IDE is trying to compile Class B on the server and not locally. This would obviously fail because Class A is not on the server yet.

 

Now I created a Sandbox for Development purpose. Here Class A and Class B compile fine, but can't be deployed onto the server, again because of the code coverage. In Class B(Test Class) I have created a object of Class A and called all the methods of it. Even then it complains Class A is 0% covered.

 

I think there is an issue with the way I have implemented the Test class.

 

Pls help.

 

Error: IncomeExt(ApexClass) -- 13 lines not tested, 0% covered.

 

Class A:

public class IncomeExt {
public Income__c q {get;set;}
public IncomeExt (ApexPages.StandardController c)
{
    controller = c;
    q = (Income__c) c.getRecord();
}

public void save()
{}

public String attachIncome()
{
    PageReference pdfPage = Page.AD672PDF;
     pdfPage.getParameters().put('id',q.id);
     Blob pdfBlob = pdfPage.getContent();
     Attachment a = new Attachment(parentId = q.id, name=q.id + '.pdf', body = pdfBlob);
    insert a;
    return('test');
}
      
      
private ApexPages.StandardController controller;      
   
}

 

 

Class B: (tester class)

@IsTest private with sharing class IncomeExtTest {
static testMethod void myPage_Test()
{
//PageReference pageRef = Page.AD672;
//Test.setCurrentPageReference(pageRef);
ApexPages.StandardController con = new ApexPages.StandardController(new Income__c());
// create an instance of the controller
//test.startTest();
IncomeExt temp1 = new IncomeExt(con);
temp1.attachIncome();
temp1.save();
//test.stopTest();
}
}



Hi All,

 

 

On the Proposal__c object page i have two lookup fields.. one for Resource_Requirement__c object and another for  RR__c object. while creating the new proposal as i'll select the value for Resource_Requirement__c object.. using the lookup field..i should be able to view all the RR__c records related to selected value of Resource_Requirement__c on the visualforce page.... 

 

 

public class AllRRs
{
    private Resource_Requirement__c rrdetail;
    public List<RR__c> propdetail;
       
    public AllRRs(ApexPages.StandardController controller)
    {
        rrdetail=(Resource_Requirement__c)controller.getre​cord();
        propdetail = new List<RR__c>();
        RR__c rrlist = new RR__c();
        rrlist.RRF__c = rrdetail.id;
        propdetail.add(rrlist);                        
    }
   
    public RR__c[] getCaseRecords()
    {
        RR__c[] rrdetail = [select id,name,gPAC__c,RRF__c,Long_Term_Resource_Location​__c,Priority__c,Required_Skill__c,RR_Status__c,RM_​Phase__c from RR__c where RRF__c =:rrdetail.id];
        return rrdetail;
    }
}

Hi Team,

 

I created one web to lead form and the problem is that after saving data in web form it is successfully saved but it is not saving data in lead object.i dont know where it is saving.

 

Please let me know what is the problem in this and tel me the solution for this.Is there any option is there to check what are all the web to lead form i created?

 

Thanks in advance.

  • July 14, 2011
  • Like
  • 0

I'm attempting to use CSS to make text bold within a PDF that is generated off of a custom object, below is a snippet of my css and the portion of the PDF code where that style is called, i've also tried just surrounding the text in

 

 

<b></b>

 

 

Below is the snippet:

 

 

  p {
    font-size:10pt;
    font-family:Arial Unicode MS;
    font-weight:bold;
  }

....

<p>
<b>First Heading</b>
</p>

 

 

Is there any way I can access the fields on a standard page with javascript using the $Component function or something similar without needing to hard-code the element ID?

 

I'm using the standard asset page.  I have a button that calls a webservice to update a couple fields on the page.  I would like to write some additional javascript to update the appropriate fields on the page without needing to initiate a page refresh.  I know I can probably accomplish this by hard-coding the element ID's based on what I see in the generated page source, but I know that's not a good practice.  All the javascript component documentation I've found assumes you are doing a visualforce page, but I really need to figure this out from within the standard page, where I have no control over what ID's are assigned to components.

Hello.

I've picked an interesting code on internet and used it. It's works well, but when I've modified it like at the code above, i've got an Error Code from Eclipse : "LOOP MUST ITERATE OVER A COLLECTION TYPE: SOBJECT : Opportunity"

 

I tryed the sollution provided here :

http://boards.developerforce.com/t5/Apex-Code-Development/quot-Loop-must-iterate-over-a-collection-type-quot-Error/td-p/178457

 

But it doesn't work. I'm locked In these situation for many hours now. Thanks for your support.

 

 

            public class opportunityTotal {
            	public Opportunity opporto { get; private set; }
         public Opportunity total { get; private set; }
         public Opportunity totalsextant { get; private set; }
        
        public opportunityTotal(Opportunity o) {
        			opporto = o;
                    total = new Opportunity(Amount__c = 0);
                    totalsextant = new Opportunity(Commission_to_Sextant__c = 0);
                    for(Opportunity b:o) {
                        
                            if(b.Amount__c != null){
                            if(b.Classer_le_dossier_dans_les_historiques__c != false){
                            
                                  totalsextant.Commission_to_Sextant__c += b.Commission_to_Sextant__c;
                             }
                 }
            }
        }
    } 
    
    
    
    
    
    
     public List<OpportunityTotal> getnouvellevueparemploye() {
        List<OpportunityTotal> nouvellevueparemploye = new List<OpportunityTotal>();
        for(Opportunity o:[select name,Amount,Amount__c, OwnerId, Owner.FirstName, Owner.LastName, Classer_le_dossier_dans_les_historiques__c, LeadSource, Commission_to_Sextant__c from Opportunity 
                
                where CreatedDate < TODAY])  
                 {

            nouvellevueparemploye.add(new OpportunityTotal(o));
        }
        

        return sortOpportunityTotals(nouvellevueparemploye);
    }
    
    
    
    
     private List<OpportunityTotal> sortOpportunityTotals(List<OpportunityTotal> totals) {
        List<OpportunityTotal> returnList = new List<OpportunityTotal>();
        
    
        Map<Decimal, List<OpportunityTotal>> totalMap = new Map<Decimal, List<OpportunityTotal>>();
        
        for(OpportunityTotal t:totals) {
            if(totalMap.get(t.total.amount) == null) {
                totalMap.put(t.total.amount, new List<OpportunityTotal>());            
            }
            totalMap.get(t.total.amount).add(t);
        }

        List<Decimal> keys = new List<Decimal>(totalMap.keySet());
        keys.sort();

        /* Sort puts things in ascending order so for descending iterate over
           the keys backwards. */
        for(Integer i = (keys.size()-1);i >= 0; i--) {
            returnList.addAll(totalMap.get(keys.get(i)));
        }

        return returnList;
    }

 

 

Hi,

I need to download enterprise wsdl for my production.

The procedure which i am following is :

1) Go to Setup -> Develop -> API

2) Right click on "Generate Enterprise wsdl" and choose "save target as".

 

Saved file is called "generateEnterpriseWsdl.apexp". It doesnt have .wsdl ext.

 

Is this the right procedure?

 

Plz help.

Hi,

 

I want to abort the Ajax request cause by clicking a commandLink.

 

<apex:commandLink action="{!status}" oncomplete="window.close();" />

 

how to stop async javascript. if i clcik status my popoup window close if request true or false. how to stop this.

 

thaks,

Ravi.

 

Hi All,

 

 I create one button on Contact(example) it send to Dynamic SOQL vfpage, but i am creating this button on every object. how to send  object name dynamically through url or any other stuff.

in controller i am using dynamic SOQL.

Example:

window.location ='/apex/DynamicSOQL?type={!$SObject}';

 

Regards,

Ravi.

I recently had a problem/bug with PDF rendering for small caps. I figured I could simulate small caps by applying two different font sizes to the text line but to my surprise, when I tried it, I encountered another PDF rendering bug.

 

In this situation, the style sheet had some selectors with a comment on the same line as the selector. This was fine when displaying the VF page normally, but, when rendering in PDF, the selectors were not applied. When the comments were moved to their own lines, the PDF render then worked fine!

 

The involved page and style sheet are lengthy and fairly complex so I will post them only if somebody is actually interested in seeing them.

 

In summation, the rule is obvious. If you are rendering in PDF,  comments must be placed on their own lines in the style sheet. I would even be cautious about placing comments inside the style declaration (i.e. between the curly braces)!

HI All,

 

I am working on quotes object.  How to add Logo in pdf(Quote Template).

 

Thanks,

ravichandra. 

HI ALL,

I am beginner in sfdc.

 

In the following code i am updating contact records. but following error is coming. i am updating interested_tech__c.

 

Apex trigger CreateContactAccountInsert caused an unexpected exception, contact your administrator: CreateContactAccountInsert: System.LimitException: Too many future calls: 11

 

if(trigger.isupdate)

    {

           String s = 'test'; 

        Set<id> ownerIds = new Set<id>();

        for (Contact a :[Select Id,LastName from Contact where lastname like :(s+'%')])

           ownerIds.add(a.Id);   

 

      Contact[] owners = [Select Id,interested_tech__c from Contact Where Id in :ownerIds for update];  

 

       for (Contact Cnt: owners  ){

       Cnt.interested_tech__c='C';

       system.debug('TestMethod'+ Cnt.interested_tech__c);

       update Cnt;

       }

    }