• Jeffrey Uy
  • NEWBIE
  • 20 Points
  • Member since 2019

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 5
    Replies
Hello everyone.
I am not a Salesforce developer but have some basic knowledge on SOQL and Apex Triggers.  I need help from someone on an Apex trigger.  We'd like to update a checkbox field on Account object when there is a File that starts with "DA" that is added/attached to the specific account record.  is this doable?  any help will be greatly appreciated.  thank you.
I don't have much experience with Apex so I was wondering if anybody here can help me out.
We have a custom object named OrderLine.  It has data for our Sales Order lines in our ERP which is being Dataloaded every night.  It has Order_Number__c, Account_Number__c and Part_Number__c.  I need a custom field on the QuoteLine object named Sales_Order_Number__c updated when a record in OrderLine is created or edited that meets the following criteria:
OrderLine.AccountNumber = QuoteLine.AccountNumber
OrderLine.PartNumber = QuoteLine.Product (or PartNumber)
OrderLine.CreatedDate > QuoteLine.CreatedDate.

Is this possible?  Thank you.
Hello,

I am not a developer but would like to learn a few basic things.
One of which I am working on is to auto-create a lead from a case based on certain criteria.  The code below works but I need to get the lastname from Contact instead of an ID.  Can anyone show me how?  Thanks.

trigger AutoCreateLead on Case (before insert) 
{
    case c=trigger.new[0];
    if(c.Approved_for_Lead__c  == TRUE)
  {
    list<lead> 
    l = [select id, Email from Lead where Email = :c.ContactEmail];
     if(l.size()==0)
    {
      lead l1=new lead(lastname=c.ContactId , Email=c.ContactEmail, Company=c.SuppliedName, LeadSource='Converted From Case', Status = 'Open - Not Contacted', Title='Converted From Case', Phone=c.ContactPhone);
      insert l1;
    }
  }
}
Hello,

I have this validation rule the Case object that I don't know why it does not work:

AND(Account.RecordType.DeveloperName <> "Customer", Owner:Queue.QueueName  <> "Case_Inspection_US")

Scenario:
Allow re-assigning case to a "non-Customer" Account Record Type if Case Owner is Case_Inspection_US. Otherwise, block the change.

So I have case owned by Case Inspection US and I try to change the account to a non-Customer record type and the validation rule triggers.  It should allow it.

It looks like the AND() is not working right.  What am I doing wrong?  Thanks.
Hello everyone.
I am not a Salesforce developer but have some basic knowledge on SOQL and Apex Triggers.  I need help from someone on an Apex trigger.  We'd like to update a checkbox field on Account object when there is a File that starts with "DA" that is added/attached to the specific account record.  is this doable?  any help will be greatly appreciated.  thank you.
I don't have much experience with Apex so I was wondering if anybody here can help me out.
We have a custom object named OrderLine.  It has data for our Sales Order lines in our ERP which is being Dataloaded every night.  It has Order_Number__c, Account_Number__c and Part_Number__c.  I need a custom field on the QuoteLine object named Sales_Order_Number__c updated when a record in OrderLine is created or edited that meets the following criteria:
OrderLine.AccountNumber = QuoteLine.AccountNumber
OrderLine.PartNumber = QuoteLine.Product (or PartNumber)
OrderLine.CreatedDate > QuoteLine.CreatedDate.

Is this possible?  Thank you.
Hello,

I am not a developer but would like to learn a few basic things.
One of which I am working on is to auto-create a lead from a case based on certain criteria.  The code below works but I need to get the lastname from Contact instead of an ID.  Can anyone show me how?  Thanks.

trigger AutoCreateLead on Case (before insert) 
{
    case c=trigger.new[0];
    if(c.Approved_for_Lead__c  == TRUE)
  {
    list<lead> 
    l = [select id, Email from Lead where Email = :c.ContactEmail];
     if(l.size()==0)
    {
      lead l1=new lead(lastname=c.ContactId , Email=c.ContactEmail, Company=c.SuppliedName, LeadSource='Converted From Case', Status = 'Open - Not Contacted', Title='Converted From Case', Phone=c.ContactPhone);
      insert l1;
    }
  }
}