• Zeeshan Moulvi 2
  • NEWBIE
  • 10 Points
  • Member since 2015
  • Senior Technical Analyst
  • Continuserve Soft Tech

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 7
    Questions
  • 2
    Replies
Hi Team,

We are trying to implement a validation on Quote Page by using the below formula. 

IF (Service_Total_Net_Price_c _< 0 and ABSOLUTEVALUE Service_Total_Net_Pricec _ > ABSOLUTEVALUE _Total_Service_Margin_c )

Here is the Trigger which I have created but I'm getting an error while trying to save the trigger, Can anyone please take a look and let me know what is the issue.

trigger CustomQuoteValidation on SBQQ__Quote__c (before insert) {
for (SBQQ__Quote__c a : Trigger.new) {
  if (a.Service_Total_Net_Price__c < 0 && (MATH.ABS(a.Service_Total_Net_Price__c > a.Total_Service_Margin__c ) )) {
    a.addError('Your custom error message');
  }
}
}


Thanks,
Zeeshan.
Hi Team,

I have created a Visualforce Section and added to fields.
When i added Save and cancell button and trying to save/cancel the record the entire page is geting loaded in section.

1. Can anyone help how can add the save and cancell functionality in apex code so only the selected section is refreshed.
2. Once the section is loaded the Inputfields should be like Inline edit instead.

Thanks in Advance. 
Visualforce Page:

<apex:page standardController="Opportunity" extensions="Repack">
    
    
    
<apex:form >
<apex:pageBlock mode="maindetail" id="this">
    
    <div align="center" draggable="false" >
        <apex:commandButton value="Save" action="{!Save}" />
        <apex:commandButton value="Cancel" action="{!Cancel}" reRender="this" />
    </div>
    
        <apex:pageBlockSection columns="2" id="Test" >
              <apex:inputcheckbox value="{!Opportunity.Repack__c}" >
                    <apex:actionSupport event="onchange"  action="{!aaa}" rendered="{!bool}" />
              </apex:inputcheckbox>
                  <apex:inputField value="{!Opportunity.Repack_Class__c}" rendered="{!(Opportunity.Repack__c)}"/>
                  <apex:inputField value="{!Opportunity.Repack_Transition_Phase__c}"  rendered="{!(Opportunity.Repack__c)}"/>
        </apex:pageBlockSection>
   
        <apex:pageBlockSection columns="2" id="Test1" > 
              <apex:inputcheckbox value="{!Opportunity.VPOL__c}" > 
                  <apex:actionSupport event="onchange" action="{!bbb}" rendered="{!bool}" />
              </apex:inputcheckbox>    
        </apex:pageBlockSection>

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


Apex Code:
public with sharing class Repack{

    public boolean Repack {get;set;}
    public boolean VPOL{get;set;}
    public boolean bool{get;set;}
    public Opportunity test{get;set;}
    public Opportunity test1{get;set;}

    public Repack(ApexPages.StandardController stdCtrl){   
        this.test=(Opportunity)stdCtrl.getRecord();
        this.test1=(Opportunity)stdCtrl.getRecord(); 
        
        Repack =TRUE;       
        VPOL = TRUE;
        bool = TRUE;
        //this.test=true;//observe the change in this line.Added this for proper behaviour on load 
    }
       
    public pagereference aaa(){
    if(test.Repack__c == true){
        test1.VPOL__c = False;
        bool = TRUE;
    }else{
        bool = FALSE;
    }
    return null;
    }

    public pagereference bbb(){
    if(test1.VPOL__c == true){
        test.Repack__c = false;
        test.Repack_Class__c = Null;
        test.Repack_Transition_Phase__c= Null;
        bool = True;
     }else{
        bool = False;
     }
     return null;
    }
    public PageReference save() {
    return null;
}
   
}

User-added image

We have requirement where in we need to display fields based on the checkbox selected .I have written a VF page and Apex classe but still not able to acieve the requirement below are the few points i am trying to achieve.
1. When first checkbox is selected second checkbox should be hidden and viceversa.
2. Also we need to clear the values from the  dependent fields in the pageblock section on unchecked box.

Any lead or steps to achieve this is very hepfull.

Thanks in Advance.
Visualforce Page:


<apex:page standardController="Opportunity" extensions="rpac">

<apex:form >
<apex:pageBlock >
  <apex:pageBlockSection columns="1" id="Test" >
 <apex:inputcheckbox value="{!Opportunity.abc__c}" >
 <apex:actionSupport event="onchange"  action="{!aaa}" rerender="Test" />
</apex:inputcheckbox>
  <!--<apex:outputPanel rendered="{!(Opportunity.abc__c)}" > -->
		<apex:inputField value="{!Opportunity.abc__c}"  rendered="{!(Opportunity.abc__c)}" />
        <apex:inputField value="{!Opportunity.abc_Class__c}" rendered="{!(Opportunity.abc__c)}" />
        <apex:inputField value="{!Opportunity.abc_Transition_Phase__c}" rendered="{!(Opportunity.abc__c)}" />
   </apex:pageBlockSection>
   
   <apex:pageBlockSection columns="1" id="Test1" > 
     <apex:inputcheckbox value="{!Opportunity.xyz__c}" > <!--removed selected=true label="Same as Above" -->
     <apex:actionSupport event="onchange" action="{!bbb}" rerender="Test1" />
     </apex:inputcheckbox>    
        <apex:inputField value="{!Opportunity.ayz_Payment_Terms__c}" rendered="{!(Opportunity.xyz__c)}" />
        <apex:inputField value="{!Opportunity.xyz_Record_Delete__c}" rendered="{!(Opportunity.xyz__c)}" />
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>


Apex class:

public with sharing class Repack{

    public Opportunity test{get;set;}
    public Opportunity test1{get;set;}
    public boolean abc {get;set;}
    public boolean ayz{get;set;}

        public Repack(ApexPages.StandardController stdCtrl) {
        this.test=(Opportunity)stdCtrl.getRecord();
        abc=False;
        this.test1=(Opportunity)stdCtrl.getRecord();
        ayz= False;
        //this.test=true;//observe the change in this line.Added this for proper behaviour on load 
       }
       
       public pagereference aaa(){
           
           return null;
       }
       public pagereference bbb(){
           
           return null;
       }

   }

User-added image
HI,

We have receecnty updated the community in Sandbox to Winter17 template.
Untill yeterdat everything was working fine , today we are getting an error when ever we are trying to navigate to Community "Login Page" , "Check Password Page".
Please let me know if you have any ide how to debug the error.

User-added image

Thanks,
Zeeshan.
Hi All,

The is no validation to check if you have completed the Trialhead module or not.
Without completing the chalange also we can get the Certificate by just completing the survey on Drucker School of Management site.

Thanks,
Zeeshan.
Hi,

I have a requirement we i need to update the field daily.
Every day when date changes the value from Field 1 should be updated in Field 2  and Field 2 value should be moved to Field 3.
This process should trigger every day.

Object Name: Daily_Check_List__c
Field 1: Todays_Status__c
Field 2: YesterdayStatus__c
Field 3: X2DaysPastStatus__c

Thanks,
Zeeshan.
Hi,

I am working on to prepare the reporting for our internal team purpose.
1. I would like to create a visualforce page that will create 10 new list of records daily.
2. Next day the records should be moved to  yesterdays records and again new records should be created  same like email where older mails are arranged date wise .
3. Once the reords are moved it should send mail notification.

Can i do this in salesforce.

Thanks,
Zeeshan.
Hi Team,

We are trying to implement a validation on Quote Page by using the below formula. 

IF (Service_Total_Net_Price_c _< 0 and ABSOLUTEVALUE Service_Total_Net_Pricec _ > ABSOLUTEVALUE _Total_Service_Margin_c )

Here is the Trigger which I have created but I'm getting an error while trying to save the trigger, Can anyone please take a look and let me know what is the issue.

trigger CustomQuoteValidation on SBQQ__Quote__c (before insert) {
for (SBQQ__Quote__c a : Trigger.new) {
  if (a.Service_Total_Net_Price__c < 0 && (MATH.ABS(a.Service_Total_Net_Price__c > a.Total_Service_Margin__c ) )) {
    a.addError('Your custom error message');
  }
}
}


Thanks,
Zeeshan.

We have requirement where in we need to display fields based on the checkbox selected .I have written a VF page and Apex classe but still not able to acieve the requirement below are the few points i am trying to achieve.
1. When first checkbox is selected second checkbox should be hidden and viceversa.
2. Also we need to clear the values from the  dependent fields in the pageblock section on unchecked box.

Any lead or steps to achieve this is very hepfull.

Thanks in Advance.
Visualforce Page:


<apex:page standardController="Opportunity" extensions="rpac">

<apex:form >
<apex:pageBlock >
  <apex:pageBlockSection columns="1" id="Test" >
 <apex:inputcheckbox value="{!Opportunity.abc__c}" >
 <apex:actionSupport event="onchange"  action="{!aaa}" rerender="Test" />
</apex:inputcheckbox>
  <!--<apex:outputPanel rendered="{!(Opportunity.abc__c)}" > -->
		<apex:inputField value="{!Opportunity.abc__c}"  rendered="{!(Opportunity.abc__c)}" />
        <apex:inputField value="{!Opportunity.abc_Class__c}" rendered="{!(Opportunity.abc__c)}" />
        <apex:inputField value="{!Opportunity.abc_Transition_Phase__c}" rendered="{!(Opportunity.abc__c)}" />
   </apex:pageBlockSection>
   
   <apex:pageBlockSection columns="1" id="Test1" > 
     <apex:inputcheckbox value="{!Opportunity.xyz__c}" > <!--removed selected=true label="Same as Above" -->
     <apex:actionSupport event="onchange" action="{!bbb}" rerender="Test1" />
     </apex:inputcheckbox>    
        <apex:inputField value="{!Opportunity.ayz_Payment_Terms__c}" rendered="{!(Opportunity.xyz__c)}" />
        <apex:inputField value="{!Opportunity.xyz_Record_Delete__c}" rendered="{!(Opportunity.xyz__c)}" />
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>


Apex class:

public with sharing class Repack{

    public Opportunity test{get;set;}
    public Opportunity test1{get;set;}
    public boolean abc {get;set;}
    public boolean ayz{get;set;}

        public Repack(ApexPages.StandardController stdCtrl) {
        this.test=(Opportunity)stdCtrl.getRecord();
        abc=False;
        this.test1=(Opportunity)stdCtrl.getRecord();
        ayz= False;
        //this.test=true;//observe the change in this line.Added this for proper behaviour on load 
       }
       
       public pagereference aaa(){
           
           return null;
       }
       public pagereference bbb(){
           
           return null;
       }

   }

User-added image