• Vi$h
  • NEWBIE
  • 75 Points
  • Member since 2014

  • Chatter
    Feed
  • 2
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 41
    Replies
hi i have requirement where i have to built visual force page.. my data will be stored in db like followingUser-added image



i want to show my visual force like following

User-added image



i have written some sample code  to dispaly header..
 
public list<String> getagrmnts(){
        m.put('Name','');
        m.put('Driver__c','');
        period.add('Agreement no');
        period.add('Driver');
        headerKeys.add('name');
        headerKeys.add('driver__c');
        list<String> tempStr = new list<String>{};
        for(Agreement1__c a : al){
            flag = 1;
            tempStr.add(a.name);
            tempStr.add(a.driver__c);
            //if(period.indexOf(a.period__c)==-1)
            for(String p: period ){
                if(p == a.period__c){
                    flag = 0;
                }
            }
            if(flag == 1){
                m.put(a.period__c,'');
                headerKeys.add(a.period__c);
                period.add(a.period__c);
            }    
        }
        return period;    
    }

and page code to display header is
<apex:page controller="header">
<apex:pageBlock >
<table>
<tr>
<apex:repeat value="{!agrmnts}" var="c">
<td>
<apex:outputText value="{!c}"></apex:outputText>
</td>
</apex:repeat>
</table>
</apex:page>

please tell me how can i fill data to that table i want to mshow like above
Hi, has anyone faced similar issue like mine before? What happened is that a few days ago I tried to deploy something new from sandbox... and it failed because a few classes in the production failed its test....but the things I have had these classes in production for at least 2 years...and I even succesfully deployed something on the 20th of april 2015....and now those classes failed all of a sudden...the weird thing is I have the same classes in sandbox (obviously) and they pass the tests fine....so I yeah I am just baffaled as to why would something like this happen...why is it happening...
Please help me out, I can not identify which line will be executing throgh my test class,
It says 139 / 509 covered , But after double click the text execution it was navigating to the respective apex class. I can not see any blue/red line over there. Need any set up to get  that indicator.

Thanks in Advance!
 
i have a requirement to notify few folks on completion of the apex jobs. any suggestions around this

thanks in advance for your help

Hello,

I am trying to figure out if I need a trigger to update a field on the Account object when a field on the Contract object changes. 

For example, 

When Contract field, Status = "Activated", change Account field, Type to "Customer"

There is a relationship beteen the account and contract objects.

Thanks!


Shannon

Hi, I am new to salesforce and i have some question how do we acheive this in salesforce.

Let's say you are on Account detail page its Account name is xyz and i want to add Contact in its related list then i click new from Account detail page it redirects me to Contact detail page now when i add and save it, it redirect me to Contact detail page. But i want when i save Contact it should be added in the Account detail page and the Account detail page should come not Contact detail page.

Please help me how do i acheive this. please follow this link what i would like to say: http://quickst.ps/sf
There is a requirement to search fields in a look up.For this enhanced lookups need to be enabled, I have done this.There are some limitations with salesforce search. Relationship fields cannot be searched. One of our formula field gets value from other object and its not searchable, I want to be able to search on this field. I created a text field and used a workflow to populate it with the value from the master object.
Any change in the master object would not trigger the workflows. Other than writing a trigger on the master object is there any other option ?
I want to know whether we can publish Knowledge articles on site.com
I know that we can do it with force.com sites.
If we can do it on site.com, How do we do it ?
Any help is appreciated.
Thanks
Hi,

I am having a trigger on a custom object which creates a new lead record maps  the values of certian fields from custom to standard object,

In my custom object i have a field called as "Status" which is set to "qualified" and changes to "Unqualified" based on workflow written backend


Now my trigger is (after insert and after update) , when the lead status is qualified it creates only 1 lead record since there is no workflow or update 

but if the lead status is unqualified it creates 2 lead records , since there is an update at the backend,

How do i handle it in my trigger

This is my trigger


Trigger Leadprocess on Lead_Object__c(after insert , after update)
{
     List<Lead> sub=new List<Lead>();
     for(Lead_Object__c v : Trigger.new)
     {
         
                   Lead  s = new Lead();
                  // s.RecordType.name =v.Record_Type__c;
                   s.FirstName=v.First_Name__c; 
                   s.LastName =v.Last_Name__c;
                   s.Account_Type__c = v.Account_Type__c;
                   s.Units_In_Inventory__c = v.Units_In_Inventory__c;
                   s.Company = v.company__c;
                   s.PostalCode = v.Billing_Zip__c; 
                   s.AnnualRevenue =v.Annual__c;
                   s.Salutation  = v.Salutation__c;
                   s.LeadSource =v.Record_Type__c;
                   s.Status =v.Leadstatus__c;
                   s.Additional_Information__c =('The entered value of ZID is'+(v.ZID__c));  
                   sub.add(s);
           
           
            insert sub;
     }
}


Thanks in Advance
I am writing a wrapper class to to show atmost 100 elements of list using offset:

class Pg{
    public Integer displayLimit{get;set;}
    public Integer displayOffset{get;set;}
    public Boolean disableNext{get;set;}
    public Boolean disablePrev{get;set;}
    List collection;
   
    public Pg(){}
    public Pg(List collection){
        this.collection=collection;
        this.displayOffset=0;
        this.displayLimit=100;
        this.disablePrev=true;
        if (this.collection.size()>displayLimit) {
            this.disableNext=false;
        } else {
            this.disableNext=true;
        }
    }
   
    public void next(){
        this.displayOffset=this.displayOffset+displayLimit;
        if (this.collection.size()<displayOffset+displayLimit) {
            this.disableNext=true;
        }
        this.disablePrev=false;
    }

    public void prev(){
        this.displayOffset=this.displayOffset-displayLimit;
        if (this.displayOffset==0) {
            this.disablePrev=true;
        }
        this.disableNext=false;
    }
   
}

But here it is not allowing me to give List collection;
It needs something like List<Object> collection. Expecting Angle bracket after List.

But I want that I should able to pass List of any collection in constructor.

How to achieve this?
The code coverage of my Production instance dropped below 75% which has disabled the ability to move anything from Sandbox to production.
A developer - now no longer with company - helped improve in sandbox the test classes that needed to be fixed
I'd like to deploy the test classes to production, but when I try to do it via a change set I get the dreaded low coverage error (specifically "Average test coverage across all Apex Classes and Triggers is 68%, at least 75% test coverage is required")

It seems like a catch 22 -- I can't deploy the fix for the code coverage, since I don't have code coverage. :-( Any ideas?