• 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>
Hi, I am having an issue with a trigger. 
I have to check for a field value in all child records and see if it is exceeding 100% and throw an error based on that

Process is the Parent Object and its child is Phase and its child is goal.

So when a goal is inserted I have to check for all goals under process and see if the percentage exceeds 100% or not and throw an error.

Here is I am trying to accessing the Process id using the Phase__r foreign key, but it is returning null.

I can write couple of queries and access the same but it will hit governer limits when I insert a more 20 records, Any suggestions would be greatly appreciated.

trigger PercentageValidation on Goal__c (before insert, before update) {
   
    Map<Goal__c,Id> goalSpMap = new Map<Goal__c,Id> ();
   
    for(Goal__c g : Trigger.new){
     goalSpMap.put(g,g.phase__r.SalesProcess__c);
    }
    system.debug('Test 1 --->' + goalSpMap);
   
}
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.

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 have a page where i am creating an interface to add attchments, urls and documents from salesforce.

When the Attachments are added I am getting a view state limit error. Can someone please suggest a solution.

 

I am getting the error message only when the file size exceeds a certain limit, I cannot make attachment transient as you can see I am using the attchment values to create a customer Attachment__c record. Can someone please tell me how can I make just the AttachmentBody Transient.

 

Page

 

<apex:page standardController="Attachment" extensions="LandSlideFilePickerController" showHeader="false" sidebar="false">

<apex:pageBlock title="Select documents...">
<apex:form forceSSL="true">
<apex:pageMessages id="pm_PageMessages" />
<apex:pageBlockSection title="... from your computer" columns="1" >
<apex:outputpanel >
<strong>2. Click upload to attach your document. Attach multiple documents:</strong> repeat steps 1 and 2 to use multiple files.
(When the upload is complete, the file will appear in the "Documents to be faxed" list below.)<p />
<apex:inputFile value="{!Attachment.Body}" fileName="{!Attachment.Name}" fileSize="{!Attachment.BodyLength}" contentType="{!Attachment.ContentType}"/>
<apex:commandButton value="Upload" action="{!onUploadAttachment}" />
</apex:outputpanel>
</apex:pageBlockSection>
</apex:form>
</apex:pageBlock>
</apex:page>

 

Class

 

public with sharing class LandSlideFilePickerController {
public Id FolderId { public get; public set; }
public String SearchFilter { public get; public set; }
public String urlValue {public get; public set;}
public Boolean IsInternalUseOnly { public get; public set; }
public Id AttParentId{get;set;}
public Attachment a;

public LandSlideFilePickerController(ApexPages.StandardController controller) {
String pid = ApexPages.CurrentPage().getParameters().get('pid');
a = (Attachment) controller.getRecord();
a.ParentId = pid;
AttParentId = pid;
}

 

public void onUploadAttachment() {
database.insert(a);
Attachments__c ac = new Attachments__c();
ac.Name = a.Name;
ac.MIME_Type__c = a.ContentType;
ac.Sales_Resource__c = a.ParentId;
ac.Body_Length__c = String.valueOf(a.BodyLength);
ac.Value__c = URL.getSalesforceBaseUrl().toExternalForm() + '/servlet/servlet.FileDownload?file=' + a.Id;
database.insert (ac);
}

}

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>

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>

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

 

  1. When the dialog box is displayed i see the close button ('x' mark) not in sync with the image
  2. I see a border for the email link, when I havent specified one.
  3. When i click on email link in the dialog box, it uhides 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 was trying the jquery pop up from developer force

http://developer.force.com/cookbook/recipe/using-jquery-in-a-visualforce-page

and i  dont see the dialog box, I thought I would implement this in my org if it works. I have added the jquery library and there is no pop up blocker.

 

Has anyoen tried this and if it worked please let me know, as i am planning to implement

 

 

<apex:page showheader="false" standardController="Account" recordsetVar="accounts" showHeader="true" >
<head>
<apex:includeScript value="{!URLFOR($Resource.jQuery, '/js/jquery-1.4.2.min.js')}"  />
<apex:includeScript value="{!URLFOR($Resource.jQuery, '/js/jquery-ui-1.8.6.custom.min.js')}"  />
<apex:stylesheet value="{!URLFOR($Resource.jQuery, '/css/ui-lightness/jquery-ui-1.8.6.custom.css')}"  />
<script>
   $j = jQuery.noConflict();
   $j(document).ready(function() {
    $j("#phone").dialog({ autoOpen: false, modal: true, position: 'center'  });
   });
   
   function showDialog(name, phone){
      $j("#phoneNumber").html(phone);
      $j("#phone").dialog("open");
      $j('#phone').dialog("option" , "title" , name);
      $j('#phone').dialog('option', 'position', 'center');
      return false;
   }
</script>
<style>
    .accountLink { color: blue; cursor: pointer; cursor: hand; }
</style>
</head>    
 
<body>

  <apex:dataList value="{!accounts}" var="account" id="theList">
        <a href="" class="accountLink" onclick="return showDialog('{!account.name}','{!account.Phone}')"><apex:outputText value="{!account.name}"/></a>
  </apex:dataList>
 
  <div id="phone" >
      <div style="float:left">Phone:</div>
      <div id="phoneNumber"></div>
  </div>
 
</body>
</apex:page>

 

After the method call, I am setting the flag value to true, but on the page it is always false. Can someone please look into this and let me know if i am m issing something.

 

<apex:page standardController="Opportunity" extensions="testcontroller">
<script type="text/javascript">
function testclick(Value){
testcheck(Value);
alert({!flag});
}
</script>
<apex:form >
<apex:actionFunction action="{!phaseCheck}" name="testcheck" reRender="">
<apex:param assignTo="{!pValue}" value="" name="someName"/>
</apex:actionFunction>
<apex:pageBlock >

<apex:inputCheckbox title="Test" id="chkbox" onclick="testclick('Test')"/>
<apex:outputLabel id="olabel" for="chkbox">Test</apex:outputLabel>
</apex:pageBlock>

</apex:form>
</apex:page>

 

public class testcontroller{

public testcontroller(ApexPages.StandardController controller) {

}

public Static String pValue{get;set;}
public Static boolean flag{get;set;}

public static void phaseCheck(){
system.debug('Test --->' + pValue);
flag = true;
system.debug('flag --->' + flag);

}
}

I am trying to call the method and pass the parameter, I can see that the method is getting invoked but  the value is not getting passed to the controller. Can someone please look at this and let me know if I am missing something.

 

VF Page:

<apex:page standardController="Opportunity" extensions="testcontroller">
<script type="text/javascript">
function testclick(Value){
testcheck(Value);
}
</script>
<apex:form >
<apex:actionFunction action="{!testmeth}" name="testcheck">
<apex:param assignTo="{!pValue}" value=""/>
</apex:actionFunction>
<apex:pageBlock >

<apex:inputCheckbox title="Test" id="chkbox" onclick="testclick('Test')"/>
<apex:outputLabel id="olabel" for="chkbox">Test</apex:outputLabel>
</apex:pageBlock>

</apex:form>
</apex:page>

 

Controller:

public class testcontroller{

public testcontroller(ApexPages.StandardController controller) {

}

public Static String pValue{get;set;}

public static void testmeth(){
system.debug('Test --->' + pValue);
}
}

I was trying to refer an image from a zipped folder, which is uploaded into static resource and I get a error message.

 

Syntax from VF Docs:

<apex:image url="{!URLFOR($Resource.TestZip,
'images/Bluehills.jpg')}"
width="50" height="50"/>

 

I have tried the same thing but I dont see the image

 

<apex:image url="{!URLFOR($Resource.LSImages, '/checkbox-on.gif')}" width="50" height="50"/>, it woks fine when I refer the image induvidually and not from a zipped folder.

 

I have a simple vf page, I am trying to set the checkbox value selected to true. But it doesnt work when the page is displayed the checkboxes are  unchecked.

 

<apex:page standardController="Opportunity" extensions="Test">
 
  <apex:form id="theform">
      <apex:actionFunction action="{!click}" name="displayFunction"  rerender="" id="afunc">
                <apex:param name="stageV" value="" id="aparam"/>
      </apex:actionFunction>
      
      <apex:pageBlock id="pageblock">
            <apex:repeat value="{!stageValue}" var="s">
                <apex:outputLabel value="{!s.Name}"/>
                <apex:inputCheckbox selected="true" />
            </apex:repeat>
        </apex:pageBlock>  
  </apex:form>
</apex:page>

I was trying to call the click() function, when a value is selected in the selectoption.

 

But I dont see the call going through, I see the javascript function being call and than call goes to apex:function.

In the debug I can see getStageValue() called again on selecting value in selectoption.  Is the selectoption stopping the call?

 I tried action support and it doesnt work, I think this is a salesforce bug. I tried several options and it does not work.Looks like apex:selectoption and action functions have an issue when used together.

 

<apex:page standardController="Opportunity" extensions="Test">
    
  <script type="text/javascript">
            function getStageValue(id){
                displayFunction(document.getElementById(id).value);   
            }
  </script>  
 
  <apex:form >
      <apex:actionFunction action="{!click}" name="displayFunction"  rerender="pageblock">
                <apex:param name="stageValue" value=""/>
      </apex:actionFunction>
      
      <apex:pageBlock  id="pageblock">
            <apex:outputlabel value="Stage:" />
            <apex:selectList value="{!stage}" multiselect="false" size="1" id="stageValue" onchange="getStageValue('{!$Component.stageValue}')">
                <apex:selectOptions value="{!StageValue}" />
            </apex:selectList>    
            
        </apex:pageBlock>  
  </apex:form>
</apex:page>

------------------------------------

public with sharing class Test {
        
        private final String procName;
        private final Opportunity opp;
        String [] stage = new String []{};
         
        public Test(ApexPages.StandardController stdController) {

        System.debug('Called LSOpportunityDetailsController CTOR');
        String i = stdController.getId();

            this.opp = [select id, name, ProcessId__c from Opportunity where id = :i];        
            if (opp.ProcessId__c != null) {
                procName = [SELECT Name FROM Sales_Process__c where Id=:opp.ProcessId__c].Name;
                
            }
                  
        }
    
    public String[] getStage(){
        return stage;
    }
    
    public void setStage(String [] stage){
        this.stage = stage;
    }
    
    public  List<SelectOption> getstageValue(){
        List<SelectOption> options = new List<SelectOption>();
        List <Phase__c> phaseList = [select Name from Phase__c where Sales_Process__c=:opp.ProcessId__c  Order by Order__c];
        
        for(Phase__c phase:phaseList){
                options.add(new SelectOption(phase.Name,phase.Name));
        }
        return options;
        
    }
    
    public void click(){
        system.debug('In -------------->');
    }
}

I was trying to call the click() function, when a value is selected the selectoption.

 

But I dont see the call going through, I see the javascript function being call and than call goes to apex:function.

In the debug I can see getStageValue() called again on selecting value in selectoption.  Is the selectoption stopping the call?

 

<apex:page standardController="Opportunity" extensions="LSOpportunityDetailsController">
    
  <script type="text/javascript">
            function getStageValue(id){
                displayFunction(document.getElementById(id).value);   
            }
  </script>  
 
  <apex:form >
      <apex:actionFunction action="{!click}" name="displayFunction"  rerender="pageblock">
                <apex:param name="stageValue" value=""/>
      </apex:actionFunction>
      
      <apex:pageBlock  id="pageblock">
            <apex:outputlabel value="Stage:" />
            <apex:selectList value="{!stage}" multiselect="false" size="1" id="stageValue" onchange="getStageValue('{!$Component.stageValue}')">
                <apex:selectOptions value="{!StageValue}" />
            </apex:selectList>    
            
        </apex:pageBlock>  
  </apex:form>
</apex:page>

------------------------------------

public with sharing class LSOpportunityDetailsController  {



    private final Opportunity opp;
    private final String procName;
    private Id currentPhase;
    String [] stage = new String []{};
    String para {get;set;}
    List<Goal__c> goalList {get;set;}
    private String stageVal;
    
   
    public LSOpportunityDetailsController(ApexPages.StandardController stdController) {

        System.debug('Called LSOpportunityDetailsController CTOR');
        String i = stdController.getId();
        if (i == null) {
            procName =  'No Id';
            this.opp = new Opportunity();
        }
        else {            
            this.opp = [select id, name, ProcessId__c from Opportunity where id = :i];        
            if (opp.ProcessId__c != null) {
                procName = [SELECT Name FROM Sales_Process__c where Id=:opp.ProcessId__c].Name;
                
            }
        }
                  
    }
    
    public LSOpportunityDetailsController(Id oppId) {
        this.opp = [select id, name, ProcessId__c from Opportunity where id = :oppId];
                
        if (opp.ProcessId__c != null) {
            procName = [SELECT Name FROM Sales_Process__c where Id=:opp.ProcessId__c].Name;
        }
    }
    
    public String[] getStage(){
        return stage;
    }
    
    public void setStage(String [] stage){
        this.stage = stage;
    }
    
    public  List<SelectOption> getStageValue(){
        
        
        List<SelectOption> options = new List<SelectOption>();
        List <Phase__c> phaseList = [select Name from Phase__c where Sales_Process__c=:opp.ProcessId__c ];
        
        for(Phase__c phase:phaseList){
                options.add(new SelectOption(phase.Name,phase.Name));
        }
        return options;
        
    }
    
    public PageReference  click(){
        system.debug('Test' + ApexPages.CurrentPage().getParameters().get('stageValue'));
        stageVal = ApexPages.CurrentPage().getParameters().get('stageValue');
        return null;
    }
    

}

I have overwritten the custom object 'New' button, I would like to access the id of the record when they click the 'New' button. Is it possible to get the Id of the record before it is committed to the DB(sounds stupid..but i thought I will still go ahead and ask)

This is the contructor

 

private Sales__c salesesource;

public salesResourceController(ApexPages.StandardController controller) {
        salesesource = (Sales__c)controller.getRecord();
        System.debug('Called salesResourceController' +salesesource );
    }

Hi, I am having an issue with a trigger. 
I have to check for a field value in all child records and see if it is exceeding 100% and throw an error based on that

Process is the Parent Object and its child is Phase and its child is goal.

So when a goal is inserted I have to check for all goals under process and see if the percentage exceeds 100% or not and throw an error.

Here is I am trying to accessing the Process id using the Phase__r foreign key, but it is returning null.

I can write couple of queries and access the same but it will hit governer limits when I insert a more 20 records, Any suggestions would be greatly appreciated.

trigger PercentageValidation on Goal__c (before insert, before update) {
   
    Map<Goal__c,Id> goalSpMap = new Map<Goal__c,Id> ();
   
    for(Goal__c g : Trigger.new){
     goalSpMap.put(g,g.phase__r.SalesProcess__c);
    }
    system.debug('Test 1 --->' + goalSpMap);
   
}
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.
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.