• JaneJLocane
  • 0 Points
  • Member since 2022

  • Chatter
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
  • 7
Please help me in writing a test class for a trigger helper class for below code:-
public class DiscountTriggerHelper {
    public static void beforeTrigApplyDiscount(List<Discount__c> discounts){
        for(Discount__c disc : discounts){
            If(disc.Discount_Applied__c == false && disc.Amount__c >= 100){
                disc.Amount__c = disc.Amount__c + 10;
                disc.Discount_Applied__c = true;
Create trigger handler on System

new record created When status includes mandatory  email

map contact__r.email primary email

Record is deleted when status includes mandatory Email

contact__r.email removed from primary email

We are using field service and wanted to know if OOTB the actual travel time of an Resource from one Service appointment to other is calculated.

  • June 24, 2021
  • Like
  • 0
I am not a coder and am looking to write test coverage for this simple trigger:
trigger ConDoc on ContentVersion (after insert) {

    List<ContentVersion> conver = [SELECT Id, Title, OwnerId FROM ContentVersion WHERE Id IN: Trigger.newMap.keySet()];

    for (ContentVersion CV: conver){
        CV.OwnerId= '005F0000002QTR2IAO';
        CV.Title = 'HannaTest';

    update conver;

Right now this is where I am at, I have no idea what I am doing. I appreciate any help. Im getting an Insert Failed when I run the Test
@isTest public class Test_ConDocTrigger {
static testMethod void TestData(){
    ContentVersion CV = new ContentVersion();       
	CV.OwnerId = '005F0000002QTR2IAO';
	CV.Title ='Test Name';
    insert CV;

Hello everyone,

The SalesForce REST API doc is unclear about the usage of APIs to insert and update records in OpportunityLineItem. The standard fields in OLI include OpportunityId and Product2Id both of which I'm populating by retrieving the appropriate SalesForce IDs. I receive this error: INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY when I try to insert a record at this URI: /sobjects/OpportunityLineItem/.

Going through the flow: https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_erd_products.htm#topic-title, I'm assuming this (and also the cross-reference error) means that there is no direct relationship between OLI and Products.

Firstly, why is there a Product2Id field if the relationship doesn't exist?
Secondly, is the URI I'm using incorrect? If so, what is the correct one?
Thirdly, can this problem be solved using APIs at all?

Maybe I'm going about this in a completely inefficient manner. Any suggestions would be greatly appreciated.

I just passed the Advanced Developer 501 Certification Exam, now I'm waiting for the assignment stage and the essay stage.


Has anyone else passed the 501 exam in the last few months? How long did you have to wait for the second stage?


I've asked a few folks I know in the community and they are stillwaiting for the second stage and its been almost 1 year for one of them, 4 months for another guy......


Anyone have any idea? I sent a message to certification@salesforce.com, but I haven't gotten a response yet.....