• Kaity
  • NEWBIE
  • 115 Points
  • Member since 2013

  • Chatter
    Feed
  • 2
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 92
    Questions
  • 124
    Replies
Hi,
I have 3 apex jobs which run one by one(Completion of the first job, the second job starts). However the first job is trigger by the Middleware. So, as a result "Job Submitted By" is always shows the Integration User. 
I want to stamp the "Job Submitted By"  by my name. What is the way through which I can meet this requirement. Please suggest. Thanks!

-Kaity
Hi, While writing this trigger, I am getting this error below  marked as underline-
Incompatible element type Id for collection of Opportunity​


Please help to resolve the issue

 
trigger  UpdateOpportunity on Top_X_Designation__c (after Insert, after Update, after Delete) {
List<Opportunity> lstopp = new List<Opportunity>();
List<Opportunity> lstOppUpdated = new List<Opportunity>();

  // Set<Id> lstOppUpdated = new Set<Id>();

Map <Id, Id> docAttachTrue = new Map<id,id>();
Map <Id, Id> docAttachFalse= new Map<id,id>();
Map <Id, Id> docAttachDel = new Map<id,id>();

Set<id> opptySetId = new Set<id>();
Set<id> opptySetDel = New Set<id>();

if(Trigger.IsInsert || Trigger.IsUpdate){
for(Top_X_Designation__c txd: Trigger.new){
  if(txd.Type__c=='Contract Flow Down/Handoff' && txd.Document_Attached__c == True ){
   docAttachTrue.put(txd.Opportunity__c, txd.id);
   opptySetId.add(txd.Opportunity__c);
  }
  else
   docAttachFalse.put(txd.Opportunity__c, txd.id);
   opptySetId.add(txd.Opportunity__c);
    }
    }
    
    if(Trigger.IsDelete){
    for(Top_X_Designation__c txdold: Trigger.old){
    docAttachDel.put(txdold.Opportunity__c, txdold.id);
    opptySetId.add(txdold.Opportunity__c);
    opptySetDel.add(txdold.Opportunity__c);
    }
  
}


lstopp = [SELECT ID, Handoff_Attached__c FROM Opportunity WHERE id in : opptySetId];
 if(lstopp.size()>0 && lstopp!= null){
   for(Opportunity opp:lstopp){
    if(docAttachTrue.containsKey(opp.id)){
      opp.Handoff_Attached__c = 'Yes';
 }
 if(docAttachFalse.containsKey(opp.id)){
      opp.Handoff_Attached__c = 'No';
 }
 
 if(opptySetDel.contains(opp.id)){
      opp.Handoff_Attached__c = '';
 }
 lstoppUpdated.add(opp.id);  //Error: Incompatible element type Id for collection of Opportunity​
}
  if(lstoppUpdated.size()>0 && lstoppUpdated != null){
    update lstoppUpdated;
    }
  }
  
 }

Thanks,
Kaity
Hi Experts,
Need help here-

I have created a custom setting. By clicking the VisualForce tab, I want to reach to the screen of the Custom setting.How to achieve this?

<apex:page action="{!URLFOR($Resource.myStaticResourceURL)}"/>

Thanks,
Kaity

 
HI,
On clicking a custom Tab, user should be redirected to one of the custom settings. The code is as below:
I want to make the URL as dynamic sothat i need to change the URL(https://ABC-INT.cs18.my.salesforce.com/). Please suggest.
public with sharing class ActivitiesController {
    public PageReference redirect() {
        return new PageReference('https://ABC-INT.cs18.my.salesforce.com/setup/ui/listCustomSettingsData.apexp?com.salesforce.visualforce.ViewStateCSRF=VmpFPSxNakF4TmkweE1TMHdORlF3T1Rvd05Eb3pOQzR5TkROYSxFbVV1SDVydmdzTXJnXzNWNXFTdjZhLE56RTNPVGcz&com.salesforce.visualforce.ViewStateVersion=201610312000010466&CS_Defn_View%3ACS_View=CS_Defn_View%3ACS_View&CS_Defn_View%3ACS_View%3AtheDetailBlock%3AdetailButtons%3Amanage=Manage&id=a1V&retURL=%2Fsetup%2Fui%2FviewCustomSettings.apexp%3Fsetupid%3DCustomSettings%26id%3D01I11000000AdEY');
    }
}
Hi experts,
I've a requirement as follows:
I have a custom Setting where I have mentioned the State code of all states:Like-
Sate---- Code
AP------- 001
UP------- 002
JK ------- 003
HD------- 004

Whenever a new account is created, based upon the state code of the state, a field in Account namely 'StateCode__c' will be updated.

Thanks,
Kaity

 
Hi,
I have a customer requirement where they donot want to land into Salesforce standard Home Page, rather they want to land into a customized Page after successful login. Is it possible to achieve this without using community? Please help.
Hi Adminstrators and Developers,
Is there any way, to stop the auto email trigger to the user when the user is newly created? Please help.

-Kaity
Hi, 
Can some one would help me on-  What is the SOQL for retrieving the list of Users who are Moderators in a Private or Public Group?

​Thanks,
Kaity
Hi-

I am writing this code snippet in Developer console:

List<Lead> ledLst = [Select Id, Name From Lead where ID IN : Trigger.NewMap.keySet()];
System.debug('$$$$$$$'+ledLst);


But, I am getting the beloe Error:

System.NullPointerException: Attempt to de-reference a null object.

What is wrong in my snippet?

Thanks,
Kaity
 
What is the difference between Query() and QueryMore()? Can you please explain with a usecase? I have read the blogs of SalesForce but didnot understand.

-Kaity
Hi Integration Experts,

Can I use both REST and SOAP API while integrating SalesForce with any 3rd Party Legacy system? 
Which approach provides easy authentication as per implementation is concern? Please explain. 

-Kaity
Hello everybody,
When do we use JSON in APEX? Can some one explain elaborately. Many Thanks.

-Kaity

Hi,
My understanding was, we can not use 'webservice' keyword in trigger. However, I saw in apex guide, we can use 'webservice' key word.

You can only use the webService keyword in a trigger when it is in a method defined as asynchronous; that is, when the
method is defined with the @future keyword.


Can someone clear me this idea? How to write a code here, any example..

Thank you.
 
Hi,
What is the difference between set and private set? And when do we use private set?
example: 
public ApexPages.StandardSetController ssc {get; private set;}

Please advice.

-Kaity
Salesforce.com Administrator needed in Irvine CA. Be a part of a great working environment - full time and pay is commensurate with experience. Please let us know if you (or anyone you know) are interested!! Email nancy@tech2resources.com.