• Edgar Macachor
  • NEWBIE
  • 10 Points
  • Member since 2021

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 5
    Replies
Hi help guys! I am really new in salesforce and also in Apex. I have to create an Apex Trigger to get the sum of a field. my components are:
Hi help guys! I am really new in salesforce and also in Apex. I have to create an Apex Trigger to get the sum of a field. my components are:
1.  Price - custom object
The fields of Price are:
  • Discount Line (currency field type)
  • Discount Price (currency field type)
2. Products - custom object
3. Sale - custom object
The fields of Sale are:
  • Status (Picklist: Draft, For Approval, Active)
  • Min Sale Amount (currency)
  • Min Sale Quantity (number)
  • Discount Sale (currency)
Record type for Sale:
  • Row Stage
  • Column Stage
Both Products and Sale has data imported to each object it contains the Product 
So the instruction is to get the sum for Discount Line and Discount Price. The formula is:
Discount Line = ​​​​​​Sum of ACTIVE applied discounts for Column Stage Sale
Discount Price= 
Sum of ACTIVE applied discounts for Row Stage Sale
Both custom object has no relationship to each other. The event is before insert, before update. Please help me guys. Ask me for clarifications. Thank you.

​​​​​​​
HI guys help!! I have to create a validation rule that the Contact Lookup should be under the same Account and now I have created a formula but I think it doesn't work right.
So here's my code:
AND( CreatedBy.Contact.AccountId = Contact__c,
     Account__r.Id  = Account__c,
     Account__r.Id <> CreatedBy.Contact.AccountId)


Can you help me find what is wrong about my formula.
Hi help guys! I am really new in salesforce and also in Apex. I have to create an Apex Trigger to get the sum of a field. my components are:
Hi help guys! I am really new in salesforce and also in Apex. I have to create an Apex Trigger to get the sum of a field. my components are:
1.  Price - custom object
The fields of Price are:
  • Discount Line (currency field type)
  • Discount Price (currency field type)
2. Products - custom object
3. Sale - custom object
The fields of Sale are:
  • Status (Picklist: Draft, For Approval, Active)
  • Min Sale Amount (currency)
  • Min Sale Quantity (number)
  • Discount Sale (currency)
Record type for Sale:
  • Row Stage
  • Column Stage
Both Products and Sale has data imported to each object it contains the Product 
So the instruction is to get the sum for Discount Line and Discount Price. The formula is:
Discount Line = ​​​​​​Sum of ACTIVE applied discounts for Column Stage Sale
Discount Price= 
Sum of ACTIVE applied discounts for Row Stage Sale
Both custom object has no relationship to each other. The event is before insert, before update. Please help me guys. Ask me for clarifications. Thank you.

​​​​​​​
HI guys help!! I have to create a validation rule that the Contact Lookup should be under the same Account and now I have created a formula but I think it doesn't work right.
So here's my code:
AND( CreatedBy.Contact.AccountId = Contact__c,
     Account__r.Id  = Account__c,
     Account__r.Id <> CreatedBy.Contact.AccountId)


Can you help me find what is wrong about my formula.