• Lithiums
  • NEWBIE
  • 100 Points
  • Member since 2010

  • Chatter
    Feed
  • 4
    Best Answers
  • 2
    Likes Received
  • 0
    Likes Given
  • 29
    Questions
  • 64
    Replies
I am a system admin and i own the record. when I try to edit one field i am getting this error, I am able to edit all other fields on the record and this error is for that one particular field.

I checked the field level acces and I have access and have view all and modify all access checked as well.This field is an external id field and i am entering unique values. Also checked for validation rules and there are none.

Is there anything else i need to look for.
Onclicking the checkbox related question has to display, i have out only two questions in data as of now.

On clicking the checkbox it is returing the correct Id and I am setting the id to show() but the panel is not displaying.

Can someone please look at the code

Controller
public class ProposalManagementController{
   
    private list <Quoting_Tool_Questions__c> qlist;
    public list <ProposalManagementWrapper> wrapperlist;
   
    public ProposalManagementController(){}
   
    public list <ProposalManagementWrapper> getQuestions(){
        try{
            wrapperlist =  new list <ProposalManagementWrapper> ();
            qlist = [select id,name,Question__c,Question_Order__c,Section_Name__c,Section_Order__c,Key__c,Dependent_Question__c  from Quoting_Tool_Questions__c ORDER BY Question_Order__c ASC];
            system.debug('Question -->' + qlist );
            for(Quoting_Tool_Questions__c q:qlist){
                wrapperlist.add(new ProposalManagementWrapper(q));
                system.debug('WrapperList --->' + wrapperlist);
            }
        }catch(exception e){e.getMessage();}   
        return wrapperlist;
    }
   
    public void displayPanel(){
   
    }
   
    public class ProposalManagementWrapper{
        public list <Quoting_Tool_Answeres__c> alist {get;set;}
        public Quoting_Tool_Questions__c q {get;set;}
        public boolean displayFlag{get;set;}
        public string Key{get;set;}
       
        public  ProposalManagementWrapper (Quoting_Tool_Questions__c  q){
            this.q = q;
            if(q.Dependent_Question__c == true){
                this.displayFlag = true;
            }else{
                this.displayFlag = false;
            }
           
            if(q.Key__c != null){
                Key = '-' + q.Key__c ;
            }else{
                Key = '';
            }
            this.alist = [select id,name,Answere__c,Key__c,Order__c,Quoting_Tool_Questions__c from Quoting_Tool_Answeres__c where Quoting_Tool_Questions__c =:q.Id  ORDER BY Order__c ASC];
        }
    }
}

Page:
<apex:page sidebar="false"  showHeader="false" controller="ProposalManagementController">
    <style type="text/css">
        .textfield{
            border-bottom:solid;
            border-width:1px;
            border-bottom-color:#E0E0D1;
            height:30px;

        }
    </style>   
    <script type="text/javascript">
         $(document).ready(function(){
             $('*[id*=block-]:visible').each(function() {
                 $(this).hide();
             });  
                
         });
        
         function panelRender(val){
             var id = "block-" + val;
             alert(id);
             $(id).show();
         }
    </script>    
    <apex:includeScript value="{!$Resource.Jquery}"/>
    <apex:form>
        <apex:pageBlock>
            <table id="thetable" style="width:100%;">
            <apex:repeat value="{!Questions}" var="wrapper">
                 <tr id="block{!wrapper.Key}">
                     <td class="textfield" >
                         <table style="width:60%;">
                             <tr>
                                 <td style="width:20%;" align="right">
                                     <apex:outputLabel for="timeframe"><b>{!wrapper.q.Question__c}</b></apex:outputLabel>
                                 </td>
                                 <td style="width:20%;" >
                                     <apex:repeat value="{!wrapper.alist}" var="a">
                                         <div>
                                             <apex:outputText value="{!a.Answere__c}" >
                                                 <apex:inputCheckbox title="{!a.Name}" value="{!a.Key__c}" onclick="panelRender('{!a.Key__c}')"/>
                                             </apex:outputText>
                                         </div>
                                     </apex:repeat>
                                 </td>
                             </tr>
                         </table>
                     </td>
                 </tr>
             </apex:repeat>
             </table>
        </apex:pageBlock>
    </apex:form>
</apex:page>
I have an xml file which is being loaded into Salesforce as a document using the input file tag (VF Page), I am able to access the document and get the contents. I am assigning the contents to a DOM.Document object, but when I am trying to traverse down to child objects it is not giving the values and its always null.

This is the body of text file

<?xml version="1.0" encoding="UTF-8"?>
<Process>
   <SalesProcess Name="Test Process">
      <Phase Name="Test" Order="1" Duration="0">
           <Goal Name="Test" Order="1" Confidence="0">
                <Description>Test Goal</Description>
           </Goal>
     </Phase>
   </SalesProcess>
</Process>

Method Parsing the document

public void loadAttachment(){
        String paramvalue = EncodingUtil.base64Encode(attach.body);
        Blob afterblob = EncodingUtil.base64Decode(paramvalue);
        attachmentBody = afterblob.tostring();
        Dom.Document document = new Dom.Document();
        document.load(attachmentBody);
        Dom.Xmlnode rootnode = doc.getrootElement();
        for(Dom.XMLNode child : rootnode.getChildElements()) {
           System.debug(child.getName()); // This value is blank.
       
        }
   }

When I debug I am getting the following string as root node

XMLNode[ELEMENT,Process,null,null,null,[XMLNode[ELEMENT,SalesProcess,null,[common.apex.api.dom.XmlNode$Attribute@6393be55, common.apex.api.dom.XmlNode$Attribute@78b4f185, common.apex.api.dom.XmlNode$Attribute@2f5c90ac],null,[XMLNode[ELEMENT,Phase,null,[common.apex.api.dom.XmlNode$Attribute@661e247e, common.apex.api.dom.XmlNode$Attribute@44ee0092, common.apex.api.dom.XmlNode$Attribute@65679498],null,[XMLNode[ELEMENT,Goal,null,[common.apex.api.dom.XmlNode$Attribute@734cbb2a, common.apex.api.dom.XmlNode$Attribute@3293fd89, common.apex.api.dom.XmlNode$Attribute@11ea4750],null,[XMLNode[ELEMENT,Description,null,null,null,[XMLNode[TEXT,null,null,null,null,null,Test Goal,]],null,]],null,]],null,]],null,]],null,]

I printed the document.tostring() and the string is matching the  xml, but i am not able to access the document values and it gives me a weird string when try to access the root node, if i try to access root node child i get a blank value.
Hi All,
        I am using a wrapper class with checkboxes to display a list of conact record with contact phone field and Account name. In this list  upon selection of a checkbox i wanna 2 updates.
1. Contact Phone Field.
2. Contacts Account Name.
Code is pretty standard , taken from wrapper class documentation example ,Its given below:

Apex:
public class wrapperClassController {
    //Our collection of the class/wrapper objects cContact 
    public List<cContact> contactList {get; set;}
    public List<Account> AccountList {get; set;}
    public List<Id> AccountIdList {get; set;}
    //This method uses a simple SOQL query to return a List of Contacts
    public List<cContact> getContacts() {

        if(contactList == null) {
            contactList = new List<cContact>();
            for(Contact c: [select Id, Name, Email, Phone, Contact.Account.Name,Contact.Account.isPersonAccount from Contact limit 10]) {
                // As each contact is processed we create a new cContact object and add it to the contactList
                contactList.add(new cContact(c));
            }
        }
        return contactList;
    }
    public PageReference processSelected() {
    //We create a new list of Contacts that we be populated only with Contacts if they are selected
      List<Contact> selectedContacts = new List<Contact>();
      //We will cycle through our list of cContacts and will check to see if the selected property is set to true, if it is we add the Contact to the selectedContacts list
      for(cContact cCon: getContacts()) {
            if(cCon.selected == true) {
                selectedContacts.add(cCon.con);
            }
        }
      // Now we have our list of selected contacts and can perform any type of logic we want, sending emails, updating a field on the Contact, etc
      System.debug('These are the selected Contacts...');
      for(Contact con: selectedContacts) {
          
            system.debug('aaaaaaaaaaaaaaaaaaaaaaaa'+con);
            
       }

       update selectedContacts;
       contactList=null; // we need this line if we performed a write operation  because getContacts gets a fresh list now
       return null;
   }
   // This is our wrapper/container class. A container class is a class, a data structure, or an abstract data type whose instances are collections of other objects. In this example a wrapper class contains both the standard salesforce object Contact and a Boolean value
    public class cContact {
        public Contact con {get; set;}
        public Boolean selected {get; set;}
        //This is the contructor method. When we create a new cContact object we pass a Contact that is set to the con property. We also set the selected value to false
        public cContact(Contact c) {
        con = c;
        selected = false;
      }
    }


}
///////////////////////////////////////////VF PAGE////////////////////////////////////////////////
<apex:page controller="wrapperClassController">
    <apex:form >
        <apex:pageBlock >
            <apex:pageBlockButtons >
                <apex:commandButton value="Process Selected" action="{!processSelected}" rerender="table"/>
            </apex:pageBlockButtons>
            <!-- In our table we are displaying the cContact records -->
            <apex:pageBlockTable value="{!contacts}" var="c" id="table">
            <apex:column >
            <!-- This is our selected Boolean property in our wrapper class -->
            <apex:inputCheckbox value="{!c.selected}"/>
            </apex:column>
            <!-- This is how we access the contact values within our cContact container/wrapper -->
            <apex:column value="{!c.con.Name}" />
            <apex:column value="{!c.con.Email}" />
            <!--<apex:column value="{!c.con.Phone}" />-->
            <apex:column title="Contact Phone" headerValue="Contact Phone">
                 <apex:facet name="Contact Phone">Contact Phone</apex:facet>
                 <apex:inputField value="{!c.con.Phone}" />
           </apex:column>
           <apex:column title="Account Name" headerValue="Account Name">
                 <apex:facet name="Account Name">Account Name</apex:facet>
                 <apex:inputField value="{!c.con.Account.Name}" />
           </apex:column>
           </apex:pageBlockTable>
        </apex:pageBlock>
    </apex:form>
</apex:page>
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Upon click of button phone field is getting updated , plz help me with updation of Account Name as well




Thanks
Shrey Tyagi



I have put a button on an object, this object has some configuration settings. On clicking the button configuration needs to put in a xml format and the text file needs to be downloaded on to desktop or anyother location outside of salesforce.

 

On clicking the button, I am able to build the xml but I am having trouble putting the file on desktop. I know there is render as but I dont want any manual intervention for saving.

 

Can someone advice me on this....

I see the below error message when trying to use a custom functionality. I dont see this error when I am logged in as System Admin, but I do see the below error when I am logged in as any other user. Does anyone know what the below error means.

 

"The configuration of your org has changed, please reload the page. Missing dependent object: Field: Organization.OrganizationType
An unexpected error has occurred. Your solution provider has been notified. "

I was looking at this post 

 

http://blog.jeffdouglas.com/2011/08/12/roll-your-own-salesforce-lookup-popup-window/

 

I see there is a openPopup() function, is this part of the standard salesforce functions or the jquery function.I am planning to use it my custom page, but dont want to use it if it is part of standard sf functions.

I have craeted a page and using apex:repeat i am creating multiple div and assiging them dynamic id's. On load want only one div to be visible and later based on certain actions, I would make other visible.

 

So on load I am getting the id of the div which needs to be visible and using setAttribute making it visible, but somehow it is still hidden.Can some one please look into the issue

 

<apex:pagetabStyle="Opportunity"standardController="Opportunity"extensions="LSOpportunityDetailsController"sidebar="false"showHeader="false">

 

<apex:includeScriptvalue="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"  />

<apex:includeScriptvalue="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.1/jquery-ui.min.js"  />

<apex:stylesheetvalue="//ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery.ui.theme.css"/>

<apex:stylesheetvalue="//ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery.ui.base.css"/>

 

<scripttype="text/javascript">

    $(document).ready(function() {

        getRemoteValidation();

    });                                               

</script>

<scripttype="text/javascript">

    function getRemoteValidation() {        

       

     

        document.getElementById(phaseBlock{!currentP}).setAttribute("style","visibility:visible;");

}

    </script>

   

<apex:form>

    <apex:pageblocktitle="Test">

        <tablecellspacing="0"style="border:1px dotted #999999;">

                <tr>

                    <apex:repeatvalue="{!phases}"var="phaseWrapper"id="theRepeat">

                        <td  valign="top"id="phaseBlock{!phaseWrapper.phase.Name}"style="visibility:hidden">

                            <table>

                                <tr height="35">

                                    <td style="background-color:#E4ECFF" width="950" valign="top">

                                        <table >

                                            <tr>

                                                <td><apex:outputText value="{!phaseWrapper.phase.Name}" id="theValue" style="font-size:10pt;"/></td>

                                            </tr>

                                        </table>                                                    

                                    </td>

                                </tr>                                                               

                            </table>                                   

                        </td> 

                    </apex:repeat>

                </tr>

            </table>

    </apex:pageblock>

</apex:form>

</apex:page>

Hello,

 

I have a scenario where I have an apex:actionFunction. This actionFunciton rerenders outputpanels in my visualforcve page.


I with to only rerender the outputPanel's based on a boolean value from my controller. If after I call my function my boolean value is true I want to rerender specific panels. If not I don't want to rerender them.

 

I tried this with the following but it does not seem to work correctly

reRender="{!if(priorformProcessed, 'panel1, panel2', 'testFalse')}"

 

The actionFunction exists in panel 1.  "TestFalse" is always rerendered no matter if my boolean is true (and true in my view state). 

 

 

Do you know if there is a way of dynamically providing which panels to ReRender similar to what I'm trying to do above?

 

I tried to use a string variable which I set in my controller to define which panels to rerender but so far I have not got this to work either (although it may be a possible approach).

 

Any advice/suggestions on this would be good.

 

Thanks.

Please help me with the rendered issue.I have created a page and would like to display the outputtext based on the flag in the controller, I am making a java remote call and passing a parameter to the controller based on which the flag will be set. Somehow the value is always false and the text is not displayed. This is the simplified version of code and I removed a lot of unnecessary stuff.

 

<apex:page sidebar="false" showHeader="false" controller="TestController">

<script type="text/javascript">
    function colid(name){
        Visualforce.remoting.Manager.invokeAction(
                    '{!$RemoteAction.TestController.actFlag}',name,
                    function(result, event){
                        if(event.status){
                            if(result == true){
                            
                            }
                        }
                    },
                    {escape: true});
    }
</script>

<apex:form >
<apex:pageBlock >
    <apex:outputText >
        <script type="text/javascript">
            colid('Test');
        </script>
    </apex:outputText>
    <apex:outputText value="Test" id="theValue" rendered="{!activityFlag}" />{!activityflag}
</apex:pageBlock>
</apex:form>
</apex:page>

 

global  class TestController {

    public static boolean activityflag{get;set;}
    
    @RemoteAction
    global static void actFlag(String phaseName)
    {
        
        activityflag = true;
    }
}

hi, I was trying jquery dialog box in visual force page and was seeing some issue when the dialog box is displayed.

 

  1. I see a border for the email link, when I havent specified one.
  2. When i click on email link in the dialog box, it unhides the 'test' div but the page is reloading and its taking me away.It should unhide and leave me on the same dialog box.

please look at it and let me know if i am doing anything wrong

 

<apex:page showheader="false" standardController="Account" recordsetVar="accounts" showHeader="true">
<apex:form >
<head>
<apex:includeScript value="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js" />
<apex:includeScript value="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.1/jquery-ui.min.js" />
<apex:stylesheet value="//ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery.ui.theme.css"/>
<apex:stylesheet value="//ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery.ui.base.css"/>

<style>
.accountLink { color: blue; cursor: pointer; cursor: hand;text-decoration:underline;font-style:italic; }
</style>

<script type="text/javascript">
$(document).ready(function() {
$('#dialog').hide();
$('#test').hide();
$('#dialog').dialog({
title: "Choose Activity ",
autoOpen: false,
resizable: false,


});
});

function showDialog(){
$("#dialog").dialog('open')

}

function showalert(){
$('#test').show();
}
</script>


</head>

<body>

<a href="" class="accountLink" onclick="showDialog()">Activity</a>
<div id="dialog" >
<apex:outputPanel >
This is the content that will be displayed in the dialog box.
<apex:outputLink value="" onclick="showalert()">Email</apex:outputLink>
</apex:outputPanel>
<div id="test">
Test
</div>
</div>
</body>
</apex:form>
</apex:page>

I have created an input field in visualforce which displays some search results when a button (named search) is clicked. I am able to write the apex code to display the results. However, I want to display the search results in a new pop-up window . I have read this post and was able to create a pop up window. 

http://www.salesforcegeneral.com/salesforce-modal-dialog-box/

 

This is my visualforce code which produces search results. 

 

<apex:page sidebar="false" showHeader="false" standardController="Account" extensions="SearchSuiteNumber">
<p>Enter the account number to search</p>
<apex:form >
<apex:pageBlock mode="edit" id="block">
<apex:pageBlockSection >
<apex:pageBlockSectionItem >
<apex:panelGroup >
<apex:inputText id="searchText" value="{!searchText}"/>
<apex:commandButton value="Search" action="{!search}" rerender="block" status="status"/>
</apex:panelGroup>
</apex:pageBlockSectionItem>
</apex:pageBlockSection><br/>

<apex:actionStatus id="status" startText="Searching... please wait..."/>
<apex:pageBlockSection title="Search Results" id="resultsBlock" columns="1">
<apex:pageBlockTable value="{!searchResults}" var="item" rendered="{!NOT(ISNULL(searchResults))}">
<apex:column value="{!item.Name}" headerValue="Customer" width="30"/>
<apex:column value="{!item.Acc_Num__c}" headerValue="Account Number" width="35"/>
</apex:pageBlockTable>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>

 

Apex Class:

 

public with sharing class SearchAccountNumber {

private ApexPages.StandardController controller {get; set;}
public List<Account> searchResults {get;set;}
public string searchText {get;set;}

public SearchAccountNumber(ApexPages.StandardController controller) { }

// fired when the search button is clicked
public PageReference search()
{
String qry = 'select id, Name, Acc_Num__c from Account WHERE Acc_Num__c LIKE \'%'+searchText+'%\'';
searchResults = Database.query(qry);
return null;
}
}

 

Please help as this issue is urgent for me. 

 

Thanks a lot.