• Dee Dee Aaron
  • NEWBIE
  • 180 Points
  • Member since 2020

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 23
    Questions
  • 13
    Replies

Hi there.
I have an object called "Work Orders". I have a related object called "Pre-Work Orders".
I want to reference the custom Status field from the Pre-Work order ON the Work Order record.
I don't know how to do this. Because it's a related object, I don't see any way to access it through the formula builder options?
I believe I can create a "related object" formula like so:

WorkOrder__r.Pre_Work_Order__r.Status__c
I keep getting this: 
Error: Field WorkOrder__r does not exist. Check spelling.
I'm unsure of the correct format I need to reference?
Any help would be appricated. Thank you.

Hi there,

I have an Apex trigger, but I will need help to create the test class. Thank you for your help in Advance:

Apex Trigger
trigger FeedCommentUpdatetoNetPlanning on FeedComment (after insert) 
{
    Id profileId = UserInfo.getProfileId();
    String profileName =[Select Id, Name from Profile where Id=:profileId].Name;
    Set<id> SalesEngineeringSet = new Set<Id>();
    List<SALES_ENGINEERING_REQUEST__c> serList = new List<SALES_ENGINEERING_REQUEST__c>();
    for(FeedComment f : Trigger.New)
    {
        if(profileName  == 'GeoLinks Net Planning')
        {
            SalesEngineeringSet.add(f.ParentId);
        }          
    }
    
    if(!SalesEngineeringSet.IsEmpty()){
        for(SALES_ENGINEERING_REQUEST__c ser : [SELECT ID,Status__c FROM SALES_ENGINEERING_REQUEST__c WHERE ID In: SalesEngineeringSet]){
            if(ser.Status__c != 'Approved' && ser.Status__c != 'Unable to Meet Request'){
                ser.Status__c = 'Awaiting Reply from Rep';
                serList.add(ser);
            }
        }
    }
    
    if(!serList.IsEmpty())
        update serList;
}
Hi there,
I am getting a code coverage failure warning. I'm not a developer, so I don't know where I went wrong? Thank you for your help.

1. I created an Apex Trigger and Apex Test Class
2. I attempted to deploy the change set and received:

Error: Code Coverage Failure
Your organization's code coverage is 0%. You need at least 75% coverage to complete this deployment. Also, the following triggers have 0% code coverage. Each trigger must have at least 1% code coverage.

Apex Trigger
trigger FeedCommentUpdatetoNetPlanning on FeedComment (after insert) 
{
    Id profileId = UserInfo.getProfileId();
    String profileName =[Select Id, Name from Profile where Id=:profileId].Name;
    Set<id> SalesEngineeringSet = new Set<Id>();
    List<SALES_ENGINEERING_REQUEST__c> serList = new List<SALES_ENGINEERING_REQUEST__c>();
    for(FeedComment f : Trigger.New)
    {
        if(profileName  == 'GeoLinks Net Planning')
        {
            SalesEngineeringSet.add(f.ParentId);
        }          
    }
    
    if(!SalesEngineeringSet.IsEmpty()){
        for(SALES_ENGINEERING_REQUEST__c ser : [SELECT ID,Status__c FROM SALES_ENGINEERING_REQUEST__c WHERE ID In: SalesEngineeringSet]){
            if(ser.Status__c != 'Approved' && ser.Status__c != 'Unable to Meet Request'){
                ser.Status__c = 'Awaiting Reply from Rep';
                serList.add(ser);
            }
        }
    }
    
    if(!serList.IsEmpty())
        update serList;
}

Test Class
@isTest
public class FeedCommentUpdatetoNetPlanning {
    
    @isTest
    public static void testFeedCommentUpdatetoNetPlanning() {
        
        //Create a User with Profile 'Net Planning Department'
        Id pid = [Select Id FROM Profile WHERE Name = 'Net Planning Department'].Id;
        
        User u = new User();
        u.ProfileId = pid;
        //here fill all the required fields for the User Record
        insert u;
        
        SALES_ENGINEERING_REQUEST__c s = new SALES_ENGINEERING_REQUEST__c();
        s.Status__c = //any Value othe than "Approved" and "Unable to Meet Request"
        //here fill all the required fields for the SALES_ENGINEERING_REQUEST__c Record
        s.Name = 'Test SER 1';
        s.Layer__c = 'Layer 2';
        
        //Since test class runs in the current user mode and in this Trigger lines will be covered only when the    //User has a Profile - 'Net Planning Department' hence we need trigger this event as the new User created with this //Profile
        System.runAs(u) {
            FeedComment f = new FeedComment();
            //here fill all the required fields for FeedCommentRecord
            
            Test.startTest();
            insert f;
            Test.stopTest();
        }
        
        
        SALES_ENGINEERING_REQUEST__c updatedRecord = [SELECT Id,Status__c  FROM SALES_ENGINEERING_REQUEST__c WHERE Id =: s.Id];
        System.assertequals('Approved',updatedRecord.Status__c);
    }
    
}
Hi. With the help of another user on the forum, I was able to use a sample test class. I just don't know how or where to add the required fields?

The two required fields that need to be inserted:
Name (Name) *Standard Text field.
Layer (Layer__c) *This is a picklist. The 2 options are "Layer 2" "Layer 3"

Can you please insert them for me?
*I see another area in the test class that says "insert f". I'm not sure what I need to insert in that spot?

Test class:
@isTest
public class FeedCommentTriggerTest {
    
    @isTest
    public static void testFeedCommentTrigger() {
        
        //Create a User with Profile 'Net Planning Department'
        Id pid = [Select Id FROM Profile WHERE Name = 'Net Planning Department'].Id;
        
        User u = new User();
        u.ProfileId = pid;
        //here fill all the required fields for the User Record
        insert u;
        
        SALES_ENGINEERING_REQUEST__c s = new SALES_ENGINEERING_REQUEST__c();
        s.Status__c = //any Value othe than "Approved" and "Unable to Meet Request"
        //here fill all the required fields for the SALES_ENGINEERING_REQUEST__c Record
        insert s;
        
        //Since test class runs in the current user mode and in this Trigger lines will be covered only when the    //User has a Profile - 'Net Planning Department' hence we need trigger this event as the new User created with this //Profile
        System.runAs(u) {
            FeedComment f = new FeedComment();
            f.ParentId = s.Id;
            //here fill all the required fields for FeedCommentRecord
            
            Test.startTest();
            insert f;
            Test.stopTest();
        }
        
        
        SALES_ENGINEERING_REQUEST__c updatedRecord = [SELECT Id,Status__c  FROM SALES_ENGINEERING_REQUEST__c WHERE Id =: s.Id];
        System.assertequals('Approved',updatedRecord.Status__c);
    }
    
}

Thank you for your help!
Hi. With the help of another user on the forum, I was able to use a sample test class. I just don't know what format is applied when inserting the required fields.

My oringal Apex Trigger: (for reference if needed)
trigger FeedCommentTest on FeedComment (after insert) 
{
    Id profileId = UserInfo.getProfileId();
    String profileName =[Select Id, Name from Profile where Id=:profileId].Name;
    Set<id> SalesEngineeringSet = new Set<Id>();
    List<SALES_ENGINEERING_REQUEST__c> serList = new List<SALES_ENGINEERING_REQUEST__c>();
    for(FeedComment f : Trigger.New)
    {
        if(profileName  == 'Net Planning Department')
        {
            SalesEngineeringSet.add(f.ParentId);
        }          
    }
    
    if(!SalesEngineeringSet.IsEmpty()){
        for(SALES_ENGINEERING_REQUEST__c ser : [SELECT ID,Status__c FROM SALES_ENGINEERING_REQUEST__c WHERE ID In: SalesEngineeringSet]){
            if(ser.Status__c != 'Approved' && ser.Status__c != 'Unable to Meet Request'){
                ser.Status__c = 'Approved';
                serList.add(ser);
            }
        }
    }
    
    if(!serList.IsEmpty())
        update serList;
}

The test class that was created by another member:
@isTest
public class FeedCommentTriggerTest {
    
    @isTest
    public static void testFeedCommentTrigger() {
        
        //Create a User with Profile 'Net Planning Department'
        Id pid = [Select Id FROM Profile WHERE Name = 'Net Planning Department'].Id;
        
        User u = new User();
        u.ProfileId = pid;
        //here fill all the required fields for the User Record
        insert u;
        
        SALES_ENGINEERING_REQUEST__c s = new SALES_ENGINEERING_REQUEST__c();
        s.Status__c = //any Value othe than "Approved" and "Unable to Meet Request"
        //here fill all the required fields for the SALES_ENGINEERING_REQUEST__c Record
        insert s;
        
        //Since test class runs in the current user mode and in this Trigger lines will be covered only when the    //User has a Profile - 'Net Planning Department' hence we need trigger this event as the new User created with this //Profile
        System.runAs(u) {
            FeedComment f = new FeedComment();
            f.ParentId = s.Id;
            //here fill all the required fields for FeedCommentRecord
            
            Test.startTest();
            insert f;
            Test.stopTest();
        }
        
        
        SALES_ENGINEERING_REQUEST__c updatedRecord = [SELECT Id,Status__c  FROM SALES_ENGINEERING_REQUEST__c WHERE Id =: s.Id];
        System.assertequals('Approved',updatedRecord.Status__c);
    }
    
}

The two required fields that need to be inserted:
Name (Name) *Standard Text field.
Layer (Layer__c) *This is a picklist. The 2 options are "Layer 2" "Layer 3"

Can you please insert them? I'm not sure how they need to be formatted.

*Question: I have some validation rules on this object. Will that cause any issues? (E.g. IF this field is blank then this other field is required). Thank you for your help.

*I see another area in the test class that says "insert f". I'm not sure what I need to insert in that spot?

Thank you for your help!
Hi there,

I have an Apex class that works, but I need to create a test class for it. I'm not a developer and don't know how, so I sincerely appreciate your help. Thank you.

Apex Trigger:
trigger FeedCommentTest on FeedComment (after insert) 
{
    Id profileId = UserInfo.getProfileId();
    String profileName =[Select Id, Name from Profile where Id=:profileId].Name;
    Set<id> SalesEngineeringSet = new Set<Id>();
    List<SALES_ENGINEERING_REQUEST__c> serList = new List<SALES_ENGINEERING_REQUEST__c>();
    for(FeedComment f : Trigger.New)
    {
        if(profileName  == 'Net Planning Department')
        {
            SalesEngineeringSet.add(f.ParentId);
        }          
    }
    
    if(!SalesEngineeringSet.IsEmpty()){
        for(SALES_ENGINEERING_REQUEST__c ser : [SELECT ID,Status__c FROM SALES_ENGINEERING_REQUEST__c WHERE ID In: SalesEngineeringSet]){
            if(ser.Status__c != 'Approved' && ser.Status__c != 'Unable to Meet Request'){
                ser.Status__c = 'Approved';
                serList.add(ser);
            }
        }
    }
    
    if(!serList.IsEmpty())
        update serList;
}
Hi. With the help of the community, I was able to setup a trigger.
Could you please help me write a test class for this? Thank you for your help!

trigger FeedCommentUpdatetoNetPlanning on FeedComment (after insert) 
{
    Id profileId = UserInfo.getProfileId();
    String profileName =[Select Id, Name from Profile where Id=:profileId].Name;
    Set<id> SalesEngineeringSet = new Set<Id>();
    List<SALES_ENGINEERING_REQUEST__c> serList = new List<SALES_ENGINEERING_REQUEST__c>();
    for(FeedComment f : Trigger.New)
    {
        if(profileName  == 'GeoLinks Net Planning')
        {
            SalesEngineeringSet.add(f.ParentId);
        }          
    }
    
    if(!SalesEngineeringSet.IsEmpty()){
        for(SALES_ENGINEERING_REQUEST__c ser : [SELECT ID,Status__c FROM SALES_ENGINEERING_REQUEST__c WHERE ID In: SalesEngineeringSet]){
            if(ser.Status__c != 'Approved' && ser.Status__c != 'Unable to Meet Request'){
                ser.Status__c = 'Awaiting Response from Net Planning';
                serList.add(ser);
            }
        }
    }
    
    if(!serList.IsEmpty())
        update serList;
}
Hi there. I have a trigger that works. I just need help writing the test class. Can you please provide a test class instead of linking me to a page that says "how to write a test class". Thank you for your help.


trigger FeedCommentTest on FeedComment (after insert) 
{
    for(FeedComment f : Trigger.New)
    {
        if(UserInfo.getProfileId()  == '00e6w000000QHyUAAW')
        {
            Sales_Engineering_Request__c SalesEngineeringRequestToUpdate = [SELECT ID FROM SALES_ENGINEERING_REQUEST__c WHERE ID =: f.ParentId];
            SalesEngineeringRequestToUpdate.Status__c = 'Approved';
            Update SalesEngineeringRequestToUpdate;
        }          
    }
}

 
I have a trigger that works, but I want to add criteria.
If the Sales Engineering Request “Status” does not equal “Approved” or “Unable to Meet Request”, then trigger this.
How do I modify this? Thank you for your help.

My Trigger:
trigger FeedCommentTest on FeedComment (after insert) 
{
    for(FeedComment f : Trigger.New)
    {
        if(UserInfo.getProfileId()  == '00e6w000000FjiUAAS')
        {
            Sales_Engineering_Request__c SalesEngineeringRequestToUpdate = [SELECT ID FROM SALES_ENGINEERING_REQUEST__c WHERE ID =: f.ParentId];
            SalesEngineeringRequestToUpdate.Status__c = 'Approved';
            Update SalesEngineeringRequestToUpdate;
        }          
    }
}
Hi. I am hoping to use a trigger like the ones in this example thread. I think I can just use the same code from these threads, but I don't know what I need to modify so instead of applying to Case, it applies to my custom object.
https://developer.salesforce.com/forums/?id=906F0000000D8WtIAK
https://developer.salesforce.com/forums/?id=906F0000000fyASIAY (https://developer.salesforce.com/forums/?id=906F0000000fyASIAY" style="color:#0563c1; text-decoration:underline)


I have a custom object called “Sales Engineering Request” and there’s a chatter feed on this object.
I have a custom “status” field with a picklist and I want the value to be updated based on the last Feed Comment that was made.


Criteria:
If status is in “Pending Review" or "Awaiting Reply from Net Planning" or "Awaiting Reply from Sales”, then update based on the last commenter.
If the last person who commented is part of the Net Planning Department (User Profile ID: 00e3t000001PTFmFFO), update the status to: “Awaiting Reply from Sales”
If the last person who commented is NOT part of the Net Planning Department (Does NOT have User Profile ID: 00e3t000001PTFmFFO), update the status to: “Awaiting Reply from Net Planning”

Note: I was able to get this to work using a process builder for the feeditem, but the feedcomment is not available from Workflows, Process Builders, or Flows, so I believe a trigger is the best path.

Thank you for your help.
Hi. I am hoping to use a trigger like the ones in this example thread, but I need help to write it:
https://developer.salesforce.com/forums/?id=906F0000000D8WtIAK

I have a custom object called “Sales Engineering Request” and there’s a chatter feed on this object.
I have a custom “status” field with a picklist and I want the value to be updated based on the last Feed Comment that was made.


Criteria:
If status is in “Pending Review" or "Awaiting Reply from Net Planning" or "Awaiting Reply from Sales”, then update based on the last commenter.
If the last person who commented is part of the Net Planning Department (User Profile ID: 00e3t000001PTFmFFO), update the status to: “Awaiting Reply from Sales”
If the last person who commented is NOT part of the Net Planning Department (Does NOT have User Profile ID: 00e3t000001PTFmFFO), update the status to: “Awaiting Reply from Net Planning”

Note: I was able to get this to work using a process builder for the feeditem, but the feedcomment is not available from Workflows, Process Builders, or Flows, so I believe a trigger is the best path.

Thank you for your help.
Hi. I am hoping to use a trigger like the one in this thread, but I don’t know how to create this trigger.
https://developer.salesforce.com/forums/?id=906F0000000D8WtIAK
I have a custom object called “Sales Engineering Request” and there’s a chatter feed on this object.
I have a custom “status” field with a picklist and I want the value to be updated based on the last Feed Comment that was made.



Criteria:
If status is in “Pending Review" or "Awaiting Reply from Net Planning" or "Awaiting Reply from Sales”, then update based on the last commenter.
If the last person who commented is part of the Net Planning Department (User Profile ID: 00e3t000001PTFmFFO), update the status to: “Awaiting Reply from Sales”
If the last person who commented is NOT part of the Net Planning Department (Does NOT have User Profile ID: 00e3t000001PTFmFFO), update the status to: “Awaiting Reply from Net Planning”

Any help is appreciated. Thank you so much!
Hi. I have a custom object called “Sales Engineering Request” and there’s a chatter feed on this object.
I have a custom “status” field with a picklist and I want the value to be updated based on the last Feed Comment that was made.

So...
If status is in “Pending Review" or "Awaiting Reply from Net Planning" or "Awaiting Reply from Sales”, then update based on the last commenter.
If the last person who commented is part of the Net Planning Department (User Profile ID: 00e3t000001PTFmFFO), update the status to: “Awaiting Reply from Sales”
If the last person who commented is NOT part of the Net Planning Department (Does NOT have User Profile ID: 00e3t000001PTFmFFO), update the status to: “Awaiting Reply from Net Planning”

I believe I could create a trigger to do this, but I don’t know how? I found this article: https://developer.salesforce.com/forums/?id=906F0000000D8WtIAK

Any help is appreciated. Thank you so much!
Hi. I found this apex class online. It triggered successfully in my sandbox. When deploying to my production org, I tried validating and received an error: 
Code Coverage Failure: Your code coverage is 0%. 

This is the Apex Class:

public class DeleteUnacceptedQuotes 
{
@InvocableMethod    
public static void QuoteDelete(List<Id> OpportunityIds)    
{        
List<Quote> Quotes =[select id from quote                          
where Opportunity.id in :OpportunityIds                       
and Status != 'Accepted'];        
delete Quotes;   
}
}

Thank you for your help!

Hi. I found this apex class online (it's super simple). It triggered successfully in my sandbox. When deploying to my production org, I tried validating and received an error: 

Code Coverage Failure: Your code coverage is 0%. 

This is the Apex Class:
public class DeleteUnacceptedQuotes 
{
@InvocableMethod    
public static void QuoteDelete(List<Id> OpportunityIds)    
{        
List<Quote> Quotes =[select id from quote                          
where Opportunity.id in :OpportunityIds                       
and Status != 'Accepted'];        
delete Quotes;   
}
}


Thank you for your help!

Hi. I am adding this APEX class referenced in the following article:
https://automationchampion.com/tag/auto-delete-record-using-process-builder/

It won't save because I'm getting the following error:
Error: Compile Error: Unexpected token 'List'. at line 6 column 9

Thank you for your help.

Code listed here:
public class DeleteUnaccepted
Quotes {     @InvocableMethod    
public static void QuoteDelete(List<Id> OpportunityIds)    
{        
List Quotes =[select id from quote                          
where Opportunity.id in :OpportunityIds                       
and Status != 'Accepted'];        
delete Quotes;   
}
}

Hi there,
I’m looking to create a validation rule on a Geolocation field (longitude and latitude fields).
I want to ensure that the Sales reps are entering values that have a MINIMUM of 6 digits after the decimal place. How would I do this? I was thinking of creating a validation rule. But I’m not sure how to create the logic.
For example:
11.123456 (acceptable)
11.12345 (not acceptable)
Field Name: Coordinates __c
Thank you for your help!
Hi there,
We are looking to create tiered pricing without using a full-blown CPQ solution.
We sell equipment models with different speeds. When a different speed is entered, we want the pricing to autofill.

Note: We don’t want to create separate products to accommodate this because there would be way too many products (speeds range from 3 to 10,000).
What we’re looking for: IF a rep enters a download speed of 100 and an upload speed of 200, then enter the product price as $XXX.XX

Pricing is tiered. THINK: 1-100 is $100 per and 101-200 is $0.50 per etc. I’m not a developer and need help to formulate this flow or trigger. Any help would be appreciated. I will mark as best answer if you’re able to help accomplish this.

Object: Opportunity Product
Fields:
Upload_Speed_Mbps__c (Number field)
Download_Speed_Mbps__c (Number field)
UnitPrice (Currency)
Hi. I need to migrate files (previously called attachments) from our Old Salesforce org into our New one.
  • I already tried running a report to show all files, but it’s not showing any files.
  • As a test, I attached a file myself. The report didn’t even show the file that was owned by me.
  • Not sure what the best way is to go about this?
If file permissions would get in the way—what would be the best way to go about this?

Thank you for your help.
Hi there,
We’re looking to create tiered pricing without using a full-blown CPQ solution.
We sell equipment models with different speeds. When a different speed is entered, we want the pricing to autofill.
Note: We don’t want to create separate products to accommodate this because there would be way too many products (speeds range from 3 to 10,000).
What we’re looking for: IF a rep enters a speed of 100/100, then enter the product price as $XXX.XX
Thank you for your help! Would I need to use a trigger to do this? What would you recommend?
Thank you for your help!

Hi there.
I have an object called "Work Orders". I have a related object called "Pre-Work Orders".
I want to reference the custom Status field from the Pre-Work order ON the Work Order record.
I don't know how to do this. Because it's a related object, I don't see any way to access it through the formula builder options?
I believe I can create a "related object" formula like so:

WorkOrder__r.Pre_Work_Order__r.Status__c
I keep getting this: 
Error: Field WorkOrder__r does not exist. Check spelling.
I'm unsure of the correct format I need to reference?
Any help would be appricated. Thank you.

Hi. With the help of another user on the forum, I was able to use a sample test class. I just don't know what format is applied when inserting the required fields.

My oringal Apex Trigger: (for reference if needed)
trigger FeedCommentTest on FeedComment (after insert) 
{
    Id profileId = UserInfo.getProfileId();
    String profileName =[Select Id, Name from Profile where Id=:profileId].Name;
    Set<id> SalesEngineeringSet = new Set<Id>();
    List<SALES_ENGINEERING_REQUEST__c> serList = new List<SALES_ENGINEERING_REQUEST__c>();
    for(FeedComment f : Trigger.New)
    {
        if(profileName  == 'Net Planning Department')
        {
            SalesEngineeringSet.add(f.ParentId);
        }          
    }
    
    if(!SalesEngineeringSet.IsEmpty()){
        for(SALES_ENGINEERING_REQUEST__c ser : [SELECT ID,Status__c FROM SALES_ENGINEERING_REQUEST__c WHERE ID In: SalesEngineeringSet]){
            if(ser.Status__c != 'Approved' && ser.Status__c != 'Unable to Meet Request'){
                ser.Status__c = 'Approved';
                serList.add(ser);
            }
        }
    }
    
    if(!serList.IsEmpty())
        update serList;
}

The test class that was created by another member:
@isTest
public class FeedCommentTriggerTest {
    
    @isTest
    public static void testFeedCommentTrigger() {
        
        //Create a User with Profile 'Net Planning Department'
        Id pid = [Select Id FROM Profile WHERE Name = 'Net Planning Department'].Id;
        
        User u = new User();
        u.ProfileId = pid;
        //here fill all the required fields for the User Record
        insert u;
        
        SALES_ENGINEERING_REQUEST__c s = new SALES_ENGINEERING_REQUEST__c();
        s.Status__c = //any Value othe than "Approved" and "Unable to Meet Request"
        //here fill all the required fields for the SALES_ENGINEERING_REQUEST__c Record
        insert s;
        
        //Since test class runs in the current user mode and in this Trigger lines will be covered only when the    //User has a Profile - 'Net Planning Department' hence we need trigger this event as the new User created with this //Profile
        System.runAs(u) {
            FeedComment f = new FeedComment();
            f.ParentId = s.Id;
            //here fill all the required fields for FeedCommentRecord
            
            Test.startTest();
            insert f;
            Test.stopTest();
        }
        
        
        SALES_ENGINEERING_REQUEST__c updatedRecord = [SELECT Id,Status__c  FROM SALES_ENGINEERING_REQUEST__c WHERE Id =: s.Id];
        System.assertequals('Approved',updatedRecord.Status__c);
    }
    
}

The two required fields that need to be inserted:
Name (Name) *Standard Text field.
Layer (Layer__c) *This is a picklist. The 2 options are "Layer 2" "Layer 3"

Can you please insert them? I'm not sure how they need to be formatted.

*Question: I have some validation rules on this object. Will that cause any issues? (E.g. IF this field is blank then this other field is required). Thank you for your help.

*I see another area in the test class that says "insert f". I'm not sure what I need to insert in that spot?

Thank you for your help!
Hi there,

I have an Apex class that works, but I need to create a test class for it. I'm not a developer and don't know how, so I sincerely appreciate your help. Thank you.

Apex Trigger:
trigger FeedCommentTest on FeedComment (after insert) 
{
    Id profileId = UserInfo.getProfileId();
    String profileName =[Select Id, Name from Profile where Id=:profileId].Name;
    Set<id> SalesEngineeringSet = new Set<Id>();
    List<SALES_ENGINEERING_REQUEST__c> serList = new List<SALES_ENGINEERING_REQUEST__c>();
    for(FeedComment f : Trigger.New)
    {
        if(profileName  == 'Net Planning Department')
        {
            SalesEngineeringSet.add(f.ParentId);
        }          
    }
    
    if(!SalesEngineeringSet.IsEmpty()){
        for(SALES_ENGINEERING_REQUEST__c ser : [SELECT ID,Status__c FROM SALES_ENGINEERING_REQUEST__c WHERE ID In: SalesEngineeringSet]){
            if(ser.Status__c != 'Approved' && ser.Status__c != 'Unable to Meet Request'){
                ser.Status__c = 'Approved';
                serList.add(ser);
            }
        }
    }
    
    if(!serList.IsEmpty())
        update serList;
}
I have a trigger that works, but I want to add criteria.
If the Sales Engineering Request “Status” does not equal “Approved” or “Unable to Meet Request”, then trigger this.
How do I modify this? Thank you for your help.

My Trigger:
trigger FeedCommentTest on FeedComment (after insert) 
{
    for(FeedComment f : Trigger.New)
    {
        if(UserInfo.getProfileId()  == '00e6w000000FjiUAAS')
        {
            Sales_Engineering_Request__c SalesEngineeringRequestToUpdate = [SELECT ID FROM SALES_ENGINEERING_REQUEST__c WHERE ID =: f.ParentId];
            SalesEngineeringRequestToUpdate.Status__c = 'Approved';
            Update SalesEngineeringRequestToUpdate;
        }          
    }
}
Hi. I found this apex class online. It triggered successfully in my sandbox. When deploying to my production org, I tried validating and received an error: 
Code Coverage Failure: Your code coverage is 0%. 

This is the Apex Class:

public class DeleteUnacceptedQuotes 
{
@InvocableMethod    
public static void QuoteDelete(List<Id> OpportunityIds)    
{        
List<Quote> Quotes =[select id from quote                          
where Opportunity.id in :OpportunityIds                       
and Status != 'Accepted'];        
delete Quotes;   
}
}

Thank you for your help!

Hi. I found this apex class online (it's super simple). It triggered successfully in my sandbox. When deploying to my production org, I tried validating and received an error: 

Code Coverage Failure: Your code coverage is 0%. 

This is the Apex Class:
public class DeleteUnacceptedQuotes 
{
@InvocableMethod    
public static void QuoteDelete(List<Id> OpportunityIds)    
{        
List<Quote> Quotes =[select id from quote                          
where Opportunity.id in :OpportunityIds                       
and Status != 'Accepted'];        
delete Quotes;   
}
}


Thank you for your help!

Hi there,
I’m looking to create a validation rule on a Geolocation field (longitude and latitude fields).
I want to ensure that the Sales reps are entering values that have a MINIMUM of 6 digits after the decimal place. How would I do this? I was thinking of creating a validation rule. But I’m not sure how to create the logic.
For example:
11.123456 (acceptable)
11.12345 (not acceptable)
Field Name: Coordinates __c
Thank you for your help!
Hi. I need to migrate files (previously called attachments) from our Old Salesforce org into our New one.
  • I already tried running a report to show all files, but it’s not showing any files.
  • As a test, I attached a file myself. The report didn’t even show the file that was owned by me.
  • Not sure what the best way is to go about this?
If file permissions would get in the way—what would be the best way to go about this?

Thank you for your help.