• Monotosth Sah
  • NEWBIE
  • 0 Points
  • Member since 2022

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 3
    Replies

Hello All, 

I'm trying to create a formula field (Yearly Compliance) for a custom object named Compliance. The formula should add the compliance for the quarter (i.e. Q1_c__c), if not left blankand, and divide those by the number of complete fields. I'm trying to calculate the percent of compliance. The problem is that any of those four number fields could be left on black.

I tried the following formulas in where any of the Qs (i.e. Q1_c__c)  could be a number or could be left blank.

IF( 
AND 
   (Q1_c__c =0, 
    Q1_c__c = 0, 
    Q1_c__c = 0, 
   Q1_c__c = 0
    ),
    0, 
(Q1_c__c + Q2_c__c + Q3_c__c + Q4_c__c)/4)

 

IF(

AND(
ISBLANK(Q1_c__c),
ISBLANK(Q2_c__c),
ISBLANK(Q3_c__c),
ISBLANK(Q4_c__c)
),
NULL,(Q1_c__c + Q2_c__c + Q3_c__c + Q4_c__c)/4)

Here is a picture of the pay layout . 

  • If the quarter is left black, means that do not apply.
  • I'm trying to calculate the percent of Yearly Compliance. Here the Yearly Compliance should be 100% divided by 3. This is because the quarter empty (Q1) do not count for this year compliance. Also, the other two quarters are in 0%. 


Example
 

Yearly compliance should be 33.33%
Hello team,

after delete the record table in not refresh please help me regarding this.

below is my vf code
===================

     <div class="slds-col" style="margin-top:10px;">
                    <p style="font-weight:600; padding:10px;">Distributor / Retailer List</p>
                </div>
            </div>
           
            <div style="border:1px solid #ccc; margin-top:0px;" class="slds-scrollable_x"  >
                 <apex:outputPanel id="TablePanel">
                    <table class="slds-table slds-table_cell-buffer slds-table_bordered slds-table_col-bordered slds-table_striped">
                        <thead>
                            <tr class="slds-line-height_reset">
                                <th class="" scope="col">
                                    <div class="slds-truncate" title="">Account Name</div>
                                </th>
                                <th class="" scope="col">
                                    <div class="slds-truncate" title="">SF Customer Code</div>
                                </th>
                                <th class="" scope="col">
                                    <div class="slds-truncate" title="">SAP Customer Code</div>
                                </th>
                                <th class="" scope="col">
                                    <div class="slds-truncate" title="">Action</div>
                                </th>
                                
                            </tr>
                        </thead>
                        <tbody>
                           
                            <apex:repeat value="{!membs}" var="awl" >
                            <tr class="slds-hint-parent">
                                <th scope="row">
                                    <div class="slds-form-element__control">{!awl.Account__r.Name}</div>
                                </th>
                                <td data-label="" class="fromvalue">
                                    <div class="slds-form-element__control">{!awl.Account__r.SF_Customer_Code__c}</div>
                                </td>
                                <td data-label="" class="fromvalue">
                                    <div class="slds-form-element__control">{!awl.Account__r.SAP_Customer_Code__c}</div>
                                </td>
                               
                                <td data-label="">
                                     <apex:commandLink styleClass="slds-button slds-button_destructive"  value="Delete" action="{!showassigndel}" reRender="TablePanel" onclick="if(!confirm('Are you sure?')) return false;"  >
                                       <apex:param name="schemeId" value="{!awl.id}" assignTo="{!showdelId}"/>
                                    </apex:commandLink>
                                </td>
                            </tr>
                            </apex:repeat>
                                
                        </tbody>
                        
                        <tbody>
                            <apex:repeat value="{!searchList }" var="swl" >
                                <tr class="slds-hint-parent">
                                    <th scope="row">
                                        <div class="slds-form-element__control">{!swl.Account__r.Name}</div>
                                    </th>
                                    <td data-label="" class="fromvalue">
                                        <div class="slds-form-element__control">{!swl.Account__r.SF_Customer_Code__c}</div>
                                    </td>
                                    <td data-label="" class="fromvalue">
                                        <div class="slds-form-element__control">{!swl.Account__r.SAP_Customer_Code__c}</div>
                                    </td>
                                    
                                    <td data-label="">
                                        <apex:commandLink styleClass="slds-button slds-button_destructive"  value="Delete" action="{!Remove}" reRender="TablePanel">
                                            <apex:param name="schemeIdParam" value="{!swl.id}" assignTo="{!delId}"/>
                                        </apex:commandLink>
                                        
                                    </td>
                                </tr>
                            </apex:repeat>
                        </tbody>
                    </table>
                </apex:outputPanel>
            </div>

is there any possibility of uploading a video file or directly a video in salesforce sandbox

 

 

Thanks In advance