• Fatfox F
  • NEWBIE
  • 10 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 2
    Replies
I have following queries:

1.) I'll be inserting records in a custom object (let's say ObjectA) using data loader. Majority of the email addresses in the csv sheet (which I'll be using for data loading) are already present in the object. This custom object can only have unique email address record. So my doubt is how will the insert operation proceed? Will the missing email address records be created in the custom object uninterrupted? (I'm aware that I'll be getting a "success" and "error" files in the end. So in my case, majority of the records will be seen in "error" file, right?)

2.) I'm also writing a before insert trigger on ObjectA. In this trigger, I've put all the records' email address which will be inserted through data loader in a Set called "NewSet" (through trigger.new). I've fetched all the records of ObjectA in a list (say ListA). Now, I've compared the email address field in this listA with NewSet (through NewSet.contains method).
The ones that are missing in the set, I've retrieved "Id" of those records in another list "todelete". And I'll be deleting them by statement "delete todelete".

So will this delete statement work in the same before insert trigger?? Also, will both the scenarios work altogether??

Thanks in advance.
Hi all,

I'm a newbie in Apex and I have a doubt which is bugging me.
 
While acquiring Id of a particular record of an object, why do I have to create sObject (if I'm not wrong) and not create a variable of type ID?
 
Further details:

The following works correctly and gives me the Account Id.
Account acct = [Select Id from Account where Name='Test'];
System.debug('ID: '+acct.Id);
 
But the following throws an error.
ID id = [Select Id from Account where Name='Test'];
System.debug('ID: '+id);

Why so??

Please help and any additional information will be greatly appreciated.

Thanks guys!
Hi everyone,

I'm creating the Recruiting App using the guide provided Salesforce. I'm stuck at creating a task using process builder.
Background: When a Picklist value in Job Application object changes to 'Rejected' or 'Extend an Offer', actions are performed accordingly. The actions should cause creation of a Task record where:
1) 'Assigned To' lookup field should be populated with the Owner of the Job Application object record. For this I'm filling it with [Job_Application__c].OwnerId
2) Priority field should be set 'High'.
3) Status field should be 'Not Started'.
4) Subject field should be 'Send Rejection Letter' or 'Extend an Offer' depending on the criteria.
5) Due Date field should be '[Job_Application__c].CreatedDate + 1 or Now() + 1 depending on the criteria.
User-added image

User-added image

'Criteria for Executing Actions' is set to 'Conditions are met'
Action is executed when 'All of the conditions are met (AND)'

User-added image

But when I change the picklist value of any Job Application record, nothing happens. No Task record is created. I've done everything exactly as mentioned in the Recruiting App guide but no luck.
Suggestions will be very helpful.

Thanks
 
I have following queries:

1.) I'll be inserting records in a custom object (let's say ObjectA) using data loader. Majority of the email addresses in the csv sheet (which I'll be using for data loading) are already present in the object. This custom object can only have unique email address record. So my doubt is how will the insert operation proceed? Will the missing email address records be created in the custom object uninterrupted? (I'm aware that I'll be getting a "success" and "error" files in the end. So in my case, majority of the records will be seen in "error" file, right?)

2.) I'm also writing a before insert trigger on ObjectA. In this trigger, I've put all the records' email address which will be inserted through data loader in a Set called "NewSet" (through trigger.new). I've fetched all the records of ObjectA in a list (say ListA). Now, I've compared the email address field in this listA with NewSet (through NewSet.contains method).
The ones that are missing in the set, I've retrieved "Id" of those records in another list "todelete". And I'll be deleting them by statement "delete todelete".

So will this delete statement work in the same before insert trigger?? Also, will both the scenarios work altogether??

Thanks in advance.
Hi everyone,

I'm creating the Recruiting App using the guide provided Salesforce. I'm stuck at creating a task using process builder.
Background: When a Picklist value in Job Application object changes to 'Rejected' or 'Extend an Offer', actions are performed accordingly. The actions should cause creation of a Task record where:
1) 'Assigned To' lookup field should be populated with the Owner of the Job Application object record. For this I'm filling it with [Job_Application__c].OwnerId
2) Priority field should be set 'High'.
3) Status field should be 'Not Started'.
4) Subject field should be 'Send Rejection Letter' or 'Extend an Offer' depending on the criteria.
5) Due Date field should be '[Job_Application__c].CreatedDate + 1 or Now() + 1 depending on the criteria.
User-added image

User-added image

'Criteria for Executing Actions' is set to 'Conditions are met'
Action is executed when 'All of the conditions are met (AND)'

User-added image

But when I change the picklist value of any Job Application record, nothing happens. No Task record is created. I've done everything exactly as mentioned in the Recruiting App guide but no luck.
Suggestions will be very helpful.

Thanks