• Horst Schuster
  • 0 Points
  • Member since 2016

  • Chatter
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
  • 1
i have create an custom button to change (calculate) Values in my own object. It seems a very good solution, but "overnight" the calculated values are not updated in the formula. What can be the reason for this problem. Have i changed a special flag anywhere in Salesforce which prevented the correct functionality?


var aw = confirm ("Wollen Sie die Anpassung von Schwellenwert und \nHöchstbetrag jetzt vornehmen?")

if (aw == true) {

var qr = sforce.connection.query("SELECT Inflationsfaktor__c FROM Inflationsrate__c WHERE Name = '{!Rueckzahlungsjahr__c.Inflationszeitraum__c}'");

var qr2 = sforce.connection.query("SELECT Schwellenwert_exkl_Inflation__c, Jaehrlicher_Hoechstbetrag__c FROM Contract WHERE ContractNumber = '{!Rueckzahlungsjahr__c.Vertrag__c}'");

var records = qr.getArray("records");
var records2 = qr2.getArray("records");

var tempOb = new sforce.SObject("Rueckzahlungsjahr__c");
tempOb.Id = "{!Rueckzahlungsjahr__c.Id}";

//Schwellenwert infaltionieren
tempOb.tempSchwellenwert__c = records[0].Inflationsfaktor__c * records2[0].Schwellenwert_exkl_Inflation__c;

//Jährlichen Höchstbetrag inflationieren
//alert (records2[0].Jaehrlicher_Hoechstbetrag__c)
tempOb.Jaehrlicher_Hoechstbetrag__c = records[0].Inflationsfaktor__c * records2[0].Jaehrlicher_Hoechstbetrag__c;

//Flag setzen das Inflationierung erfolgt ist
tempOb.Schwellenwert_aktualisiert__c = true;

alert("Faktor: " + qr.records.Inflationsfaktor__c + " * " + "Basis-Schwellenwert: " + qr2.records.Schwellenwert_exkl_Inflation__c + " = " + tempOb.tempSchwellenwert__c + " EUR")


I am trying to put together a formula field that will calculate a number based on the population of other fields. 
If a status field is equal to "available" and the a custom field called Role is populated with "Student Mentor" and then a Individual Goal Override is greater not equal to null, I need to subtract  another field (active students) from the individual goal override field.

However, if the status field is equal to "available" and the a custom field Role is populated with "Student Mentor" and then a individual Goal Override is null, I need to subtract Active Students from another field called Goal Load. if it doesn't meet these requirements, then it need to just show "0"

Can someone help me with this? Here is what I have done and it doesn't seem to work.

CASE( ISPICKVAL(Status__c, "AVAILABLE") && ISPICKVAL( Role__c , "Student Mentor") && IndividualMentorGoalOverride__c >0, IndividualMentorGoalOverride__c-ActiveStudents__c, ISPICKVAL(MentorStatus__c, "AVAILABLE") && ISPICKVAL( MentorRole__c , "Student Mentor") && IndividualMentorGoalOverride__c =0, MentorCollege__r.MentorGoalLoad__c - ActiveStudents__c,0)