• Valli K
  • NEWBIE
  • 20 Points
  • Member since 2018

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 8
    Questions
  • 30
    Replies
how to hide a certain fields in a related list object<apex:relatedlist list="contacts"> in vf page.. sample code please
 public static boolean validatemethod (Id acc,String str,Id rec){
        boolean validatemethod = true;
        List<custom__c> cus = new List<custom__c>();
       
        if(rec==null){
          / 
         cus = [Select id,name from custom__c where account__c =:acc and Product__c =:str];
        }
        else{
         
          
          cus = [Select id,name from custom__c where account__c =:acc and Product__c =: str and id !=:rec];
        }
        if(!cus.isEmpty()){
            return false;
        } 
        return validatemethod;
    }
prepopulate lookup field in lightning:recordeditform with lightning:inputfield
i wan to fetch content from a zip file[json data] and dispaly it in lightning component. Json formatted zip file os uploaded standard files. that zip file content json data have to display it in lightning component. Any sample code for this.
<apex:page standardController="Opportunity" extensions="Optydoc">
    <script>
        var i = 0;
        window.onload = function(){    
            document.getElementById('hiddenform').submit();
        }
        function countalert(){
            i++;
            if(i===3){
                window.parent.location.reload();
            }
        }
    </script>
    <form id="hiddenform" action="{!iframeURL}" target="JavaApplication" method="post" enctype="application/x-www-form-urlencoded">
        <input type="hidden" name="source" value="SFDC"/>
        <input type="hidden" name="opportunityId" value="{!OppId}"/>
        <input type="hidden" name="accountId" value="{!AccId}"/>
        <input type="hidden" name="primaryAssociation" value="Opportunity"/>
    </form>
    <apex:pageblock id="upload">
        <apex:pageBlockSection title="Upload Documents" columns="1">
            <iframe id="JavaApplication" name="JavaApplication" style="display:block;width:100%;height:550px" scrolling="no" ></iframe>
        </apex:pageBlockSection>
        <apex:pageMessages ></apex:pageMessages>
        
    </apex:pageblock>
</apex:page>
=====================
public with sharing class Optydoc {
    public String iFrameURL { get; set; }
    public Id OppID { get; set; }
    public Id AccID { 
        get{
            if(OppID!=null){
                Opportunity opp = [select AccountId from Opportunity Where Id=: OppID];
                return opp.AccountID;
            }
            return null;
        }
        set;
    }
    public Optydoc(ApexPages.StandardController stdController) {
        OppID = stdController.getRecord().Id;
        try{
         iframeURL = CustomSetting__c.getInstance('JavaApplication').endPointURL__c;   
             System.debug('Exceptionrwrr'+iframeURL);
         
        }catch(Exception e){
             System.debug('Exception'+e);
             
        }        
    }
Lighnting component javascript controller:
 deleteRecord : function(component,event,helper,recordId){
        var action = component.get("c.deleteSelRecord");
        action.setParams({"recordId":recordId});
        action.setCallback(this,function(response){
            var state = response.getState();
            if(state === "SUCCESS"){
                var result = response.getReturnValue();
                //if(result ==="true"){
                    // toast message
                    alert("Requested Record Deleted");
                component.set("v.isOpen", false);
               // }
                console.log(" result :: "+JSON.stringify(result));
                
            }else{
                console.log(" Error Occured");
            }
            
        });
        $A.enqueueAction(action);
        
    }
    
    
Apex controller:
  @AuraEnabled
    public static list<Quote> deleteSelRecord(String recordId){
       // boolean result = true;
        // if successs return true;
      //  return result;
       System.debug('Quote got deleted');  
       List<quote> quotess = new List<quote>();
       quotess= [Select Id, Name, QuoteNumber,Status,OpportunityId FROM quote where Id =:recordId ORDER BY QuoteNumber ];
       if(quotess.size() > 0){
            try{
                delete quotess;
           }catch(Exception e){
                ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.ERROR,'Exception: '+e);
                ApexPages.addMessage(myMsg);   
                return quotess;                          
          }                       
    }
not able to migrate my javascript button in lightning experience. please help me to convert the below button. I am new to Lightning. current onclick javascript action: window.location.href ='/apex/RequestType?&id={!Opportunity.Id}';
how to hide a certain fields in a related list object<apex:relatedlist list="contacts"> in vf page.. sample code please
 public static boolean validatemethod (Id acc,String str,Id rec){
        boolean validatemethod = true;
        List<custom__c> cus = new List<custom__c>();
       
        if(rec==null){
          / 
         cus = [Select id,name from custom__c where account__c =:acc and Product__c =:str];
        }
        else{
         
          
          cus = [Select id,name from custom__c where account__c =:acc and Product__c =: str and id !=:rec];
        }
        if(!cus.isEmpty()){
            return false;
        } 
        return validatemethod;
    }
prepopulate lookup field in lightning:recordeditform with lightning:inputfield
i wan to fetch content from a zip file[json data] and dispaly it in lightning component. Json formatted zip file os uploaded standard files. that zip file content json data have to display it in lightning component. Any sample code for this.
<apex:page standardController="Opportunity" extensions="Optydoc">
    <script>
        var i = 0;
        window.onload = function(){    
            document.getElementById('hiddenform').submit();
        }
        function countalert(){
            i++;
            if(i===3){
                window.parent.location.reload();
            }
        }
    </script>
    <form id="hiddenform" action="{!iframeURL}" target="JavaApplication" method="post" enctype="application/x-www-form-urlencoded">
        <input type="hidden" name="source" value="SFDC"/>
        <input type="hidden" name="opportunityId" value="{!OppId}"/>
        <input type="hidden" name="accountId" value="{!AccId}"/>
        <input type="hidden" name="primaryAssociation" value="Opportunity"/>
    </form>
    <apex:pageblock id="upload">
        <apex:pageBlockSection title="Upload Documents" columns="1">
            <iframe id="JavaApplication" name="JavaApplication" style="display:block;width:100%;height:550px" scrolling="no" ></iframe>
        </apex:pageBlockSection>
        <apex:pageMessages ></apex:pageMessages>
        
    </apex:pageblock>
</apex:page>
=====================
public with sharing class Optydoc {
    public String iFrameURL { get; set; }
    public Id OppID { get; set; }
    public Id AccID { 
        get{
            if(OppID!=null){
                Opportunity opp = [select AccountId from Opportunity Where Id=: OppID];
                return opp.AccountID;
            }
            return null;
        }
        set;
    }
    public Optydoc(ApexPages.StandardController stdController) {
        OppID = stdController.getRecord().Id;
        try{
         iframeURL = CustomSetting__c.getInstance('JavaApplication').endPointURL__c;   
             System.debug('Exceptionrwrr'+iframeURL);
         
        }catch(Exception e){
             System.debug('Exception'+e);
             
        }        
    }
not able to migrate my javascript button in lightning experience. please help me to convert the below button. I am new to Lightning. current onclick javascript action: window.location.href ='/apex/RequestType?&id={!Opportunity.Id}';
hi all,

I urgently need to edit/delete a post made by me on this discussion forum...But its not allowing me to do so and pops up
saying that 'you cant delete this question as others are interested in it'.
There are no likes and no comments on it still i am unable  to delete it
Any help would be highly appreciated

Its very urgent,
Thanks,