• salesforce study
  • NEWBIE
  • 0 Points
  • Member since 2012

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

Trigger updateamount on Fund_Transfer__c (before update) {
    Fund_Transfer__c[] transfer;
    Fund_Transfer__c fund = Trigger.new[0];
    transfer = [SELECT Amount__c,Account_No__c FROM Fund_Transfer__c WHERE Account_No__c =: fund.Account_No__c ];
    if(transfer.size()>0){
        transfer.Amount__c = transfer.Amount__c + fund.Amount__c;
        update transfer;
    }
    else{
        system.debug('sorry transaction stopped');
    }             
}

 

 

please help me to correct this error

hey guys ,

 

              Please tell me why we can't able to update status in approvals process

"System.Trigger.new"   what is mean by this ,whether creating a new trigger or somwthing else

"System.Trigger.new"   what is mean by this ,whether creating a new trigger or somwthing else

Hi All,

 

In my aplliction is having 6 pageBlockSections.Each section is having 8 fileds.

I am facing the problem while clearing the fileds.If the fileds are not under pageBlockSection i can clear the fileds by using java script.

 

ex:

 <script>

   function clearflds()

   {

     document.getElementById('{!$Component.frm.details}').value=null;

   }

 </script>

 

<apex:inputField id="details" value="{!Sea_Foot_Note__c.Issue_Details__c}"/>  

<apex:commandButton value="Cancel" onclick="clearflds()" />

 

But here i am facing the problem how to clear the pageBlockSection inputFields.

 

Ex:

 

One Section  is having 4 fileds.They are one TextArea Field(Issue Details),2 Picklist Fields(Any issues,Clearing Category),and one Date Field(Control Date).By clicking on the New Button i can enter the values.By clicking on the save button i can save the record.By clicking on the cancel button i was unable to clear the fields.

 

My requirement is when i click on the cancel button i have to clear the values of 4 input fileds.These 4 fileds are under pageBlockSection.

 

Plz tell me if any one knows.

My sample code is as follows:

 

<apex:page standardController="Sea_Foot_Note__c" >

 <apex:form id="frm" > 
    <apex:pageBlock>
       <apex:pageBlockSection columns="2" showHeader="true" title="SFN Main Entity">
          <apex:inputField id="issue" value="{!Sea_Foot_Note__c.Any_Issues__c}"/>               
          <apex:inputField id="details" value="{!Sea_Foot_Note__c.Issue_Details__c}"/>            
          <apex:inputField id="cdate" value="{!Sea_Foot_Note__c.Control_Date__c}"/>                       
          <apex:inputField id="category" value="{!Sea_Foot_Note__c.Clearing_Category__c}"/>
        </apex:pageBlockSection>
        <apex:pageBlockButtons>
           <apex:commandButton value="New"/>
           <apex:commandButton value="Cancel" />
        </apex:pageBlockButtons>        
    </apex:pageBlock>         
  </apex:form>
</apex:page>

 

Thanks in advance,

Manu..

  • December 22, 2009
  • Like
  • 0