• susheel1
  • NEWBIE
  • -1 Points
  • Member since 2009

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 6
    Questions
  • 4
    Replies

I am unable to create create tab for Asset object. ... Any ideas

While deploying a trigger, I am getting an error message Error message - Variable does not exist Global_Settings.submittedforApproval.     Below is the trigger.

 

trigger Submit_AFC_Sample_Request on Sample_Request_AF_C__c (after update,after insert) {

// need to Run Trigger only once.


if(Global_Settings.submittedforApproval == false)
{
  for(Sample_Request_AF_C__c sampelReq : trigger.new)
  {
     System.debug('The record is : ' + sampelReq);
   if(sampelReq.Approval_Status__c == 'Sample Requested' )
   {
        if(Trigger.isInsert) {
            Approval.ProcessSubmitRequest req1 = new Approval.ProcessSubmitRequest();
            req1.setComments('Submitting request for approval.');
            req1.setObjectId(sampelReq.id);
                     
            Approval.ProcessResult result = Approval.process(req1);        
       
        }
        if(Trigger.isUpdate){
        Approval.ProcessSubmitRequest req2 = new Approval.ProcessSubmitRequest();
        req2.setComments('Submitting request for approval.');
        req2.setObjectId(sampelReq.id);
       
       Approval.ProcessResult result = Approval.process(req2);
     }
       
        }
 }
Global_Settings.submittedforApproval =true;
 }
 else
 {
 Global_Settings.submittedforApproval = false;
 }
 }

 I have newly installed eclipse Unable to see File > New > Force.com Project in eclipse there are several other projects but I dont see force.com project

I have written a query

 

select Approved_Credit_Amount__c, CA_PA_Verification_CA_Manager__c, CAE_Review_Date__c, CaseNumber, Quality_Leader__r, Containment__c from case Where RecordTypeId = '012800000007HCM' and AccountId= '0013000000EP2l5AAD'

 

Quality Leader is a look field to the user. 

when I run this Query  in Apex explorer Quality Leader__r gives me the name of the quality leader but it gives the name in the first column below Approved_Credit_Amount what I want is to get this information where it is i.e after case number

 I am a  on L1 VISA from India working for a reputed MNC as a Salesforce Administrator.  I am looking for a change and intrested in working  as a Salesforce Adminstrator on H1 VISA  please mail me at sush.bist1@gmail.com if there are any suitable openings
      Need help to write a trigger to pre-populate 3 look fields. 2 of these fields come from the contacts and 1 is coming from the user. We need to deploy this by this Friday. Your help would be appreciated. I am new to programming
Message Edited by susheel1 on 08-19-2009 01:03 PM
 I have newly installed eclipse Unable to see File > New > Force.com Project in eclipse there are several other projects but I dont see force.com project
      Need help to write a trigger to pre-populate 3 look fields. 2 of these fields come from the contacts and 1 is coming from the user. We need to deploy this by this Friday. Your help would be appreciated. I am new to programming
Message Edited by susheel1 on 08-19-2009 01:03 PM

I am trying to pre-populate a custom lookup field on the Contact object with an account. This Account is the parent of the Account in the standard "Account Name" field on the Contact page. Facility is a child account, Practice is a parent account.

 

Here is what I have. It does not work - this is probably the 5th version of this trigger I have tried writing. I have logged a case with premier support - it has been escalated but I have not heard anything back.

 

Any Suggestions would be greatly appreciated.

trigger PopulatePracticeContact on Contact (before insert, before update) { //Set of Account Ids Set<Id> FacilityAccountIds = new Set<Id>(); for (Contact contactNew : Trigger.new) { //Facility Record Type == 012700000009R7G, always Child Account if(contactNew.Account.parentId != null && contactNew.Account.RecordTypeId == '012700000009R7G') { FacilityAccountIds.add(contactNew.AccountId); //A set of Facility Accounts } } Contact [] con = Trigger.new; con = [SELECT c.Id, c.Name, c.Related_Practice_Account__c, c.AccountId FROM Contact c WHERE c.AccountId IN :FacilityAccountIds]; Account [] pAccounts; pAccounts = [SELECT a.id, a.parentid, a.Name, (SELECT id, AccountId, Related_Practice_Account__c, Related_Practice__c FROM Contacts WHERE AccountId IN :FacilityAccountIds) FROM Account a WHERE a.id IN :FacilityAccountIds]; if(con.size()> 0){ if((con[0].AccountId == pAccounts[0].Id) && (pAccounts[0].ParentId != null)){ pAccounts[0].ParentId = con[0].Related_Practice_Account__c; } update con[0]; } }

 

  • August 19, 2009
  • Like
  • 0