• Dileep Kumar
  • NEWBIE
  • 215 Points
  • Member since 2015
  • Software Engineer

  • Chatter
    Feed
  • 4
    Best Answers
  • 0
    Likes Received
  • 1
    Likes Given
  • 12
    Questions
  • 38
    Replies
Hi, I have two customfields, checkbox and Lookup fields, my requirement is if i check that checkbox then only lookup field is displayed otherwise not displayed,can we write any validationrule on this or any coding??
I saw many post regarding this issue but non of them calling action support from apexgridPanel.
PageBlock have 2 coloumn but in one row I have to display two checkbox in one coloumn so I used gridPanel for this.
On click of check I have to hide and display one pageblock section. So On click of checkbox I am calling action hideDisplayLOB using
action support but actionsupport unable to hit action on controller.

Visualforce page(I can't provide full code) - 
<apex:pageBlockSectionItem id="uatSection">
                    <apex:outputLabel value="User Account Type" />
                    <apex:panelGrid columns="5" id="pg">
                        <apex:outputLabel value="Admin"/>
                        <apex:inputCheckbox id="admin" value="{!hsProvi.Admin__c}" disabled="{!isAdminDisable}" />                        
                         <apex:outputLabel value="User"/>
                         <apex:actionRegion>
                             <apex:inputCheckbox id="user" value="{!hsProvi.User__c}" disabled="{!isUserDisable}"/>
                             <apex:actionSupport  event="onclick" reRender="sslob" action="{!hideDisplayLOB}"></apex:actionSupport>
                         </apex:actionRegion>
                   </apex:panelGrid>                   
                </apex:pageBlockSectionItem> 
                   <apex:pageBlockSectionItem >
                    <apex:outputLabel value="Admin Role"/>
                    <!-- apex:outputLabel value="{!roleList}" /-->
                     <apex:selectList id="adminRole" value="{!roleName}" size="1" disabled="true">
                        <apex:selectOptions value="{!roleOptions}"/>
                    </apex:selectList>
                </apex:pageBlockSectionItem>
                <apex:pageBlockSectionItem id="ss" rendered="{!lobDisplay}">
                    <apex:outputPanel id="sslob">
                    <apex:outputLabel value="Line of Business"/>
                    <apex:inputField id="lob" value="{!hsProvi.HS_Line_of_Business__c}" />
                       </apex:outputPanel>
                </apex:pageBlockSectionItem>  

Cotroller
public pageReference hideDisplayLOB(){
         System.debug('Hide Dispaly LOB');
         if(hsProvi.User__c) {
             lobDisplay = true;
         }
         else {
             lobDisplay = false;
         }
         return null;
     }
 
hi all , 

in a vf page , i have a custom button , if i click that button i need to get a pop up which displays all account fields name, phone with a check box  in a column . can you please give me an example how to do this ??
Create a Visualforce page without the standard Salesforce header and display an image using the Visualforce image component.
The page must be named 'DisplayImage'.
It must NOT display the standard Salesforce header.
It must use a Visualforce apex:image component to display this image - https://developer.salesforce.com/files/salesforce-developer-network-logo.png

<apex:page showHeader="false" title='DisplayImage'> 
    <apex:pageBlock >
        <apex:image url="https://developer.salesforce.com/files/salesforce-developer-network-logo.png"/>
    </apex:pageBlock> 
</apex:page>

Challenge Not yet complete... here's what's wrong: 
The 'DisplayImage' page was not found.

Hi All,

How I will import csv file through visualforce page into Object in salesforce ?

please help me,

Thanks,

Dileep Kumar

Hi All,

<script>
function setVar(){
       var v= document.getElementById("cbid").getAttribute.style.(backgroundColor).value;
       if(v == ''){
           window.alert('ywewdf');
       }else{
           window.alert('welcome');
       }
}
</script>

I am calling this function on button click but i am not getting any alert.

Actually i want to get the background color of  <td>. By using javaScript.

Please help me.

Thanks in advance,

Dileep

Hi All,

I want to display one <div>Content</div> as like popup.But it will display when i will click on <apex:inputtextField />.

How i will do it?

Please help me.

Thanks in advance,

Dileep

Hi All,

I created one object.Object having two fields one for Name and other for storing hex color code.Now i want to display the name and color on vf page.Now i want to show that when i will click on color box on page then  one popup will display with multiple color box but in one row it should show four color box .whatever color box we will select that should come in that record color box from where it is diplaying.

please help me

Thanks,
Dileep

Hi all,

I created one object , in this object i created one text field and in this text field i am storing hex code of color. now i want to show this color on vf page.how i will do it.

please help me.

Thanks,

Dileep

Hi All,

I am facing problem to insert data into one field ,Data type of field is TextArea .I am inserting value throught visualforce page but i am getting null value inside method.All other fields are working.
Vf Page :  <apex:inputTextarea  value="{!cancelation.Reason_for_Cancellation__c}"  />

Thanks,

Dileep kumar

Hi All


<apex:selectList id="actionsList" multiselect="false" size="1">
                        <apex:selectOption itemValue="--None--" itemLabel="--None--" />  
                        <apex:selectOption itemValue="Edit" itemLabel="Edit"/>
                        <apex:selectOption itemValue="Delete" itemLabel="Delete" />
                        <apex:selectOption itemValue="VAT+" itemLabel="VAT+"  >
                            <apex:actionSupport event="onchange" action="{!applyVat}" reRender="masterPanel">
                            <apex:param value="{!er.entry.id}" assignTo="{!EntryToUpdate}"/>
                            </apex:actionSupport>
                        </apex:selectOption> 
</apex:selectList>


public void applyVat(){
        Id toUpdate = ApexPages.currentPage().getParameters().get('EntryToUpdate');
        Ledger_Entry__c leEntry= [select Id,Apply_Vat__c,Type__c,Disbursement__c,DisbValAndVat__c from Ledger_Entry__c where id = :toUpdate];
        if(leEntry.Apply_Vat__c==false && calculateVat=='VAT+'){
            leEntry.Apply_Vat__c=true;
            update leEntry;
        }
}

Thanks in Advance,

Dileep Kumar

Hi All

Actually, i want to update record by using <apex:actionSupport event="onselect" action="{!methodName}" rerender="id">

Thanks in Advance,

Dileep Kumar

Hi All

I created a visualforce page in my page there are many div i want to create tabs for each div on this page.

How i will do?

Please help me

Thanks in advance

Id caseId=ApexPages.currentPage().getParameters().get('id');

List<Ledger_Entry__c >ledgerList = [select Name,Amount__c,Bill_No__c,Cheque_No__c,Date__c,Description__c,Matter__c,Type__c,
                    sum_of_office__c,Office__c,Disbursement__c,Client_Balance__c,Sum_Of_Client_Balance__c,sumofc__c,Office1__c,Client1__c,DisbVal__c 
                    from Ledger_Entry__c  (where  Matter__c =caseId.Id) order by CreatedDate desc];

 

it is not working.I am getting error in saving this code.I need both where condition and order by CreatedDate desc .

Please help me.

 

Thanks in advance

Hi All,

My developer edition is not working.Suddenly i am having this problem.Tried to reset but i don't remember the security question.If anyone know how to reset it.My username is ascmanohar@gmail.com. Pls help me...

Thanks,

Dileep

Hi, I have two customfields, checkbox and Lookup fields, my requirement is if i check that checkbox then only lookup field is displayed otherwise not displayed,can we write any validationrule on this or any coding??
I saw many post regarding this issue but non of them calling action support from apexgridPanel.
PageBlock have 2 coloumn but in one row I have to display two checkbox in one coloumn so I used gridPanel for this.
On click of check I have to hide and display one pageblock section. So On click of checkbox I am calling action hideDisplayLOB using
action support but actionsupport unable to hit action on controller.

Visualforce page(I can't provide full code) - 
<apex:pageBlockSectionItem id="uatSection">
                    <apex:outputLabel value="User Account Type" />
                    <apex:panelGrid columns="5" id="pg">
                        <apex:outputLabel value="Admin"/>
                        <apex:inputCheckbox id="admin" value="{!hsProvi.Admin__c}" disabled="{!isAdminDisable}" />                        
                         <apex:outputLabel value="User"/>
                         <apex:actionRegion>
                             <apex:inputCheckbox id="user" value="{!hsProvi.User__c}" disabled="{!isUserDisable}"/>
                             <apex:actionSupport  event="onclick" reRender="sslob" action="{!hideDisplayLOB}"></apex:actionSupport>
                         </apex:actionRegion>
                   </apex:panelGrid>                   
                </apex:pageBlockSectionItem> 
                   <apex:pageBlockSectionItem >
                    <apex:outputLabel value="Admin Role"/>
                    <!-- apex:outputLabel value="{!roleList}" /-->
                     <apex:selectList id="adminRole" value="{!roleName}" size="1" disabled="true">
                        <apex:selectOptions value="{!roleOptions}"/>
                    </apex:selectList>
                </apex:pageBlockSectionItem>
                <apex:pageBlockSectionItem id="ss" rendered="{!lobDisplay}">
                    <apex:outputPanel id="sslob">
                    <apex:outputLabel value="Line of Business"/>
                    <apex:inputField id="lob" value="{!hsProvi.HS_Line_of_Business__c}" />
                       </apex:outputPanel>
                </apex:pageBlockSectionItem>  

Cotroller
public pageReference hideDisplayLOB(){
         System.debug('Hide Dispaly LOB');
         if(hsProvi.User__c) {
             lobDisplay = true;
         }
         else {
             lobDisplay = false;
         }
         return null;
     }
 
Hi, 

Created a method below which is calling reCalRslrDiscSalPrc am passing aruments or parameters in this method  on of the arument is null due to which am getting error please suggest me how to modifiy or handle such argument null exception

  Decimal.Valueof(lineW.line.Reseller_discount_rate__c)
public PageReference calcOnReDistSalPrcchange () {
         Decimal glistprice;
         Decimal chkresller = 0;
         
        for(OptyLineWrapper linew : lineWrapr) {        
            OpportunityLineItem backuplne = backUpLines.get(lineW.line.id);
            
          //  if ( lineW.line.Reseller_discount_rate__c <> null ) 
          //  {
                if ( lineW.line.PricebookEntry.name != 'COTERM' )
                 {
                  glistprice = lineW.line.listprice;
                  }
                 else
                 {
                  glistprice = lineW.line.CoTerm_List_Price__c;                 
                  }
                  
                 system.debug('glistprice = '+ glistprice);
                 system.debug('lineW.line.PricebookEntry.Product2.Category__c = '+ lineW.line.PricebookEntry.Product2.Category__c);
                 system.debug('lineW.line.Reseller_discount_rate__c = '+ lineW.line.Reseller_discount_rate__c);
 
                   lineW.line.UnitPrice = reCalRslrDiscSalPrc(glistprice,lineW.line.PricebookEntry.Product2.Category__c,Decimal.Valueof(lineW.line.Reseller_discount_rate__c);  );
                  
           // }
        }
        
        return null;
    }

  Below method is called in above method passing parameter. 
/* calculate disti discount */  
    public static Decimal reCalRslrDisc(Decimal listprice,String productcat, Decimal reslrdistdiscount){
        Boolean isService = false;
        
        system.debug('listprice = ' + listprice);
        system.debug('productcat = ' + productcat);
        system.debug('reslrdistdiscount = ' + reslrdistdiscount);
        
        if ( productcat=='C' || productcat=='E'|| productcat=='D'|| productcat=='H'|| productcat=='I'|| productcat=='J' )
        {
            isService = true;
        }
        
        if ( reslrdistdiscount <> null && isService == true)
        { 
            NSP_Margin_Schedule__c NMS =  [ Select Distributor_Discount__c From NSP_Margin_Schedule__c 
                                           where  Reseller_Discount__c = :reslrdistdiscount and 
                                           Service__c = :isService and 
                                           createddate < 2015-01-17T00:00:00-08:00 ];
            
            return NMS.Distributor_Discount__c;
        }
        else
        {
            return 0;
        }      
        
    }

Thanks
Sudhir
  • September 16, 2016
  • Like
  • 0

Hi,
I have a Page and a controller.

In my page I am doing something like, when we select a radio button only some portion of the page will get rendered=true.
But when I click radio button it takes some time to load. So I would like to display some message like "loading" on the page, while it is loading.
Can anyone plz help me with the code?

Thanks in advance

hi all , 

in a vf page , i have a custom button , if i click that button i need to get a pop up which displays all account fields name, phone with a check box  in a column . can you please give me an example how to do this ??
<apex:page standardcontroller="Opportunity" extensions="myOpptyController" tabStyle="Opportunity">

          <apex:pageBlock title="opportunity product related list">

             <apex:pageBlockTable value="{!opptyList}" var="div">

               <apex:column >

                        <apex:pageBlockTable value="{!div.OpportunityLineItems}" var="custom">

                        <apex:column value="{!custom.Quantity}"/>

                        <apex:column value="{!custom.UnitPrice}"/>

                        <apex:column value="{!custom.TotalPrice}"/>

                        <apex:column value="{!custom.PricebookEntry.Name}"/>

                        <apex:column value="{!custom.PricebookEntry.Product2.Family}"/>

                    </apex:pageBlockTable>

            </apex:column>   

     </apex:pageBlockTable>

    </apex:pageBlock>

    </apex:page>

Class is as follows:
public class myOpptyController {

    public myOpptyController(ApexPages.StandardController controller) {

    }     

        public List<Opportunity> opptyList{get;set;}

       // public List<OpportunityListItems> opptyList1{get;set;}

        public myOpptyController() {
     

        opptyList = [SELECT Id,Name,

             (SELECT ID, Quantity, UnitPrice, TotalPrice,PricebookEntry.Name, PricebookEntry.Product2.Family FROM OpportunityLineItems)

                            FROM Opportunity WHERE Id =: ApexPages.currentPage().getParameters().get('ID')];

                  //   System.debug('opptyList ='+opptyList);

        }

         

      //  public List<Opportunity> getopptyList() {

      //      return opptyList;
    //    }
      

    }
This code is not displaying opportunitylineitem table
Hi,

I have a visualforce page for salesforce1. I created cards for records and when I press to a card I want to call a function from the page's controller.
I put the event onclick on the div tag from visualforce but it does't work. 
This is my page:

User-added image

And this is the code:
<apex:form >
  <script type="text/javascript">
  function saveAddress(var id) {
    doSave(id);
  }
    </script>
  <apex:actionFunction name="doSave" action="{!save}" rerender="mypage">
      <apex:param name="addressId" value="" />
  </apex:actionFunction> 
  <div class="card-list context-account">
      <div class="card-list-heading">
        <h3>Detalii adrese</h3>
      </div>
      <apex:repeat value="{!address}" var="add" >
          <div class="card" onclick="saveAddress({!add.Adresa__c});">
            <div class="card-heading" >
              {!add.Adresa__r.Detalii_Adresa__c}
            </div>
            <ul class="card-detail ">
              <li><span class="sf1label">Judet:&nbsp;&nbsp; <apex:outputField value="{!add.Adresa__r.Judet_Sector__c}" /></span></li>
              <li><span class="sf1label">Oras:&nbsp;&nbsp; <apex:outputField value="{!add.Adresa__r.Oras__c}" /></span></li>
              <li><span class="sf1label">Tip Adresa:&nbsp;&nbsp; <apex:outputField value="{!add.Adresa__r.Tip_adresa__c}" /></span></li>
            </ul>
          </div>
    </apex:repeat>
  </div>
</apex:form>

Can someone help me?
Thanks!
Create a Visualforce page without the standard Salesforce header and display an image using the Visualforce image component.
The page must be named 'DisplayImage'.
It must NOT display the standard Salesforce header.
It must use a Visualforce apex:image component to display this image - https://developer.salesforce.com/files/salesforce-developer-network-logo.png

<apex:page showHeader="false" title='DisplayImage'> 
    <apex:pageBlock >
        <apex:image url="https://developer.salesforce.com/files/salesforce-developer-network-logo.png"/>
    </apex:pageBlock> 
</apex:page>

Challenge Not yet complete... here's what's wrong: 
The 'DisplayImage' page was not found.
Hi,
I was trying out a simple trigger on Case Object.There is a field Hiring_Manager__c (looks up to User) in Case .On update or insert of a case, this field has to be populated with the Case Owner's Manager.I created the trigger as follows.It is not bulkified as I was just trying out for a single record.
I could see the value getting populated correctly in debug statements.But it is not updated on the record.

trigger HiringManagerupdate_case on Case (before insert,before update) {
    Case updatedCaseRec= [select id,ownerId,Hiring_Manager__c,CaseNumber from case where id in :Trigger.new];
      system.debug('Case Number'+updatedCaseRec.CaseNumber);
      system.debug('Manager before updation'+updatedCaseRec.Hiring_Manager__c);
    Map<id,String> mapOwnerMgr=new Map<id,String>();
    try{
       User caseOwner = [Select Id,Name, ManagerId, Manager.Email From User Where Id = :updatedCaseRec.ownerId];
                updatedCaseRec.Hiring_Manager__c=caseOwner.ManagerId;
                
    }
    Catch(DMLException de){
        system.debug('Could not find Manager');
    }
    system.debug('Manager'+updatedCaseRec.Hiring_Manager__c);
 
}
I have a VF page in which VF component is called using <C: VF Component/>

I need to show an error message based on entitlement of logged in user - entitlement functionality is defined in Component controller and isused in Component. Can I call those parameters set for entitlement in Component Controller in my VF page and based on that show error message else show my page content.

Please suggest- this is urgent.

Thanks
Jyoti
 
Hello everyone,
    
    Can anyone help on the below issue.
    
I am using visualforce with angularjs.
I have a visualforce page (Search) and two apex components (SimpleSearch and AdvancedSearch).
I am loading the apex components into the page through angularjs using routeprovider.
 
SearchApp.config(['$routeProvider', function($routeProvider) {
    $routeProvider
        .when('/', {templateUrl: '/apexcomponent/SimpleSearch', 
            controller: 'SimpleSearchCtrl'})
        .when('/advsrch', {templateUrl: sitePrefix+'/apexcomponent/AdvancedSearch', 
            controller: 'AdvancedSearchCtrl'})
        .otherwise({redirectTo: '/'});
}]);

It works when using Administator user (salesforce licence) because admin has "Customize Application" permission.
When using simple user (Other than salesforce licence e.g. salesforce platform licence) I am getting a 500 Internal server error in browser console for component.
In the error log we found the below message.
You do not have sufficient privileges to access the page: /apexcomponent/SimpleSearch httpReferer=https-//c-naNN-visual-force-com/apex/Search

Hi All,

I want to display one <div>Content</div> as like popup.But it will display when i will click on <apex:inputtextField />.

How i will do it?

Please help me.

Thanks in advance,

Dileep

Hello everyone,
    
    Can anyone help on the below issue.
    
I am using visualforce with angularjs.
I have a visualforce page (Search) and two apex components (SimpleSearch and AdvancedSearch).
I am loading the apex components into the page through angularjs using routeprovider.
 
SearchApp.config(['$routeProvider', function($routeProvider) {
    $routeProvider
        .when('/', {templateUrl: '/apexcomponent/SimpleSearch', 
            controller: 'SimpleSearchCtrl'})
        .when('/advsrch', {templateUrl: sitePrefix+'/apexcomponent/AdvancedSearch', 
            controller: 'AdvancedSearchCtrl'})
        .otherwise({redirectTo: '/'});
}]);

It works when using Administator user (salesforce licence) because admin has "Customize Application" permission.
When using simple user (Other than salesforce licence e.g. salesforce platform licence) I am getting a 500 Internal server error in browser console for component.
In the error log we found the below message.
You do not have sufficient privileges to access the page: /apexcomponent/SimpleSearch httpReferer=https-//c-naNN-visual-force-com/apex/Search