• Geoffrey Hills
  • NEWBIE
  • 0 Points
  • Member since 2022

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 9
    Replies
Order Detail Page:
<apex:page standardController="Order" action="{!details}" extensions="OrderClass" lightningStylesheets="true">
    
  <apex:form >
     <script>
        function fun(){
            EditProject();
      }
    </script>
    <apex:pageBlock rendered="{!ShowpageDetailPage}">
            <apex:pageBlockSection title="Order Record Information" columns="2" >
                <apex:outputField value="{!Order.Name}"/>
                <apex:outputField value="{!Order.OrderNumber}"/>
                <apex:outputField value="{!Order.AccountId}"/>
                <apex:outputField value="{!Order.OpportunityId}"/>
                <apex:outputField value="{!Order.Type}"/>
                <apex:outputField value="{!Order.CurrencyIsoCode}"/>
                <apex:outputField value="{!Order.CompanyAuthorizedById}"/>
                <apex:outputField value="{!Order.CustomerAuthorizedDate}"/>
                <apex:outputField value="{!Order.ShipToContactId}"/>
                <apex:outputField value="{!Order.Project_Start_Date__c}"/>
                <apex:outputField value="{!Order.Project_End_Date__c}"/>
                <apex:outputField value="{!Order.Activated__c}"/>
                <apex:outputField value="{!Order.Invoice_Date__c}"/>
                <apex:outputField value="{!Order.TotalAmount}"/>
                <apex:outputField value="{!Order.Close_Date__c}"/>
                <apex:outputField value="{!Order.Description}"/>                  
            </apex:pageBlockSection>  
        <apex:pageBlockButtons >
                <apex:commandButton value="Edit"  action="{!ShowBlockMethod}"/>
            </apex:pageBlockButtons>                  
    </apex:pageBlock>
  </apex:form> 
    
    <apex:form >
    <apex:pageBlock rendered="{!ShowpageEditPage}">
            <apex:pageBlockSection title="Order Record Information" columns="2" >
                <apex:inputField value="{!Order.Name}"/>
                <apex:inputField value="{!Order.OrderNumber}"/>
                <apex:inputField value="{!Order.AccountId}"/>
                <apex:inputField value="{!Order.OpportunityId}"/>
                <apex:inputField value="{!Order.Type}"/>
                <apex:inputField value="{!Order.CurrencyIsoCode}"/>
                <apex:inputField value="{!Order.CompanyAuthorizedById}"/>
                <apex:inputField value="{!Order.CustomerAuthorizedDate}"/>
                <apex:inputField value="{!Order.ShipToContactId}"/>
                <apex:inputField value="{!Order.Project_Start_Date__c}"/>
                <apex:inputField value="{!Order.Project_End_Date__c}"/>
                <apex:inputField value="{!Order.Activated__c}"/>
                <apex:inputField value="{!Order.Invoice_Date__c}"/>
                <apex:inputField value="{!Order.TotalAmount}"/>
                <apex:inputField value="{!Order.Close_Date__c}"/>
                <apex:inputField value="{!Order.Description}"/>                  
            </apex:pageBlockSection>  
        <apex:pageBlockButtons >
                <apex:commandButton value="Save"  action="{!Save}"/>
            </apex:pageBlockButtons>                  
    </apex:pageBlock>
  </apex:form> 
     <apex:form >
    <apex:pageBlock >  
        <apex:actionFunction action="{!recEdit}" Name="EditProject" immediate="true"></apex:actionFunction>
        <apex:pageBlockTable title="Releted Record" value="{!releted}" var="r"> 
              <apex:column >
                <apex:outputLink value="/apex/ProjectDetailPage?id={!r.id}">Del | </apex:outputLink>            
                <apex:outputLink onclick="fun();" value="/apex/ProjectDetailPage?id={!r.id}" >Edit | </apex:outputLink>     
             </apex:column> 
            <apex:column >
                 <apex:outputLink value="/apex/ProjectDetailPage?id={!r.id}"> {!r.name}</apex:outputLink>
             </apex:column> 
             <apex:column value="{!r.Start__c}"/>
            <apex:column value="{!r.End__c}"/>
            <apex:column value="{!r.Status__c}"/>
            <apex:column value="{!r.Project_Amount__c}"/>
            <apex:column value="{!r.Total_Cost__c}"/>            
        </apex:pageBlockTable>               
    </apex:pageBlock>
       </apex:form>     
</apex:page>
Related Object VF page
<apex:page controller="ProjectClass" action="{!getProject}" lightningStylesheets="true">
  <apex:form >  
       <apex:pageBlock rendered="true" >              
            <apex:pageBlockSection title=" Project Information" columns="2" >                
                <apex:outputField value="{!pr.Name}"/>
                <apex:outputField value="{!pr.Order__c}"/>
                <apex:outputField value="{!pr.Start__c}"/>
                <apex:outputField value="{!pr.End__c}"/>
                <apex:outputField value="{!pr.Status__c}"/>
                <apex:outputField value="{!pr.Project_Amount__c}"/>
                <apex:outputField value="{!pr.Total_Cost__c}"/>             
            </apex:pageBlockSection>
       </apex:pageBlock>
  </apex:form>     
      <apex:form >  
    <apex:pageBlock rendered="isEditable">           
            <apex:pageBlockSection title=" Project Information" columns="2" >                
                <apex:inputField value="{!pr.Name}"/>
                <apex:inputField value="{!pr.Order__c}"/>
                <apex:inputField value="{!pr.Start__c}"/>
                <apex:inputField value="{!pr.End__c}"/>
                <apex:inputField value="{!pr.Status__c}"/>
                <apex:inputField value="{!pr.Project_Amount__c}"/>
                <apex:inputField value="{!pr.Total_Cost__c}"/>             
            </apex:pageBlockSection>
         <apex:pageBlockButtons >
                <apex:commandButton value="Save"  action="{!Save}"/>
            </apex:pageBlockButtons>
    </apex:pageBlock> 
  </apex:form>
   </apex:page>
public with sharing class OrderClass {
   public Order orderRecord { get; set; }
    public Boolean ShowpageEditPage {get; set;}
    public Boolean ShowpageDetailPage {get; set;}
    Public List<Cus_Project__c> releted{get;set;}
    public OrderClass (ApexPages.StandardController controller) {
        ShowpageEditPage=false;
        ShowpageDetailPage=true;    
     }     
      Public void ShowBlockMethod(){
       ShowpageEditPage =true;
      ShowpageDetailPage= false;
    }        
        Public void details(){                      // Use for Show Releted  Record  on Detailpage       
       
        releted=[Select Id, name, Order__c,Start__c, End__c,Project_Amount__c, Total_Cost__c,Status__c
                 from Cus_Project__c where Order__c =:ApexPages.currentPage().getParameters().get('id')];
    } 
}
public with sharing class ProjectClass {
    
     public List<Cus_Project__c> proj{get;set;}//show Order Data 
        Public Cus_Project__c pr{get;set;}
     Public Boolean isEditable {get;set;}
    
     Public ProjectClass(){
         isEditable= false;
     }   
    
     Public void getProject(){
        pr=[Select Id, name,Order__c,Start__c, End__c,Project_Amount__c, Total_Cost__c,Status__c
                 from Cus_Project__c where id =:ApexPages.currentPage().getParameters().get('id')];       
    }
     public PageReference Save(){
            update pr;
            PageReference pnext = new PageReference('/apex/ProjectDetailPage?id='+pr.id);
            pnext.setRedirect(true);
            return pnext;
    }    
    Public void recEdit(){
        isEditable= true;
    }
}
  • May 28, 2022
  • Like
  • 0
Hi Everyone
I disconnected my playground by mistake can I create a new playground and continue my admin super badge. I have completed two questions already or how can I reconnect it please?
Many thanks
Hi,

we have custom content block which we wish to list it in AppExchange. But how to upload the package in partner portal to publish it, We know how to upload the salesforce platform package but in marketing cloud we dont know how to do it, We gone through lot of documentaion but we didn't understand it, please guide us through.

Thank you
Hi Everyone.
I have developed Custom Listview In LWC, where users can fetch record based on listview. 
I need to create button, where button allows user to CREATE NEW LISTVIEW same as like standard one. Here criteria required with three fields Ex: Recordtype equals to somevalue. After saving, created LIstView should save in Listviews.
How can I achieve this. 

Thanks 
Hi,
Here is my script written in anonymous window to create record against opportuniyt for 3 month jan,feb,march but its not working please help me to solve




Map <Id, Opportunity> oppItems = new Map <Id, Opportunity>();
        
    list<ARRCalcualateOpportunity__c> Arropplist= new list<ARRCalcualateOpportunity__c>();
        list<Opportunity> opplist= new list<Opportunity>();
        
    for(opportunity opp:opplist){
       if (opp.StageName == 'Closed Won'&& opp.closeDate.month() >=1 && opp.closeDate.month() <=3 ) 
        {
          oppItems.put(opp.Id, opp);
        }
    }
    
    List<OpportunityLineItem> oliList = [select Id, Name, Product2Id, Product2.Family,opportunity.amount,opportunity.closedate from 
                                         OpportunityLineItem where OpportunityId IN:oppItems.keyset()];
        
        system.debug('oli'+ oliList);
        for(OpportunityLineItem oli :oliList)
        {
             for(Integer i =1;i<=12;i++)
                     {
                         if(oli.product2.family == 'software Recurring')
            {
              ARRCalcualateOpportunity__c arrOpp = new ARRCalcualateOpportunity__c();
             
                 arropp.name=string.valueOf(oli.opportunity.closedate);
                arropp.OpportunityArr__c= oli.OpportunityId;      
                arrOpp.Opportunity_Product__c= oli.product2Id;
                system.debug('arropp'+arropp);
              Arropplist.add(arropp);
            }
        }
        }
        
        if(Arropplist.size() >0){
          insert Arropplist;
            System.debug('arropp list'+arropplist);
        }
    
             


            
                 

                    
                    
I want to restrict a field to show only one recordtype record by trigger.
Challenge Not yet complete... here's what's wrong:
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: PQVIPAVM
Hi,

Is there any way to  find out  the history of permission sets assigned to a user?

Hello, Good afternoon.

anyone cound help me please. My code is below

public class Tsuchisho_Name {
    public Lead ld {get; set;}
    
     public Tsuchisho_Name(ApexPages.StandardController stdController){
        ld = new Lead();
        ld = (Lead)stdController.getRecord();
        
        ld = [SELECT Id, Name FROM Lead LIMIT 1];
        
        String pdfName = ld.Name + '.pdf';
        Apexpages.currentPage().getHeaders().put( 'content-disposition', 'inline; filename=' + pdfName);
        
    }

}
 

and TestClass is 
 

@isTest
public class TsuchishoNameTest {
    @isTest
    static void Tsuchisho_Name(){
        
        Lead l = new Lead();
        l.FirstName = 'leadname';
        l.LastName = 'lastName';
        l.AnnualIncomePresentationAmount__c = 1000;
        l.DateOfAcceptance__c = system.today();
        l.Notice_Date__c = system.today();
        l.Company = 'next';
        
        insert l;
        
        ApexPages.StandardController stdController = new ApexPages.StandardController(new Lead());
        Tsuchisho_Name tsuchi = new Tsuchisho_Name(stdController);
        
        Test.startTest();
        
        tsuchi.ld = l;   
        Lead led = tsuchi.ld;
        String Name = led.Name;
        
        Test.stopTest();
    }

}

With regards Rai

Thank you