• Surya Teja 44
  • NEWBIE
  • 0 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 2
    Replies
Hi Friends, 

So i have a requirment where i need to display all the component (objects, classes, pages, pagelayouts, workflows etc..) names, which exist in my org on a VF page.

Now this is pretty simple it was just an Page or an apex class where i can simply query the object and display the items on the VF page. The problem lies with getting info about workflows, email alerts, page layout etc. My question is how can i query the names of all these components from Apex it self? I know we can use Metadata API and all, but has anyone implemented this concept before or has a code snippet that i can look into? 

I know there are webservises involved. So could you guys please help me out here. Thanks. 
Hello,

There are three objects that are at play here:
Opportunities, Projects (a custom object I created), and Box files.
Opportuinities and Project have lookup relationships
Opportunities are tied to a specific Box folder.

I am trying to create a Page that shows the information from a newly created Project (Name, Date, Status, Related Opportunity) AND the Box folder from the Related Opportunity.

Is this possible?

Nicole
Hi,
   I want to perform a simple calculation on my Vf page. I have an integer  countCompleted and a decimal auditsToBeMade variable on the controller side.
public Integer getcountCompleted(){
        Integer countCompleted = [select COUNT() from Financial_Audit_Plan__c where YTD_Completed_Audits__c = 1 AND ((DM1__c = :userInfo.getUserID())
                                       OR (DM2__c = :userInfo.getUserID()) OR (DM3__c = :userInfo.getUserID()) OR (DM4__c = :userInfo.getUserID())) AND Calendar_year(Planification_Date__c) = :System.today().year()];
        System.debug('Total is '+countCompleted);
        return countCompleted;
    }
public Decimal getauditsToBeMade(){
        if(financial1!=null && total_size!=0)                                                                                
        auditsToBeMade = financial1[0].Total_Planned_Audits__c;
        return auditsToBeMade;
    }
I just want to dispaly something like this. ({!countCompleted}/{!auditsToBeMade})*100%  on the page.  I tried by creating a new variable on the controller and performing calculation there and then displaying that variable on the page.: 
public Decimal getpercentAudit(){
        if(auditsToBeMade!=0){
            Decimal percentAudit = (getcountCompleted()/getauditsToBeMade())*100;
            System.debug('Percent is '+percentAudit);
            return percentAudit.setScale(2, RoundingMode.HALF_UP);
        }else{
            return null;
        }
        
    }
But I get an exception whenever getauditsToBeMade() method doent return any value, how can i prevent this error? Please advice.
Thank you