• nitin sharma 356
  • NEWBIE
  • 0 Points
  • Member since 2019

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 5
    Replies
Im new to APEX and i have a trigger that is suppose to calculate a total score using 6 fields.  If any of the data in those 6 fields gets updated I want the Trigger to recalcuate the score.  But my current code is not updating.  I have two issues

1) After I deployed the code the APEX trigger didnt do the calculation.  Why is this? 
2) After I made a change to one of the 6 data points the Trigger still didnt execute.  Why is this?

Could someone help look at the code I have and provide some recommeneded changes.  (just note I am new so some of the terms I may not understand if you would make any code changes can you show me the before and after change).  

trigger Health_Score_Calculation_New on Account (before insert) {
  if(Trigger.isBefore)
  {
    if (Trigger.isInsert || Trigger.isUpdate)
     {
       for(Account cob : trigger.new)

         {
             if(cob.Days_With_No_Activity__c!=null){
            //   cob.Days_With_No_Activity__c= 100 ;
             
             
            cob.Score__c = (cob.Implementation__c * 0.15) + 
                           (cob.Migration_In_Progress__c * 0.20) + 
                           (cob.Days_With_No_Activity__c * 0.15) + 
                           (cob.Contact_New2__c * 0.15) + 
                           (cob.Contact_Left2__c * 0.15) + 
                           (cob.Issues__c * 0.20) ;
                           }
           }
       }
    }
}
We need a trigger on the asset object on update to check all assets.

 If on ALL Assets belonging to product family = "360 Suite" had their  Status = "Canceled" , then on Account, update the 360 Account stage (API Name = Account_Status__c )  to "Cancel".

please if anyone can help with this one I would be so grateful
I am working on a Flow in Salesforce.  The flow worked perfectly in the Sandbox, but it is failing in Production.  I’m afraid I don’t understand the error it is giving me “Too many SOQL queries: 101”.  I’m not running SQL queries, I’m trying to run a flow.  I have run the flow a few times and get the same error each time.  I checked to make sure I am not running at the same time another task is running, so I am certain it is not because too many things are running at once.  Granted, the flow picked up a lot more records in Production than it did in my sandbox, but I don’t understand why that would be a problem.  The flow has been run as an administrator and a non-administrator.  I checked and there is a workflow rule involving some of the same fields that are in the Flow.  Could that be the problem?  If it could be, I don’t understand why the flow did not fail in the Sandbox (it has the same rules).  Something else that I noticed while working with these flows, is that in the Sandbox I now have Flow Builder and in Production I still have Cloud Flow Designer.  I don’t know if that has anything to do with the issues or not.   If it could, could you let me know what I need to do to get the Flow Builder in Production?  I do have two loops in my flow because there are two objects that need to be updated by flow and I don't know how else to accomplish this.  Any assistance you can provide would be greatly appreciated. 

 
Hello. I have tried to source more information on this task but have been unsuccessful.  In addition, the information I have found relates to the old version of Flow.  Please note my experience level of Flows is beginner!

I have created a Flow which is triggered via a Process Builder for when a new User record is created, a specific Permission Set is allocated to that User.  However I want to extend that Flow so that if a new User record is created and they have a custom checkbox field checked, then 3 specific Permission Sets are added to that User record.  Once this is done, a new custom resource record should be automatically created and populated with some information from the User record.  Is this possible and if so, please could someone provide guidance?

Many thanks in advance.