• sushmaiyer2@gmail.com
  • NEWBIE
  • 74 Points
  • Member since 2013

  • Chatter
    Feed
  • 3
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 23
    Questions
  • 15
    Replies

 

 

Hi All,

 

I am Not able to select a value from custom lookup window after clicking "insert selected" Button.

 

My VF Page :-

 

<apex:page controller="CustomLookupWindowController" showHeader="false" sidebar="false">
    
    <STYLE type="text/css">
        .pageTitleIcon {
            background-image: url("/img/sprites/master.png");
            background-position: 0 -1202px;
            height: 32px;
            width: 32px;
        }
        
        body {
            font-family: Arial,Helvetica,sans-serif;
            background: url("/img/alohaSkin/lookup_bg.png") repeat-x scroll 0 0 #FFFFFF;
            margin: 0 10px;         
        }
        
        .bPageTitle h1 {
            color: #333435;
            font-size: 1.8em;
            margin: 8px 0 4px;
        }
        
        .bPageTitle h1, .bPageTitle h2 {
            display: block;
        }
        
        .ValueLabel {
            color: #4A4A56;
            font-size: 0.9em;
            margin: 0 5px 0 0;
        }       
                
    </STYLE>

    <script type="text/javascript">
        function setValueOnParentWindowAndClose(ValueToSet) {
            // update the input on the caller
            window.opener.document.getElementById('{!InputDOMName}').value = ValueToSet;
            // fire the on change event in our input so the caller knows it was updated
            window.opener.document.getElementById('{!InputDOMName}').onchange();
            self.close();
        }       
    </script>

    <body onBlur='javascript&colon;window.close();'>      
        <div class="bPageTitle">
            <img class="pageTitleIcon" title="" alt="" src="/s.gif" />
            <h1>Lookup</h1>
        </div>
        
        <apex:outputPanel id="TextSearchResultsOP" rendered="{!RenderTextSearch}" >
            <apex:form >
                                
                <div class="pbBody">
                    <strong>Search</strong>&nbsp;&nbsp;
                    <apex:inputText value="{!TextSearchInput}" id="TextSearchInput" />
                    &nbsp;&nbsp;
                    <apex:CommandButton value="Go!" action="{!TextSearch}" />
                
                    <br/>
                    
                </div>
                
                <p style="padding-left: 30px;">
                    <h2>You can use "*" as a wildcard next to other characters to improve your search results.</h2>
                </p>
                
                <br/><br/><br/>
                                
                <apex:PageBlock id="TextSearchResultsPB" >              
                    
                    <apex:pageBlockTable value="{!TextOptionsList}" var="T" >
                            <apex:column value="{!T}" onclick="setValueOnParentWindowAndClose('{!JSENCODE(T)}');">              
                                <apex:facet name="header">Name</apex:facet>                                 
                            </apex:column>                  
                    </apex:pageBlockTable>
                    
                </apex:PageBlock>
                
            </apex:form>        
        </apex:outputPanel>
                
        <apex:outputPanel id="ListSearchResultsOP" rendered="{!RenderListSearch}">
        
            <div class="pbBody">
                <h2>Select the picklist values to add below.</h2>
            </div>

            <apex:form >    
                            
                <apex:outputPanel id="ListSearchResultsOP" >
                    
                    <center><apex:CommandButton value="Insert Selected" action="{!BuildSelectedString}" oncomplete="setValueOnParentWindowAndClose('{!JSENCODE(SelectedString)}');" /></center>
                    
                    <apex:PageBlock id="ListSearchResultsPB" >              
                    
                        <apex:pageBlockTable value="{!ListModeOptionsList}" var="L">
    
                            <apex:column style="width: 1%;">                
                                <apex:facet name="header">
                                    <apex:inputCheckbox value="{!SelectAllList}">
                                        <apex:actionSupport event="onclick" action="{!SetCurrentSelectedListWrapperSelected}" rerender="ListSearchResultsPB" immediate="true"/>
                                    </apex:inputCheckbox>
                                </apex:facet>   
                                <apex:inputCheckbox value="{!L.Selected}"/>
                            </apex:column>
    
                            <apex:column styleclass="ValueLabel">
                                <apex:facet name="header">Value</apex:facet>
                                {!L.Value}
                            </apex:column>
    
                        </apex:pageBlockTable>
                        
                    </apex:PageBlock>                                       

                    <center><apex:CommandButton value="Insert Selected" action="{!BuildSelectedString}" oncomplete="setValueOnParentWindowAndClose('{!JSENCODE(SelectedString)}');" /></center>
                                                        
                </apex:outputPanel>
                                                            
            </apex:form>        
        </apex:outputPanel>
    </body>
</apex:page>

 

 

My Controller :-

 

public with sharing class CustomLookupWindowController {
    
    public boolean RenderListSearch {get; set;}
    public boolean RenderTextSearch {get; set;}
    public boolean SelectAllList {get; set;}
    
    public List<SelectedListWrapper> ListModeOptionsList  {
        get {
            if (ListModeOptionsList == null) ListModeOptionsList = new List<SelectedListWrapper>();
            return ListModeOptionsList;
        }
        set;
    }
        
    public string TextSearchInput {get; set;}
    
    public List<String> TextOptionsList  {
        get {
            if (TextOptionsList == null) TextOptionsList = new List<String>();
            return TextOptionsList;
        }
        set;
    }
        
    public string SelectedString {get; set;}
        
    public CustomLookupWindowController() {
        
        RenderListSearch = false;
        RenderTextSearch = false;
        SelectAllList = false;
        TextSearchInput = '';
                
        string CurrentObjectName = getObjectName();
        string CurrentFieldName = getFieldName();
        string CurrentFormInputDOMName = getFormDOMName();
        
        if (CurrentObjectName != null) {                        
            
            Type CurrentType = Type.forName(CurrentObjectName);
                        
            object CurrentObject = CurrentType.newInstance();
            
            if (CurrentObject != null) {
                
                Map<String, Schema.SObjectType> gd = Schema.getGlobalDescribe();
                
                Schema.SObjectType CurrentSObjectType = gd.get(CurrentObjectName);
                
                if (CurrentSObjectType != null) {
                    
                    Map<String, Schema.SObjectField> FieldsMap = CurrentSObjectType.getDescribe().fields.getMap();
                                        
                    Schema.SObjectField CurrentField = FieldsMap.get(CurrentFieldName);
                                        
                    Schema.DisplayType CurrentFieldType = CurrentField.getDescribe().getType();
                    
                    
                    if (CurrentFieldType == Schema.Displaytype.PickList || CurrentFieldType == Schema.Displaytype.MultiPickList) {
                      
                        PopulateListModeOptionsList(CurrentField);
                        RenderListSearch = true;
                    } else {
                        
                        RenderTextSearch = true;
                    }
                
                }
                
            }
            
        }
        
    }
    
        public void TextSearch() {
        string ObjectName = string.escapeSingleQuotes(getObjectName());
        
        string SOQLQueryString = 'SELECT ID, NAME FROM ' + ObjectName + ' WHERE NAME LIKE \'%' + TextSearchInput + '%\'';
        
        List<sObject> SearchResults = Database.query(SOQLQueryString);
        
        TextOptionsList.clear();
        
        for (sObject R: SearchResults) {
            TextOptionsList.add(string.valueof(R.get('Name')));
        }
                
    }
    
    private void PopulateListModeOptionsList(Schema.SObjectField CurrentField) {
        
        List <Schema.PicklistEntry> CurrentListValues = CurrentField.getDescribe().getPicklistValues();
        List <String> OptionsList = new List<String>();
        
        for (Schema.PicklistEntry P : CurrentListValues) {
            OptionsList.add(P.getValue());
        }

        OptionsList.sort();

        ListModeOptionsList.clear();
        
        for (String V: OptionsList) {
            SelectedListWrapper CurrentSelectedListWrapper = new SelectedListWrapper();
            CurrentSelectedListWrapper.Value = V;
            CurrentSelectedListWrapper.Selected = false;
            ListModeOptionsList.add(CurrentSelectedListWrapper);
        }
        
    }
        
    public void SetCurrentSelectedListWrapperSelected() {
        
        SelectAllList = !SelectAllList;
        
        for (SelectedListWrapper S: ListModeOptionsList) {
            S.Selected = SelectAllList;
        }    
    }
    
    public void BuildSelectedString() {
        
        SelectedString = '';
                
        for (SelectedListWrapper S: ListModeOptionsList) {
            if (S.Selected == true) {               
                if(S.Value.containsAny(',') == true) {
                    
                    SelectedString += '\"' + S.Value + '\"' + ', ';     
                } else {
                    
                    SelectedString += S.value + ', ';
                }
            }
        }
        
        if (SelectedString.endsWith(',')) SelectedString = SelectedString.removeEnd(',');
            
    }
    
    public string getFormDOMName() {
        return System.currentPageReference().getParameters().get('form');
    }
    
    public string getInputDOMName() {
        return System.currentPageReference().getParameters().get('input');
    }
    
    public string getObjectName() {
        return System.currentPageReference().getParameters().get('object');
    }
    
    public string getFieldName() {
        return System.currentPageReference().getParameters().get('field');
    }
    
    private class SelectedListWrapper  {
    
    public boolean Selected {get; set;}
    
    public string Value {get; set;}
    }
      
 
}

 

 

 

 

 

 

Hi All,

 

Compile Error: Incompatible types since an instance of LIST<SObject> is never an instance of LIST<objectList.PieWedgeData>

Our Code is :-
public List<PieWedgeData> getPieData() {
       data = (List<PieWedgeData>)mynewinst;    // mynewinst is a list of SObject type
       data.addall(mynewinst);
       
       return data;
   }
// Wrapper class
   public class PieWedgeData {

       public String name { get; set; }
       public Integer data { get; set; }

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

According to debug log "mynewinstance" contents :-

03:01:02.344 (344669000)|USER_DEBUG|[86]|DEBUG|$$$$$$$$$$$$$$$$$$mynewinst$$$$$$$$$$$$$$$$$$(Room__c:{White_Board__c=true, OwnerId=005900000017R4DAAU, LastModifiedDate=2012-11-26 09:10:34, Block__c=1, Phone_No__c=1234567890, Flip_Chart__c=true, No_of_Machines__c=2, SystemModstamp=2012-11-26 09:10:34, Email_Id__c=mayur.nagaonkar@lntinfotech.com, Location__c=Vashi, LastReferencedDate=2012-11-26 09:10:35, LastModifiedById=005900000017R4DAAU, Seating_Capacity__c=10, Screen__c=true, Name=R-00003, City__c=Mumbai, LastViewedDate=2012-11-26 09:10:35, Address__c=Shil Road,Mahape, Remarks__c=None, CreatedById=005900000017R4DAAU, CreatedDate=2012-11-26 09:10:34, Projector__c=true, IsDeleted=false, Id=a0K900000039mYcEAI, Type__c=Discussion Room, Co_ordinator_Name__c=xyz}, Room__c:{White_Board__c=true, OwnerId=005900000017R4DAAU, LastModifiedDate=2012-11-22 07:19:48, Block__c=1, Phone_No__c=1234567890, Flip_Chart__c=true, No_of_Machines__c=100, SystemModstamp=2012-11-22 07:19:48, Email_Id__c=mayur.nagaonkar@lntinfotech.com, Location__c=Vashi, LastReferencedDate=2012-11-26 11:44:10, LastModifiedById=005900000017R4DAAU, Seating_Capacity__c=100, Screen__c=true, Name=R-00001, City__c=Mumbai, LastViewedDate=2012-11-26 11:44:10, Address__c=Shil Road,Mahape, Remarks__c=None, CreatedById=005900000017R4DAAU, CreatedDate=2012-11-22 07:19:48, Projector__c=true, IsDeleted=false, Id=a0K900000039VaCEAU, Type__c=Technical Training Room, Co_ordinator_Name__c=xyz}, Room__c:{White_Board__c=true, OwnerId=005900000017R4DAAU, LastModifiedDate=2012-11-22 07:26:52, Block__c=1, Phone_No__c=1234569870, Flip_Chart__c=false, No_of_Machines__c=0, SystemModstamp=2012-11-22 07:26:52, Email_Id__c=gaurav.raj@lntinfotech.com, Location__c=Shivaji Nagar, LastReferencedDate=2012-11-22 07:26:53, LastModifiedById=005900000017R4DAAU, Seating_Capacity__c=50, Screen__c=true, Name=R-00002, City__c=Pune, LastViewedDate=2012-11-22 07:26:53, Address__c=Shivaji Nagar, Remarks__c=None, CreatedById=005900000017R4DAAU, CreatedDate=2012-11-22 07:26:52, Projector__c=true, IsDeleted=false, Id=a0K900000039VbPEAU, Type__c=Soft Skill Training Room, Co_ordinator_Name__c=abc})

 

Hi,

How to dynamically remove columns from apex : pageblocktable using jquery or any other technology?

Like it happens in Reports.

Hi All,

 

How to dynamically create an instance for an Object in Constructor of a Controller when that Object is selected from the picklist in VF page.

 

Hi All,

I have a Requirement to Create a Custom Button on record detail page for Copying data from Custom Object with some Record Type to create a record on a Standard Object with Record Type and Map their fields?




 

 

Hi All,

I would like to know how to dynamically get values for my picklist in VF page for which i am adding values through the Salesforce CRM with out statically mentioning in inputfield.

Also,is there a way to create picklist using Java script?

 

Hi All,

 

I have created a Custom Object in Salesforce and also have created some fields for the same.

Have used forms in Site.Com and i am able to access my Custom Object fields there.

Also i am able to save the data but would like to know how and from where can i include my VF pages and Standard Apex Controllers and Extensions for the Same object.

Hi All,

 

I have a requirement to get the Selected Object's Fields in a Multi select Picklist.Currently i am able to select the Object and get its fields in a list.

 

Below is my VF Code :-

 

<apex:page Controller="Describer">
<apex:form id="Describe">
<apex:pageBlock id="block2" >
<apex:pageblockbuttons location="top" >
<apex:commandButton value="Get Describe Object Fields" action="{!showFields}"/>
</apex:pageblockbuttons>
<apex:pageblocksection >
<apex:selectList value="{!selectedObject}" size="1">
<apex:selectOptions value="{!objectNames}"/>
</apex:selectList>
</apex:pageblocksection>
<apex:pageblocksection id="fieldList" rendered="{!not(isnull(selectedObject))}">
<apex:panelBar items="{!fields}" var="fls">
<apex:panelBarItem label="{!fls.key}">{!fls.val}</apex:panelBarItem>
</apex:panelBar>
</apex:pageblocksection>
</apex:pageBlock>
</apex:form>
</apex:page>

 

Below is my Controller Code :

 

public class Describer {

private Map <String, Schema.SObjectType> schemaMap = Schema.getGlobalDescribe();
public List <Pair> fields {get; set;}
public List <SelectOption> objectNames {public get; private set;}
public String selectedObject {get; set;}

// Intialize objectNames and fields

public Describer() {
objectNames = initObjNames();
fields = new List<Pair>();
}
// Populate SelectOption list -

// find all sObjects available in the organization

private List<SelectOption> initObjNames() {
List<SelectOption> objNames = new List<SelectOption>();

List<String> entities = new List<String>(schemaMap.keySet());
entities.sort();
for(String name : entities)
objNames.add(new SelectOption(name,name));
return objNames;
}

// Find the fields for the selected object

public void showFields() {
fields.clear();
Map <String, Schema.SObjectField> fieldMap = schemaMap.get(selectedObject).getDescribe().fields.getMap();

for(Schema.SObjectField sfield : fieldMap.Values()){
schema.describefieldresult dfield = sfield.getDescribe();
Pair field = new Pair();
field.key = dfield.getname();
fields.add(field);
}
}


public class Pair {
public String key {get; set;}
public String val {get; set;}
}
}

I have a requirement which says Account detail page should have border and all its Section Names and Related List names should be in Orange Colour.

I went throught the following but couldnt implement :-

http://www.salesforce.com/us/developer/docs/pages/Content/pages_compref_component.htm
http://www.salesforce.com/us/developer/docs/pages/Content/pages_comp_cust_elements_attributes.htm

This is what till now i have done :-

<apex:page standardController="Account" tabStyle="Accounts__tab">
<apex:pageBlock >
<apex:pageBlockSection >
<TABLE BORDERCOLOR="RED" width="195%">
<tr>
<apex:detail relatedList="false"/>
</tr>
</TABLE>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:page>

 

The problem in the Above is:-
1.Section Names are not Visible.
2.Related lists should be available outside account detail.
3.Names of Section and Related list needs to be Orange in colour.


Please Kindly Help and Guide...:(


Hi All,

I have a requirement to change the Tab colour of Accounts Tab to Orange,so that All the Section Names in Accounts will have Orange Colour and also the Related list names should have orange border instead of the Standard blue in "Account Detail page".

Wht i have Coded till now :-

<apex:page standardController="Account" tabstyle="Territory__c">

<apex:detail relatedList="true" title="true"/>

</apex:page>


In the above Code Territory__c is my Custom object having Orange colour tabsyle i took reference from this link :-

http://www.salesforce.com/us/developer/docs/pages/Content/pages_controller_std_styling.htm

But its not working and bydefault Territory Tab is getting selected insted of accounts....:(

Hi All,

 

I have two objects,Accounts and Territory Object :-

 

Account has following Standard fields:-

 

Billing State/Province

Billing Zip/Postal Code

Billing Country

 

Territory Object has Standard field :-

 

Territory Code

 

Territory Object has Standard field

 

Territory Name

 

 

Accounts Object is Standard Object and have created Territory Object to store Territory Code and 
Territory Name.

 

So my requirement is when I enter some Code in Billing Zip/Postal Code and Country in Billing Country,it should check for whether it is India and then check for whether the code exists in Territory Object and save the corresponding Territory Name in Billing State/Province.

 

 

Please kindly help and Guide...

 

Hi All,

 

I have a two field which i need to make Read Only ,so i changed the fieldlevel security and checked the checkbox for Read Only and also in Page Layout checked the checkbox for Read Only and saved both,but still i am able to edit those field...:(

 

 

Please Kindly Help and Guide.

 

 

Hi All,

Can someone please help me with converting the Following S-control into VF Code :-

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Edit Address Information</title>
<link href="/dCSS/Theme2/default/common.css" type="text/css" media="handheld,print,projection,screen,tty,tv" rel="stylesheet" >
<script src="/soap/ajax/9.0/connection.js"></script>
<script type="text/javascript">
var picklistFieldPrefixes = new Array("Mailing");
var record = new sforce.SObject("Lead");
var mailing = null;
</script>
{!INCLUDE($SControl.Address_Edit)}
<script type="text/javascript">
// Saves the address form data to the lead
function saveAddress(form, saveAndNew) {
try {
var recordId = "{!Lead.Id}";
// Set Address fields
setField(document.getElementById("Street"));
setField(document.getElementById("City"));
setField(document.getElementById("MailingState"),"State");
setField(document.getElementById("PostalCode"));
setField(document.getElementById("MailingCountry"),"Country");
record.set("Id",recordId);
record.fieldsToNull = fieldsToNull
var saveResult = sforce.connection.update([record]);
if (!saveResult[0].success) {
throw updateError(getErrorString(saveResult[0].errors));
}

if (saveAndNew) {
opener.location.href = "/00Q/e?retURL=%2F00Q%2Fo";
} else {
opener.location.reload();
}
window.close();
return true;
}
catch (e) {
exceptionHandler(e);
}
}
function init() {
try {
mailing = new DynamicOptionList("mailingCountry","mailingState");
}
catch(e) {
exceptionHandler(e);
}
}
function popPicklistCurrentAddress() {
try {
// Check if lead currently contains a state / country and pre-set picklists

var currentCountry = "{!Lead.Country}";

setSelected(document.addressForm.mailingCountry,currentCountry);

var currentState = "{!Lead.State}";

mailing.forValue("{!Lead.Country}").setDefaultOptions(currentState);
}
catch(e) {
exceptionHandler(e);
}
}
</script>
</head>
<body class="lead detailPage" onLoad="initDynamicOptionLists();">
<form name="addressForm" id="addressForm">
<table class="outer" width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="oRight">
<div class="bPageBlock secondaryPalette">
<div class="pbBody">
<div class="pbSubheader tertiaryPalette">
<h3>{!Lead.Name} - Address Information</h3></div>
<div class="pbSubsection">
<TABLE class="detailList" cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="labelCol"><label for="Street">Address</label></td>
<td class="dataCol col02"><textarea cols="27" rows="2" tabindex="1" maxlength="255" type="text" wrap="soft" id="Street" name="Street">{!Lead.Street}</textarea></td>
</tr>
<tr>
<td class="labelCol"><span id="lblOrgId">City</span></td>
<TD class="dataCol col02"><input value="{!Lead.City}" tabindex="2" maxlength="40" type="text" id="City" size="20" name="City"></TD>
</tr>
<tr>
<td class="labelCol">Country</td>
<TD class="dataCol col02">
<select tabindex="3" selected="{!Lead.Country}" id="MailingCountry" name="mailingCountry" ></select>
</td>
</tr>
<tr>
<td class="labelCol">State</td>
<td class="dataCol col02"><select tabindex="4" selected="{!Lead.State}" id="MailingState" name="mailingState" ></select></td>
</tr>
<tr>
<td class="labelCol">Zip/Postal Code</td>
<TD class="dataCol col02 last"><input value="{!Lead.PostalCode}" tabindex="5" maxlength="20" type="text" id="PostalCode" name="PostalCode" size="20" name="Zip"></TD>
</tr>
</table>
</div>
</div>
<div class="pbBottomButtons"><TABLE cellpadding="0" cellspacing="0" border="0"><TR><TD class="pbTitle" align="center"><img src="/s.gif" alt="" title="" width=1 height=1 class="minWidth">&nbsp;</TD><TD class="pbButtonb"><input value=" Save " class="btn" tabindex="11" type="button" title="Save" name="save" onClick="saveAddress(this.form, false);">&nbsp;<input value=" Save & New " class="btn" tabindex="12" type="button" title="Save & New" name="saveNew" onClick="saveAddress(this.form, true);">&nbsp;<input value="Cancel" class="btn" tabindex="13" type="button" title="Cancel" name="cancel" onClick="window.close();"></TD></TR></TABLE></div>
<div class="pbFooter secondaryPalette"><div class="bg"></div></div>
</div>
</td>
</tr>
</table>
<!-- Now that form has been rendered, build out the picklists -->
<script type="text/javascript">
init();
buildPicklists();
popPicklistCurrentAddress();
</script>
</form>
</body>
</html>

 

Hi All,

 

There is a requirement wherein i need to create a Visualforce page having tables in the below format i.e Column names displayed vertically comming from Standard and Custom objects and values comming from Standard and Custom objects and also same type of table with different data is to be displayed to its adjacent .So can any one please help me what will be best option for doing this in Visualforce?

 

Please kindly help and guide...

 

Column Name   Values

Column Name   values

Column Name   values

Hi All,

 

Can someone please help me with detailed steps for Migrating from Siebel to SFDC...

As i have never worked on Siebel I don't have any idea about that CRM but since have a requirement for migration would like to know it in detail.Also if you can provide any helpful pdfs,doc or links will be of Great Help...

 

 

 

Please kindly Help and Guide...

Hi All,

 

I have inserted some Images in my Custom Objects using Rich Text Area Data type but i am not able to view them in the List view(That is when i click the Object Tab all created records are displayed except the Image even though its Column is available and also the URL inserted in it gets displayed but not the Image).

 

Please Kindly Help and Guide...!

Hi All,

 

I could export the Report data to an excel sheet but is there a away to export the Report chart along with its data to an excel sheet or is there any App Exchange Free App to do the Same...???

 

Please kindly Help and Guide...:)

Hi All,

 

I am trying to create a Report from an Object but all the field of that object are not available to me.But this happened only in case on Some Objects.

 

Please kindly Help and Guide.

Hi All,

 

I would like to know if there is a way to see the code of Managed Apex classes from Installed Packages,i mean i am not able to see the code of the Apex classes and also not able to see the code of components.

 

Please help...

Hi All,

 

I am creating a Survey Force App from App Exchange but i dont hav much hands on in VF and Apex.

 

I have a requirement to pass a Survey link to Users and their responses should get saved when they click the Submit Button.

The issue i am facing is when they click the Submit button,their responses do not get saved.

Please help...!

 

Also within the Application i am able to save the prob is outside the App,when i share it with others.

 

Below is the Link for my Survey :-

 

http://lntinfotechlimited-developer-edition.ap1.force.com/lnt1

 

Part of My Extension for the TakeSurvey VF Page with submitResults(); :-

 

//TestViewSurveyController
private static Testmethod void testViewSurveyController()
{
SurveyTestingUtil tu = new SurveyTestingUtil();
Apexpages.currentPage().getParameters().put('id',tu.surveyId);
Apexpages.Standardcontroller stc;
ViewSurveyController vsc = new ViewSurveyController(stc);
vsc.init();
System.assert(vsc.allQuestionsSize == 4);
System.assert(tu.surveyId != null);
vsc.submitResults();
for (question q : vsc.allQuestions)
{
q.selectedOption = String.valueof(2);
q.choices = String.valueof(2);
q.selectedOptions = new List<String>();
q.selectedOptions.add(String.valueof(2));
vsc.submitResults();
}
System.assertEquals(true, vsc.thankYouRendered);
//Test something
}

//Submit Results
public void submitResults()
{
List <SurveyQuestionResponse__c> sqrList = new List<SurveyQuestionResponse__c>();
for (question q : allQuestions)
{
SurveyQuestionResponse__c sqr = new SurveyQuestionResponse__c();
if (q.renderSelectRadio == 'true')
{
if (q.required && (q.selectedOption == null || q.selectedOption == ''))
{
Apexpages.addMessage(new ApexPages.Message(ApexPages.Severity.ERROR, 'Please fill out all required fields'));
return;
}
if (q.selectedOption == null || q.selectedOption == '')
{
sqr.Response__c = '';
}
else
{
sqr.Response__c = q.singleOptions.get(Integer.valueOf(q.selectedOption)).getLabel();
}
sqr.Survey_Question__c = q.Id;
sqrList.add(sqr);
}
else if (q.renderFreeText == 'true')
{
if (q.required && q.choices == '')
{
Apexpages.addMessage(new ApexPages.Message(ApexPages.Severity.ERROR, 'Please fill out all required fields'));
return;
}
System.debug('*****Select Radio ' + q.choices);

sqr.Response__c = q.choices;
sqr.Survey_Question__c = q.Id;
sqrList.add(sqr);
}
else if (q.renderSelectCheckboxes == 'true')
{
if (q.required && (q.selectedOptions == null || q.selectedOptions.size() == 0))
{
Apexpages.addMessage(new ApexPages.Message(ApexPages.Severity.ERROR, 'Please fill out all required fields'));
return;
}
for (String opt : q.selectedOptions)
{
sqr = new SurveyQuestionResponse__c();
if (opt == '' || opt == null)
{
sqr.Response__c = '';
}
else
{
sqr.Response__c = q.multiOptions.get(Integer.valueOf(opt)).getLabel();
}
sqr.Survey_Question__c = q.Id;
sqrList.add(sqr);
}
}
else if (q.renderSelectRow == 'true')
{
if (q.required && (q.selectedOption == null || q.selectedOption == ''))
{
Apexpages.addMessage(new ApexPages.Message(ApexPages.Severity.ERROR, 'Please fill out all required fields'));
return;
}
if (q.selectedOption == null || q.selectedOption == '')
{
sqr.Response__c = '';
}
else
{
sqr.Response__c = q.rowOptions.get(Integer.valueOf(q.selectedOption)).getLabel();
}
sqr.Survey_Question__c = q.Id;
sqrList.add(sqr);
}
}
if(AddSurveyTaker())
{
for (SurveyQuestionResponse__c sqr : sqrList)
{
sqr.SurveyTaker__c = surveyTakerId;
}
insert sqrList;
thankYouRendered=true;
}
}

 

Hi All,

 

Compile Error: Incompatible types since an instance of LIST<SObject> is never an instance of LIST<objectList.PieWedgeData>

Our Code is :-
public List<PieWedgeData> getPieData() {
       data = (List<PieWedgeData>)mynewinst;    // mynewinst is a list of SObject type
       data.addall(mynewinst);
       
       return data;
   }
// Wrapper class
   public class PieWedgeData {

       public String name { get; set; }
       public Integer data { get; set; }

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

According to debug log "mynewinstance" contents :-

03:01:02.344 (344669000)|USER_DEBUG|[86]|DEBUG|$$$$$$$$$$$$$$$$$$mynewinst$$$$$$$$$$$$$$$$$$(Room__c:{White_Board__c=true, OwnerId=005900000017R4DAAU, LastModifiedDate=2012-11-26 09:10:34, Block__c=1, Phone_No__c=1234567890, Flip_Chart__c=true, No_of_Machines__c=2, SystemModstamp=2012-11-26 09:10:34, Email_Id__c=mayur.nagaonkar@lntinfotech.com, Location__c=Vashi, LastReferencedDate=2012-11-26 09:10:35, LastModifiedById=005900000017R4DAAU, Seating_Capacity__c=10, Screen__c=true, Name=R-00003, City__c=Mumbai, LastViewedDate=2012-11-26 09:10:35, Address__c=Shil Road,Mahape, Remarks__c=None, CreatedById=005900000017R4DAAU, CreatedDate=2012-11-26 09:10:34, Projector__c=true, IsDeleted=false, Id=a0K900000039mYcEAI, Type__c=Discussion Room, Co_ordinator_Name__c=xyz}, Room__c:{White_Board__c=true, OwnerId=005900000017R4DAAU, LastModifiedDate=2012-11-22 07:19:48, Block__c=1, Phone_No__c=1234567890, Flip_Chart__c=true, No_of_Machines__c=100, SystemModstamp=2012-11-22 07:19:48, Email_Id__c=mayur.nagaonkar@lntinfotech.com, Location__c=Vashi, LastReferencedDate=2012-11-26 11:44:10, LastModifiedById=005900000017R4DAAU, Seating_Capacity__c=100, Screen__c=true, Name=R-00001, City__c=Mumbai, LastViewedDate=2012-11-26 11:44:10, Address__c=Shil Road,Mahape, Remarks__c=None, CreatedById=005900000017R4DAAU, CreatedDate=2012-11-22 07:19:48, Projector__c=true, IsDeleted=false, Id=a0K900000039VaCEAU, Type__c=Technical Training Room, Co_ordinator_Name__c=xyz}, Room__c:{White_Board__c=true, OwnerId=005900000017R4DAAU, LastModifiedDate=2012-11-22 07:26:52, Block__c=1, Phone_No__c=1234569870, Flip_Chart__c=false, No_of_Machines__c=0, SystemModstamp=2012-11-22 07:26:52, Email_Id__c=gaurav.raj@lntinfotech.com, Location__c=Shivaji Nagar, LastReferencedDate=2012-11-22 07:26:53, LastModifiedById=005900000017R4DAAU, Seating_Capacity__c=50, Screen__c=true, Name=R-00002, City__c=Pune, LastViewedDate=2012-11-22 07:26:53, Address__c=Shivaji Nagar, Remarks__c=None, CreatedById=005900000017R4DAAU, CreatedDate=2012-11-22 07:26:52, Projector__c=true, IsDeleted=false, Id=a0K900000039VbPEAU, Type__c=Soft Skill Training Room, Co_ordinator_Name__c=abc})

 

Hi All,

 

I have a requirement to get the Selected Object's Fields in a Multi select Picklist.Currently i am able to select the Object and get its fields in a list.

 

Below is my VF Code :-

 

<apex:page Controller="Describer">
<apex:form id="Describe">
<apex:pageBlock id="block2" >
<apex:pageblockbuttons location="top" >
<apex:commandButton value="Get Describe Object Fields" action="{!showFields}"/>
</apex:pageblockbuttons>
<apex:pageblocksection >
<apex:selectList value="{!selectedObject}" size="1">
<apex:selectOptions value="{!objectNames}"/>
</apex:selectList>
</apex:pageblocksection>
<apex:pageblocksection id="fieldList" rendered="{!not(isnull(selectedObject))}">
<apex:panelBar items="{!fields}" var="fls">
<apex:panelBarItem label="{!fls.key}">{!fls.val}</apex:panelBarItem>
</apex:panelBar>
</apex:pageblocksection>
</apex:pageBlock>
</apex:form>
</apex:page>

 

Below is my Controller Code :

 

public class Describer {

private Map <String, Schema.SObjectType> schemaMap = Schema.getGlobalDescribe();
public List <Pair> fields {get; set;}
public List <SelectOption> objectNames {public get; private set;}
public String selectedObject {get; set;}

// Intialize objectNames and fields

public Describer() {
objectNames = initObjNames();
fields = new List<Pair>();
}
// Populate SelectOption list -

// find all sObjects available in the organization

private List<SelectOption> initObjNames() {
List<SelectOption> objNames = new List<SelectOption>();

List<String> entities = new List<String>(schemaMap.keySet());
entities.sort();
for(String name : entities)
objNames.add(new SelectOption(name,name));
return objNames;
}

// Find the fields for the selected object

public void showFields() {
fields.clear();
Map <String, Schema.SObjectField> fieldMap = schemaMap.get(selectedObject).getDescribe().fields.getMap();

for(Schema.SObjectField sfield : fieldMap.Values()){
schema.describefieldresult dfield = sfield.getDescribe();
Pair field = new Pair();
field.key = dfield.getname();
fields.add(field);
}
}


public class Pair {
public String key {get; set;}
public String val {get; set;}
}
}

I have a requirement which says Account detail page should have border and all its Section Names and Related List names should be in Orange Colour.

I went throught the following but couldnt implement :-

http://www.salesforce.com/us/developer/docs/pages/Content/pages_compref_component.htm
http://www.salesforce.com/us/developer/docs/pages/Content/pages_comp_cust_elements_attributes.htm

This is what till now i have done :-

<apex:page standardController="Account" tabStyle="Accounts__tab">
<apex:pageBlock >
<apex:pageBlockSection >
<TABLE BORDERCOLOR="RED" width="195%">
<tr>
<apex:detail relatedList="false"/>
</tr>
</TABLE>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:page>

 

The problem in the Above is:-
1.Section Names are not Visible.
2.Related lists should be available outside account detail.
3.Names of Section and Related list needs to be Orange in colour.


Please Kindly Help and Guide...:(


Hi All,

I have a requirement to change the Tab colour of Accounts Tab to Orange,so that All the Section Names in Accounts will have Orange Colour and also the Related list names should have orange border instead of the Standard blue in "Account Detail page".

Wht i have Coded till now :-

<apex:page standardController="Account" tabstyle="Territory__c">

<apex:detail relatedList="true" title="true"/>

</apex:page>


In the above Code Territory__c is my Custom object having Orange colour tabsyle i took reference from this link :-

http://www.salesforce.com/us/developer/docs/pages/Content/pages_controller_std_styling.htm

But its not working and bydefault Territory Tab is getting selected insted of accounts....:(

Hi All,

 

I have two objects,Accounts and Territory Object :-

 

Account has following Standard fields:-

 

Billing State/Province

Billing Zip/Postal Code

Billing Country

 

Territory Object has Standard field :-

 

Territory Code

 

Territory Object has Standard field

 

Territory Name

 

 

Accounts Object is Standard Object and have created Territory Object to store Territory Code and 
Territory Name.

 

So my requirement is when I enter some Code in Billing Zip/Postal Code and Country in Billing Country,it should check for whether it is India and then check for whether the code exists in Territory Object and save the corresponding Territory Name in Billing State/Province.

 

 

Please kindly help and Guide...

 

Hi All,

 

I have inserted some Images in my Custom Objects using Rich Text Area Data type but i am not able to view them in the List view(That is when i click the Object Tab all created records are displayed except the Image even though its Column is available and also the URL inserted in it gets displayed but not the Image).

 

Please Kindly Help and Guide...!

Hi All,

 

I am trying to create a Report from an Object but all the field of that object are not available to me.But this happened only in case on Some Objects.

 

Please kindly Help and Guide.

Hi All,

 

I would like to know if there is a way to see the code of Managed Apex classes from Installed Packages,i mean i am not able to see the code of the Apex classes and also not able to see the code of components.

 

Please help...

Hi All,

I am Creating a Simple VF Page for adding it to me Salesforce Site.

The page contains a Link for a Survey and the link is as follows :-

https://c.ap1.visual.force.com/apex/TakeSurvey?id=a009000000AgSNmAAN&cId=none&caId=none

But when i am clicking on the link it shows the following :-


Insufficient Privileges

You do not have the level of access necessary to perform the operation you requested. Please contact the owner of the record or your administrator if access is necessary.


What could be the issue please help....My profile is of System Administrator,still not able to access the page.

Hi,

      I am Creating an Application called Survey Force from App Exchange.In that i am trying to implement their same Controller called :- GSurveysController but still getting the following Error.

 

Error :-

 

Error: Compile Error: Declarations can only have one scope at line 191 column 35  

 

Part Of the Code and line in which i am getting Error :-

 

public static webservice String deleteSurvey(String deleteId)

{
Survey__c s= [Select Id, Name from Survey__c where Id =:deleteId];
delete s;

return 'true';
}

 

Please help...

Hi,

 

I am implementing SurveyForce App from Exchange.When i tried to create ViewShareSurveyComponent i am getting the following Error :-

 

 

Error: Compile Error: Invalid external string name: email_link_w_contact_merge at line 66 column 64

 

Part of the Code in which i am getting Error :-

 

public viewShareSurveyComponentController()
{
urlType = new List<SelectOption>();
urlType.add(new SelectOption('Email Link w/ Contact Merge',System.Label.LABS_SF_Email_Link_w_Contact_Merge));
urlType.add(new SelectOption('Email Link w/ Contact & Case Merge',System.Label.LABS_SF_Email_Link_w_Contact_Case_Merge));
urlType.add(new SelectOption('Email Link, Anonymous',System.Label.LABS_SF_Email_Link_Anonymous));
urlType.add(new SelectOption('Chatter',System.Label.LABS_SF_Chatter));
selectedURLType = 'Chatter';

setupPOD();
setupSitesPicklist();
siteInfo = Site.getDomain();

init();
}