-
ChatterFeed
-
1Best Answers
-
0Likes Received
-
0Likes Given
-
6Questions
-
2Replies
Testing @future with User trigger
trigger afterInactivateUser on User (after update) {
Set<Id> inactivatedParterUsers = new Set<Id>();
for(Integer i = 0; i < Trigger.new.size(); i++){
User oldUser = Trigger.old.get(i);
User updatedUser = Trigger.new.get(i);
if(updatedUser.ContactId != null && updatedUser.IsActive == false && oldUser.IsActive == true){
inactivatedParterUsers.add(updatedUser.id);
}
}
if(!inactivatedParterUsers.isEmpty()){
PartnerUtils.createInactivateUserPartnerRequest(inactivatedParterUsers);
}
}
==============================================================
==============================================================
public class PartnerUtils {
@future
public static void createInactivateUserPartnerRequest(Set<Id> ids){
List<User> users = new List<User>([select id, ContactId from User where id in :ids]);
List<MyCustomObject__c> requestList = new List<MyCustomObject__c>();
MyCustomObject__c request = null;
for(User user : users){
request = new MyCustomObject__c();
request.Contact__c = user.ContactId;
requestList.add(request);
}
insert requestList;
}
}
==============================================================
-
- richardv
- March 03, 2009
- Like
- 0
- Continue reading or reply
Request you to help on following things related to Pervasive
How to migrate Relationship into SFDC using Pervasive i.e., if I want to move Account - > Contact relationship from Legacy to SFDC
Folllowing happens when we use Data loader:-
IF its manual process what we do is
a. Migrate Accounts
b. Get the Account SFDC ID and Account Legacy ID export from SFDC
c. Now before migrating Contact, we use above Account export to update Contact_To_Be_Migrated by looking up Account Legacy ID with Account SFDC ID
d. So this would result in Contact_To_Be_Migrated to hold one more column of AccountSFDCID which would indicate that this contact need to be migrated under which SFDC Account
e. Now we migrate the Contact with Account SFDC ID mapped to AccountID field of Contact
f. So automatically the SFDC too will start showing the Relationship
Can anybody tell me that how should we carry out the process using Pervasive-
- Mohit Mohan
- February 07, 2008
- Like
- 0
- Continue reading or reply
Scheduling using Pervasive tool for inserting Data in salesforce.com
Hi ,
Can anyone help me that how I can Schedule daily/hourly batch job using Pervasive tool for inserting Data in salesforce.com.
I am new in using Pervasive Tool and urgently want help in this regard. I need the process that what should I do so that there should be batch updates of data in salesforce.com on daily or hourly basis.
Please anyone provide the inputs
-
- Mohit Mohan
- February 07, 2008
- Like
- 0
- Continue reading or reply
Creation of Custom Salesforce Page By S-control
Please help me how to start with the first step in making the custom page by the help of S-controls.
Regards
Mohit
-
- Mohit Mohan
- January 29, 2008
- Like
- 0
- Continue reading or reply
Using of the Pervasive DataMigration Tool.
I am suppose to use Pervasive data migration tool in one of my project instead of Apex data loader.As I am new to this tool and also not aware how to use it .
Please provide me with the information about how to use the pervasive data migration tool.Please also provide me informaiton that How to install pervasive and integrate ie with Salesfoce.com .
Thanks
-
- Mohit Mohan
- January 09, 2008
- Like
- 0
- Continue reading or reply
First Apex-api program
I am writing my first Apex -API program in .NET (C#).The program as follows:-
private void button1_Click(object sender, EventArgs e)
{
sForce.SforceService abc = new Jaggu.sForce.SforceService();
sForce.Account objAccount = new Jaggu.sForce.Account();
//Set several properties
// Invoke the login call and save results in LoginResult
// sForce.Proxy = System.Net.WebProxy.GetDefaultProxy();
sForce.LoginResult lr = abc.login("******", "");
// Reset the SOAP endpoint to the returned server URL
abc.Url = lr.serverUrl;// "https://www.salesforce.com/services/login.jsp";
// Create a new session header object
// Add the session ID returned from the login
abc.SessionHeaderValue = new sForce.SessionHeader();
abc.SessionHeaderValue.sessionId = lr.sessionId;
sForce.GetUserInfoResult userInfo = lr.userInfo;
objAccount.Name = "John Abhraham ";
objAccount.Description = "Happy World";
sForce.sObject[] records = new sForce.sObject[]
{
objAccount
};
sForce.SaveResult[] saveResults = abc.create(records);
String newID = saveResults[0].id;
MessageBox.Show(newID);
note :-sForce.LoginResult lr = abc.login("******", "");.
I have not given my login Id and password .Anybody can put there credencials.
The Error which I am geeting is :-
"The remote server returned an error: (407) Proxy Authentication Required"
I think ,I am behind a firewall or proxy server for my internet access.Please provide me with the another way so that i can hit the Salesforce .
I have tried for evey possibility.Please help me in this regard......???
Regards
Mohit Mohan
-
- Mohit Mohan
- September 28, 2007
- Like
- 0
- Continue reading or reply
Approval Process
Can you please provide me the information about how the approval process work and how It is different from workflows.
Thanks
Mohit Mohan
-
- Mohit Mohan
- September 27, 2007
- Like
- 0
- Continue reading or reply
A simple C# create new record call to the web services API....Am I doing it right?
Greetings! I am new to the SalesForce world. I am starting up a small project that will use the Web Services API. So far I've had good luck with accessing the service, pulling data, etc.
Now I've dabbled with creating a new record. I have it working but I was hoping that someone could look at my code sample and tell me if this is most efficient way. I fear that I have over-complicated things.
My SF object is a simple table (is this even the right word in the salesforce world??) called test with just one field called Name. Standard stuff. So to create/insert I am doing the following in c#:
Test__c[] newStuff = new Test__c[1];
newStuff[0] = new Test__c();
newStuff[0].Name = "My Test Name";
String[] createdItemIds = new String[10];
SaveResult[] sr = binding.create(newStuff);
for (int i=0;i<sr.Length;i++) {
if (sr[i].success) {
Response.Write("<hr/>" + sr[i].id.ToString() + "<hr/>");
createdItemIds[i] = sr[i].id;
}
}
I built this from some c# sample code that I found on here. Like I said everything works but the sample code I found was for inserting multiple records at once. I am curious if there is a cleaner, more direct way to insert a SINGLE record and get the new unique ID back from the webservice.
Thanks in advance for any tips or advice!
- Jasper
- JQHeller
- April 22, 2009
- Like
- 0
- Continue reading or reply
Testing @future with User trigger
trigger afterInactivateUser on User (after update) {
Set<Id> inactivatedParterUsers = new Set<Id>();
for(Integer i = 0; i < Trigger.new.size(); i++){
User oldUser = Trigger.old.get(i);
User updatedUser = Trigger.new.get(i);
if(updatedUser.ContactId != null && updatedUser.IsActive == false && oldUser.IsActive == true){
inactivatedParterUsers.add(updatedUser.id);
}
}
if(!inactivatedParterUsers.isEmpty()){
PartnerUtils.createInactivateUserPartnerRequest(inactivatedParterUsers);
}
}
==============================================================
==============================================================
public class PartnerUtils {
@future
public static void createInactivateUserPartnerRequest(Set<Id> ids){
List<User> users = new List<User>([select id, ContactId from User where id in :ids]);
List<MyCustomObject__c> requestList = new List<MyCustomObject__c>();
MyCustomObject__c request = null;
for(User user : users){
request = new MyCustomObject__c();
request.Contact__c = user.ContactId;
requestList.add(request);
}
insert requestList;
}
}
==============================================================
- richardv
- March 03, 2009
- Like
- 0
- Continue reading or reply