• Renu Kyal
  • NEWBIE
  • 0 Points
  • Member since 2013

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 2
    Replies
<script>
   
     $(function() {
       
        if(!$('[id$="enableEstimatedSalesDate"]').attr('checked')){
            $('[id$="estimatedSalesDate"]').attr('disabled', 'disabled');
        }
        if(!$('[id$="enableOpportunityStep"]').attr('checked')){
            $('[id$="opportunityStep"]').attr('disabled', 'disabled');
        }
        if(!$('[id$="enableOrderForecastCategory"]').attr('checked')){
            $('[id$="orderForecastCategory"]').attr('disabled', 'disabled');
        }
        if(!$('[id$="enableTerm"]').attr('checked')){
            $('[id$="term"]').attr('disabled', 'disabled');
        }
        if(!$('[id$="enableNextSteps"]').attr('checked')){
            $('[id$="nextSteps"]').attr('disabled', 'disabled');
        }
        if(!$('[id$="enableDescription"]').attr('checked')){
            $('[id$="description"]').attr('disabled', 'disabled');
        }
        //Tender related Checkboxes sync with Tender related fields
        if(!$('[id$="enableTenderName"]').attr('checked')){ 
            $('[id$="tenderName"]').attr('disabled', 'disabled');
        }
        if(!$('[id$="enableTenderAnnouncementDate"]').attr('checked')){
            $('[id$="tenderAnnouncementDate"]').attr('disabled', 'disabled');
        }
        if(!$('[id$="enableTenderStatus"]').attr('checked')){
            $('[id$="tenderStatus"]').attr('disabled', 'disabled');
        }       
        if(!$('[id$="enableTenderType"]').attr('checked')){
            $('[id$="tenderType"]').attr('disabled', 'disabled');
        }
        if(!$('[id$="enableGEBidDecision"]').attr('checked')){
            $('[id$="geBidDecision"]').attr('disabled', 'disabled');
        }
        if(!$('[id$="enablePrimaryReasonForNoBid"]').attr('checked')){
            $('[id$="primaryReasonForNoBid"]').attr('disabled', 'disabled');
        }
        if(!$('[id$="enablesalesForecastCategory"]').attr('checked')){
            $('[id$="salesForecastCategory"]').attr('disabled', 'disabled');
        }
        if(!$('[id$="enableOrderAtRisk"]').attr('checked')){ 
            $('[id$="orderAtRisk"]').attr('disabled', 'disabled');
        }
        if(!$('[id$="enableTenderLink"]').attr('checked')){
            $('[id$="tenderLink"]').attr('disabled', 'disabled');
        }
        if(!$('[id$="enableTenderDueDate"]').attr('checked')){
            $('[id$="tenderDueDate"]').attr('disabled', 'disabled');   
        }
        if(!$('[id$="enableTenderResultDate"]').attr('checked')){
            $('[id$="tenderResultDate"]').attr('disabled', 'disabled');
        }
        if(!$('[id$="enableAmendmentRequest"]').attr('checked')){
            $('[id$="amendmentRequest"]').attr('disabled', 'disabled');
        }
        if(!$('[id$="enableAmendmentResult"]').attr('checked')){
            $('[id$="amendmentResult"]').attr('disabled', 'disabled');
        }
        if(!$('[id$="enableTenderOpportunity"]').attr('checked')){
            $('[id$="tenderOpportunity"]').attr('disabled', 'disabled');                                         
        }
        if(!$('[id$="enableTenderWorkflowRequired"]').attr('checked')){
            $('[id$="tenderWorkflowRequired"]').attr('disabled', 'disabled');
        }
        if(!$('[id$="enableTenderWorkflowReference"]').attr('checked')){
            $('[id$="tenderWorkflowReference"]').attr('disabled', 'disabled');
        }       
        if(!$('[id$="enableTenderStartPrice"]').attr('checked')){ 
            $('[id$="tenderStartPrice"]').attr('disabled', 'disabled');
        }
        if(!$('[id$="enableTenderEndPrice"]').attr('checked')){ 
            $('[id$="tenderEndPrice"]').attr('disabled', 'disabled');
        }
        if(!$('[id$="enableTenderNumber"]').attr('checked')){ 
            $('[id$="tenderNumber"]').attr('disabled', 'disabled');
        }
        if(!$('[id$="enableRequiredEQServDeliveryDate"]').attr('checked')){
            $('[id$="requiredEQServDeliveryDate"]').attr('disabled', 'disabled');
        }
        if(!$('[id$="enableContractSecurityDeposit"]').attr('checked')){ 
            $('[id$="contractSecurityDeposit"]').attr('disabled', 'disabled');
        }
        if(!$('[id$="enableWarrantySecurityDeposit"]').attr('checked')){ 
            $('[id$="warrantySecurityDeposit"]').attr('disabled', 'disabled');                                                                                      
        }                                             
    });
   
    if('{!UserHasAccess}' == 'false' || '{!recordUpdated}' =='true' || '{!noChildOpp}' =='true' ){
        if('{!UserHasAccess}' == 'false'){
            $('#NoAccessNotice').html("<span class='ui-icon ui-icon-alert' style='float: left; margin: 0 15px 20px 0;'></span>{!$Label.ParentOppMassUpdateChildrenWizard_User_Without_Access}");
        }   
        else if( '{!recordUpdated}' =='true'){
            $('#NoAccessNotice').html("<span class='ui-icon ui-icon-alert' style='float: left; margin: 0 15px 20px 0;'></span>{!$Label.ParentOppMassUpdateChildrenWizardRecordUpdated}");
        }
        else if( '{!noChildOpp}' =='true' ){ 
            $('#NoAccessNotice').html("<span class='ui-icon ui-icon-alert' style='float: left; margin: 0 15px 20px 0;'></span>{!$Label.ParentOppMassUpdateChildrenWizard_ParentWithoutChild}"); 
        }
         
        $('#NoAccessNotice').bind('dialogclose', function(event) {
            window.top.location = '{!$Site.Prefix}/{!parentOppId}';
        });
        $("#NoAccessNotice").dialog( {  modal: true,
                                resizable: false,
                            buttons: {
                                    Ok: function() {
                                    $( this ).dialog( "close" );
                            }
                }} );
    }

    if('{!noFieldEnabledForUpdate}' =='true'){
        alert('{!$Label.ParentOppMassUpdateChildrenWizard_noFieldEnabledForUpdate}');
    }
    if('{!noChildTermOpp}' =='true'){
        $('#NoAccessNotice').html("<p>{!$Label.ParentOppMassUpdateChildrenWizard_ParentWithoutTenderOptyChild}</p>"); 
    }

Hi,

 

following are the code requirements:

1. If value entered in product name is not present in Products, then it should enable Save button.

2. If value entered in product name is present in Products, then it should display all the contents in a table.

 

VF Code:

<apex:page StandardController="Product__c" extensions="ExistingController"  >
   <apex:form id="fm" >
   <apex:actionFunction name="invoke" action="{!search}" reRender="pb"/>

       <apex:pageBlock id="pb" title="Products" mode="edit" >
           <apex:pageBlockSection id="pbs" title="Search/Create a Product record" columns="2">
               <apex:inputField id="ifname" value="{!Product__c.name}"  />
               <apex:inputField value="{!Product__c.Description__c}" />
               <apex:inputField value="{!Product__c.Total_Inventory__c}"  />
               <apex:inputField value="{!Product__c.Price__c}" />
               <apex:inputField value="{!Product__c.Stock_Quantity__c}" />
           </apex:pageBlockSection>
               <apex:pageBlockButtons >
               <apex:commandButton value="reset"  action="{!Reset}"/>
               <apex:commandButton value="Save" action="{!Save}" rendered="{!flag}"/>
               <apex:commandButton value="Search" OnClick="nameNull()"/>
           </apex:pageBlockButtons>
          
           <apex:pageBlockTable id="pbt" var="pb" value="{!prodRecordList}">
               <apex:column value="{!pb.Name}" />
               <apex:column value="{!pb.Description__c}"/>
               <apex:column value="{!pb.Total_Inventory__c}"/>
               <apex:column value="{!pb.Price__c}"/>
               <apex:column value="{!pb.Stock_Quantity__c}"/>
           </apex:pageBlockTable>
           </apex:pageBlock>
      
      
   </apex:form>
   <script>
       function nameNull(){
           var text= document.getElementById("{!$Component.fm.pb.pbs.ifname}").value;
           if(text == '')
           {alert('Please enter value in Product Name field');
           }
           else
                {           invoke();
                                                   }        
                                           }
   </script>
</apex:page>

 

 

Controller Code:

 

public class ExistingController {

   public string nameStr{ get; private set; }
   Public List<product__c> prodRecordList {get; set;}
   Public product__c prod {get; set;}
   public boolean flag {get; set;}
  
   public ExistingController(ApexPages.StandardController stdController) {
       this.prod= (product__c)stdController.getRecord();
   }
  
   public pageReference search () {

       prodRecordList =  [SELECT id, Name, Description__c, Total_Inventory__c, Price__c, Stock_Quantity__c from product__c where name=:prod.name];
       System.debug('@@prodRecordList'+prodRecordList);
       if(prodRecordList.size()==0 )
      
           flag = true;
           return null;
   }
   public pageReference Reset() {

       PageReference newpage = new PageReference(System.currentPageReference().getURL());
       newpage.setRedirect(true);
       return newpage;  
          }
      
  public pageReference Save()  {
  INSERT prod;
  pageReference newpage = new PageReference('/apex/recordsaved');
  return newpage;
  }
}

 

When calling directly it works, but when called from Javascript action function it does not. Please help.

So, i was in the middle of completeting my SF lightning rollout super badge and i got to Module #6 when i got the following error trying to "Check Challenge":
There was an unexpected error while verifying this challenge. Usually this is due to some pre-existing configuration or code in the challenge Org. We recommend using a new Developer Edition (DE) to check this challenge. If you're using a new DE and seeing this error, please post to the developer forums and reference error id: VCPZSYVQ

Any help would be greatly appreciated!!
 
Hey,

Having an issue with attempting to use jsPDF as a library within my lightning component. I have uploaded the zip as a Static Resource, and am have properly included the file in my application.

The issue is when my page loads I get the followign error:

Uncaught ReferenceError: AcroForm is not defined throws at /resource/JSPDF101/jsPDF-1.2.60/dist/jspdf.min.js:238:8028

I've tried the minified and debug version of the file, both of which are giving me the same error message. 

I've been unable to find out why this is happening. Now I had imagined that all of this would be properly handled by the jsPDF file, but seems there are some reference problems. I even attempted to load the acroform.js file as a Static Resource separately but to no avail. 

Any help is greatly appreciated, thank you.
  • September 01, 2016
  • Like
  • 0