• Mark Shleby
  • 0 Points
  • Member since 2023

  • Chatter
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
  • 2
Hi I am new in salesforce. I am trying to learn about triggers and update mu student fees in my custom project. My code is not giving any errors but also it is not update the Student_Payment__c. Can someone help me about this situation my code is like that.. 

trigger StudentFeeCalculation on Student_Record__c (before insert, after insert, after update, before update) {
    Decimal ScholarFee = 0;
    Fees__c newFees = new Fees__c();
    Student_Record__c Std = new Student_Record__c();
    //Calculating the sport scholarship of students
            if(Std.Scholarship__c == 'Sport Scholarship')
             // For computer engineering students
             if ( Std.Department__c == 'Computer Engineering')
                     List<Fees__c> SFee = new List<Fees__c>(); 
                    SFee =  [SELECT Fees__c.Department_Fees__c FROM Fees__c WHERE Fees__c.Name = 'Computer Engineering Fees'];
                     List<Student_Record__c> StdPayment = new List<Student_Record__c>();
                    StdPayment = [SELECT Student_Record__c.Student_Payment__c FROM Student_Record__c];
                 //Update fees for every student    
                 for(Student_Record__c stdPay: StdPayment)
                             ScholarFee = Integer.valueOf(SFee);
                             ScholarFee = ScholarFee * (25/100);                              
                             update StdPayment;

I have one requirement in which i want to push data from wordpress page to salesforce object.

In Example,

I have one registration page in wordpress and when i hit save, the data of registration form needs to be save as salesforce custom object record.

Is it possible to achieve ?