• Alpesh Patel 16
  • 0 Points
  • Member since 2014

  • Chatter
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 5
  • 2
I have a apex class and trigger. I want to display Sobject's field name,Inline help Text and Description in visualforce page.

For example,
Sobject is "XYZ__c"
Fields are "Name__c" and "Address__c"

Then my visualforce page should display 

Name           Description                 Inlinehelptext
Name__c      This is the Name.          In this field user have to enter its name.
Address__c  This is the Address.       In this field user enters his address

I can get Name and Inlinehelptext using "Sobject__c.fieldapiname__c.getdescribe().getinlinehelptext()" but how to get description?. 

Help Me,

I am trying to deploy my class and test case from stage to production. When I validate changeset on production, It throws following exception:
System.UnexpectedException: No more than one executeBatch can be called from within a testmethod. Please make sure the iterable returned from your start method matches the batch size, resulting in one executeBatch invocation.
Stack Trace: External entry point

Following is the code of my test case:

@isTest (SeeAllData=true)
public with sharing class SendWelcomeLetterCM_Test {
        List<Contract_User__c> contractUsers = new List<Contract_User__c>();
        List<Contract_Members__c> contractMembers = new List<Contract_Members__c>();
        //Create Account        
        Account testAccount = UnitTest.getAccount();
        insert testAccount;
        //Create Contacts
        Contact testContact= UnitTest.getContact(testAccount.Id);
        testContact.MailingCountry = 'CANADA';
        insert testContact;
        //Create Contacts
        Contact testContact1= UnitTest.getContact(testAccount.Id);
        testContact1.MailingCountry = 'CANADA';
        insert testContact1;
        //Create Contacts
        Contact testContact2= UnitTest.getContact(testAccount.Id);
        testContact2.MailingCountry = 'CANADA';
        insert testContact2;
        //create Learning
        Product2 testProductLRNABM = UnitTest.getProductLearning();
        testProductLRNABM.productcode = 'LRN-ABM';
        insert testProductLRNABM;  
        Product2 testProductTA3ABM = UnitTest.getProductAdvisoryTA3();
        testProductTA3ABM.productcode = 'TA3-ABM';
        insert testProductTA3ABM;
        //create team member
        Product2 testProductTA3DCS = UnitTest.getProductAdvisoryTA3();    
        testProductTA3DCS.Name = 'TA3-DCS';
        testProductTA3DCS.ProductCode = 'TA3-DCS';
        testProductTA3DCS.IsActive = true;
        insert testProductTA3DCS;
        //create team member
        Product2 testProductTA3CSS = UnitTest.getProductAdvisoryTA3();    
        testProductTA3CSS.Name = 'TA3-CSS';
        testProductTA3CSS.ProductCode = 'TA3-CSS';
        testProductTA3CSS.IsActive = true;
        insert testProductTA3CSS;
         // Create Contract
        Contract testContract = UnitTest.getContract(testAccount.Id);
        insert testContract;
         // create new Learning
        Contract_User__c testContractUserABM = UnitTest.getContractUser(testContract.Id, testContact.Id, testProductTA3ABM.Id);
        testContractUserABM.status__c = 'Active';
        insert testContractUserABM;
        //ContractUserRollup_New.rollupContractUsers(new List<Contract_User__c>{testContractUser}, null);
        Contract_User__c testContractUserDCS = UnitTest.getContractUser(testContract.Id, testContact1.Id, testProductTA3DCS.Id);
        testContractUserDCS.status__c = 'Active';
        insert testContractUserDCS;
        Contract_User__c testContractUserLRN = UnitTest.getContractUser(testContract.Id, testContact1.Id, testProductLRNABM.Id);
        testContractUserLRN.status__c = 'Active';
        insert testContractUserLRN;
        //ContractUserRollup_New.rollupContractUsers(new List<Contract_User__c>{ testContractUser1}, null);
        // create contract member
        Contract_Members__c testcontactmember = new Contract_Members__c();
        testcontactmember.Account__c = testAccount.Id;
        testcontactmember.Contact__c = testContact1.Id;
        testcontactmember.Contract__c = testContractUserABM.Contract__c;
        testcontactmember.Contract_User__c = testContractUserABM.Id;
        testcontactmember.Productlookup__c = testProductTA3ABM.id;
        testcontactmember.Status__c = 'Active';
        testcontactmember.Start_Date__c =system.today();
        testcontactmember.End_Date__c  = system.now().addDays(30).Date();
        insert testcontactmember;
         // create contract member
        Contract_Members__c testcontactmember1 = new Contract_Members__c();
        testcontactmember1.Account__c = testAccount.Id;
        testcontactmember1.Contact__c = testContact1.Id;
        testcontactmember1.Contract__c = testContractUserABM.Contract__c;
        testcontactmember1.Contract_User__c = testContractUserABM.Id;
        testcontactmember1.Productlookup__c = testProductTA3CSS.id;
        testcontactmember1.Status__c = 'Active';
        testcontactmember1.Start_Date__c =system.today();
        testcontactmember1.End_Date__c  = system.now().addDays(30).Date();
        insert testcontactmember1;

       //ContractMemberRollup_New.rollupContractMembers(new List<Contract_Members__c>{ testcontactmember}, null);    

I have created one custom object. I have added list of this object in tab menu. I need to add two buttons in listing page so I have created visual force page. I am trying to configure this page in list page but I am not getting my page in listing.
User-added image

User-added image

I did following code in visualforce page.

<apex:page Standardcontroller="Contract_History__c" extensions="ContractHistoryListController">
    <apex:form >
        <apex:pageblock >
          <center><apex:outputText rendered="{!(ContractHistoryList.size = 0)}" style="font-weight: bold;" value="There are no records available in a contract history." /></center>          
        <apex:pageblockTable value="{!ContractHistoryList}" var="c" id="CHTable" rendered="{!(ContractHistoryList.size != 0)}">    
           <apex:column headerValue="Name">
                   <apex:outputlink value="https://cs1.salesforce.com/{!c.id}" >{!c.Name}</apex:outputlink>
       <!-- <apex:column value="{!c.Name}"/>-->
        <apex:column value="{!c.Account_Name__c}"/>
        <apex:column value="{!c.Contract_User_Name__c}"/>
        <apex:column value="{!c.Contract_Name__c}"/>
        <apex:column value="{!c.Contact_Name__c}"/>
        <apex:column value="{!c.Type__c}"/>
        <apex:column value="{!c.Status__c}"/>
            <apex:pageBlockButtons location="top">
                <apex:commandButton value="Migrate Contract Users" id="btnContractUsers" action="{!AddContractUsersToContractHistory}" oncomplete="window.opener.location.refresh();" />                              
                <apex:commandButton value="Migrate Contract Members" id="btnContractMembers" action="{!AddContractMembersToContractHistory}" oncomplete="window.opener.location.refresh();" />                          



Please help me.


I have encountered a bizzare error. I have made a custom object A and on the standard view of this custom object A, I have placed a custom buttom B. Based on some condition I want to show/hide this custom button B. For this I have added a custom visualforce section inside the standard layout. I have written logic to access this custom button B and show/hide it. But when the page gets loaded, it gives me an error
"SecurityError: Blocked a frame with origin "https://c.ap1.visual.force.com" from accessing a frame with origin "https://ap1.salesforce.com". Protocols, domains, and ports must match." in Chrome and "Permission denied to access property 'document'" in Firefox.
As per my understanding, the Visual force page uses different domain (https://c.ap1.visual.force.com) then the parent standard page(https://ap1.salesforce.com).

Can someone help me solve this ?

Hi Everyone,

I have a custom object A and related custom object B. I have put a button on related object B. When I press this button, I show a visualforce page that contains a grid of table data with checkboxes and a process button. Upon clicking this process button, I do some processing which requires data from the Parent Object A.
How can i pass data or reference of object A in the custom VF page of Object B and use it in cotroller class of object B.


Using the new "My Domain "  feature in spring 10 can we solve the javascript cross domain issues? 


As per the documentation 

Personalize your salesforce.com URL  - Get a personalized, easy-to-remember saleforce.com URL Provide additional security to your organization.


Q: Will the apex code also run on the same domain (which otherwise runs in the force.com domain) there by solving the cross domain javascript issues faced now within an iframe.






I want to pass data from visual force page to parent page. I am opening VF into popup window.
When I am trying to put data in parent page using javascript window.opener statement, I am getting following error.

Permission denied for <https://c.cs1.visual.force.com> to get property Window.document from <https://cs1.salesforce.com>

Please help!

Message Edited by Naishadh on 08-24-2009 01:21 AM
Message Edited by Naishadh on 08-24-2009 01:22 AM
Message Edited by Naishadh on 08-24-2009 01:23 AM