• saariko.ax241
  • NEWBIE
  • 50 Points
  • Member since 2006

  • Chatter
    Feed
  • 2
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 33
    Questions
  • 46
    Replies

Can someone please explain what is the process of Save to Server and Deploy to Server

And to which env should I do what?  

 

 - I have both Sandbox and Production env

 

 - Do I need to first deploy to DEV - than when i need to update, can I just save?

 

Or is there another workflow requirement?

Excuse me for the NOOB Q

 

I am using the X.IDE

 

My first project included an email processor, which works perfectly, and is deployed to the server.

 

Now that I want to create a new trigger (which has nothing to do with the emailProcessor) 

 

 - Should I create a new project for that?

 - Is there a rule of thumb to when to create a new project?  (to all triggers? all classes? all related objects?)

 

Thanks

I am trying to update the field: IsUnreadByOwner - when a lead status changes to: Unqualified.

 

this is my trigger:

trigger UnqualifiedLead on Lead (before update) {
	for(Lead lead: Trigger.new)
	{
		if (lead.Status == 'Unqualified')
		{
			lead.IsUnreadByOwner = false;	
			update lead;
		}
	}
}

 

And my trigger:

@isTest
private class UnqualifiedLeadTest {

    static testMethod void myUnitTest() {
        // Setup the lead record
        Lead lead = new Lead();
        lead.LastName = 'last';
        lead.FirstName = 'First';
        lead.Company = 'Company';
        lead.Status = 'Unqualified';
        insert lead;
        lead.IsUnreadByOwner = True;
        update lead;
    }
}

 

i have a feeling, that the "update lead;" line is wrong, but not sure how to check if the change works.

 

Appreciate the help.

 

This is the error log I get

 

*** Deployment Log ***
Result: FAILED
Date: July 17, 2012 5:49:07 PM IDT

# Deployed From:
   Project name: Email2Lead
   Username: saar....@.com
   Endpoint: www.salesforce.com

# Deployed To:
   Username: saar.....@.com
   Endpoint: www.salesforce.com

# Deploy Results:
   File Name:    package.xml
   Full Name:  package.xml
   Action:  UPDATED
   Result:  SUCCESS
   Problem: n/a

   File Name:    triggers/UnqualifiedLead.trigger
   Full Name:  UnqualifiedLead
   Action:  UPDATED
   Result:  SUCCESS
   Problem: n/a

# Test Results:

Run Failures:
  UnqualifiedLeadTest.myUnitTest System.DmlException: Update failed. First exception on row 0 with id 00QD000000VgQJHMA3; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, UnqualifiedLead: execution of BeforeUpdate

caused by: System.SObjectException: DML statment cannot operate on trigger.new or trigger.old

Trigger.UnqualifiedLead: line 7, column 1: []

 

I have written an Apex class, that converts incoming emails according to the toAddress  (I know, it's great - thanks ^^ )

 

anyway, it is working perfect, when I send the email to the emailService generated address. However, in order that my users will not see such addresses, I create an alias group in our mail server (google for instance) and give the name a more suitable/readable name.

Here where the class breaks.

 

First debug code is with the direct address, as you can see, the SOQL returns 1 row (as should)

10:21:15.091 (91499000)|SOQL_EXECUTE_BEGIN|[33]|Aggregations:0|select Id from User where Alias = :tmpVar1
10:21:15.097 (97818000)|SOQL_EXECUTE_END|[33]|Rows:1

 

Second log, is when using th elias/group  (the only address in the group is the same one as in first example) however, this time, nothing is returned from the SOQL

10:14:46.127 (127098000)|SOQL_EXECUTE_BEGIN|[33]|Aggregations:0|select Id from User where Alias = :tmpVar1
10:14:46.132 (132488000)|SOQL_EXECUTE_END|[33]|Rows:0

 

I assume it's something in the way either Google transforms/creates/forwards email?

 

Anyone has an idea?

Ok, so I have created my first Apex Class.

I was able to save it to my sandbox, and everything works as planned. I am getting an error when trying to deploy to my production server, ok, so I have created a test class, but I don't understand why/how and what is needed.

 

I get 2 main errors: 1. Assertion error

2. only 72% of code is covered.

 

I'd appreciate a pointer as to what's and how I should attack this.

 

My code inherits from inbound email:

 

My inboundEmail class:

 

global class inboundEmail implements Messaging.InboundEmailHandler {

    global Messaging.InboundEmailResult handleInboundEmail(Messaging.InboundEmail email, Messaging.InboundEnvelope envelope) {
        Messaging.InboundEmailResult result = new Messaging.InboundEmailresult();


    Account account;
    Lead lead;
String [] mFromUserParams; String [] sourceText; String mCaseObject; try{ sourceText = email.toAddresses[0].split('@'); String [] mParams = sourceText[0].split('\\.'); mFromUserParams = email.fromAddress.split('@'); mCaseObject = mParams[0]; if (mCaseObject == 'lead'){ lead = new Lead(); lead.LastName = mFromUserParams[0]; lead.Company = email.fromAddress; lead.OwnerId = mParams[1]; lead.LeadSource = mParams[2]; lead.Email = email.fromAddress; lead.RequirementsDescription__c = email.subject + email.plainTextBody; insert lead; result.success = true; } else if (mCaseObject == 'case'){ } else { result.success = false; } }catch(Exception e){ result.success = false; result.message = 'Oops, I failed.'; } return result; } }

 

My inboundEmailText class as currently configured: What I did, is create a new envelope, an email and a header, and populated all the fields that are to be populated as if a real email is coming. Is that what's the idea with testing?

 

Where is my problem?

@isTest
private class inboundEmailTest {

 // Success Case
   public static testMethod void inboundEmail(){
        
        // Create a new email, envelope object and Header
        Messaging.InboundEmail email = new Messaging.InboundEmail();
        Messaging.InboundEnvelope envelope = new Messaging.InboundEnvelope();
        Messaging.InboundEmail.Header hditem= new Messaging.InboundEmail.Header();

		email.headers = new Messaging.InboundEmail.Header[1];
		hditem.name='Date';
		hditem.value='Tue, 28 Apr 2009 14:08:37 -0700';
		email.headers[0]=hditem;

		envelope.toAddress = 'lead.idinboundmail@eihnp2ha.c-cpeneac.cl.apex.sandbox.salesforce.com';
        envelope.fromAddress = 'user@acme.com';
        email.subject = 'Please contact me';
        email.fromName = 'Test From Name';
        email.plainTextBody = 'Hello, this a test email body. for testing purposes only.Phone:123456 Bye';

        // setup controller object
        inboundEmail catcher = new inboundEmail();
        Messaging.InboundEmailResult result = catcher.handleInboundEmail(email, envelope);
        System.assertEquals( result.success  ,true);
    }
}

 

on deployment, I get that most lines from inboundEmail class are not covered.

 

As for the assertion test - shouldn't I check that the actual class did what it's supposed to?  why does the check must be: false?

 

 

Is there any settings or a way that a self service user can lock himself after several wrong password tries?

 

 

This is a question about a general HOWTO setup some SF objects we have today.

 

- We are a software company, and we sell our software (which is built of modules) .  We secure each module with a hardware USB dongle (Aladdin)

- Today, I have 2 custom objects to faciliate this:

1. License

2. Module

 

For each license I can have many modules, as well as add a module after any period of time. Each module has a version number (according to the released software version).

 

 

My main question is: Is there a way to combine our opportuinities with the modules? What I mean, is that when a module is sold, I want that the specific account will get some kind of a +1 indicator for that specific module, and than, I can select any License that is attached to that Account, and make the connection.

 

I tried to work with Assets, but it didn't lead to anything productive.

 

Would love to hear some input.

 

 

When we create/enable a new selfserviceuser (ssu) through SF interface, there is an option to check the box for: Create and email a new password to the user.

 

Today, in our code, we manage to create a new user, create a new SSU for this user, and we manually do a setpassword, and set an email to the user. 

 

Is it possible to do the email password via the API?  

 

 

I also think that something is weird when doing a reset password. The fact that I get the new password of the user is wrong. It should not be like that.

I need to create enable a new SelfServiceUser when a contact of specific record type is created.

 

This is what I got so far, but I am stuck.

 

Would appreciate your help

trigger test1 on Contact (after insert) { List<SelfServiceUser> newSSU = new List<SelfServiceUser>(); for (Contact c : Trigger.new) { SelfServiceUser s = null; if (c.RecordTypeId == '01220000000135y') { s = new SelfServiceUser(); s.ContactId = c.Id; s.Email = c.Email; s.FirstName = c.FirstName; s.LastName = c.LastName; s.IsActive = true; } newSSU.add(s); } insert newSSU; }

 

The errors and problems I have are;

 

1. I get an error as follow:

 

Severity and Description Path Resource Location Creation Time Id Save error: DML not allowed on SelfServiceUser Test/src/triggers test1.trigger line 23 1238057376540 70

 -- I guess I cannot create SSU like this - what is the correct way than?

 

2. I think that  my workflow is wrong, but not sure how to fix.

 

Would appreciate any help.

 

 

 

I am new to force.com

 

I am learning, and for some reasong, nothing works.

 

I have created a trigger:

 

//update Fax if LastName equals saar trigger TestContactNEw on Contact (after insert) { if (Trigger.new[0].LastName == 'saar') Trigger.new[0].Fax = '555'; }

 

I have created a testclass

 

@isTest private class TestNewContact { static testMethod void myUnitTest() { // TO DO: implement unit test Contact c = new Contact(); c.LastName = 'saar'; test.startTest(); insert c; test.stopTest(); } }

 

I am getting 2 errors

1. on the test class I get on the insert c line:

 

// Error Severity and Description Path Resource Location Creation Time Id System.DmlException: Insert failed. First exception on row 0; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, TestContactNEw: execution of AfterInsert caused by: System.Exception: Record is read-only Trigger.TestContactNEw: line 6, column 24 Test/src/classes TestNewContact.cls line 31 1237986283019 35

 

 2. on the trigger I get

 

Severity and Description Path Resource Location Creation Time Id Average test coverage across all Apex Classes and Triggers is 50%, at least 75% test coverage is required Test line 1 1237985915541 32

 

 

I don't have ANY other trigger or class in my organization, and if these small simple just work out for me, ill know how to move on (hopefully)

 

Appreciate your input.

 

 

 

 

 

 

We are currently using our application to create new contacts in SF. What I need now, is to be able to enable SSP for these users.

 

In all the posts so far, I saw it's impossible, and I need to use a trigger. I am not familiar with triggers, and I think that the samples in the lab day are not sufficient, but that's another post :-P

 

I would truly appreciate a sample code or an alternate method to enable SSP to a newly created contact.

 

The sample code I got from one of the posts is:

 

 

trigger EndSSUAccessWhenContactIsSetToFormerUser on Contact bulk (after update) { Set<Id> lConIds = new Set<Id>(); for (Contact c : Trigger.new) { lConIds.add(c.Id); } List<SelfServiceUser> lSSUs = new List<SelfServiceUser>([select Id, IsActive, ContactId from SelfServiceUser where ContactId in :lConIds]); Map<Id,SelfServiceUser> lSelfServiceUsers = new Map<Id,SelfServiceUser>(); for(SelfServiceUser s: lSSUs) { lSelfServiceUsers.put(s.ContactId,s); } List<SelfServiceUser> lSelfServiceUserUpdates = new List<SelfServiceUser>(); for (Contact c : Trigger.new) { SelfServiceUser s = lSelfServiceUsers.get(c.Id); if(c.OMG_ContactType__c == 'Former User' && s != null && s.IsActive) { s.IsActive = false; lSelfServiceUserUpdates.add(s); if(lSelfServiceUserUpdates.size() == 200) { //update lSelfServiceUsersUpdates; lSelfServiceUserUpdates.clear(); } } } if(lSelfServiceUserUpdates.size() > 0) { //update lSelfServiceUsersUpdates; } }

 

This is a pure copy&paste but I am doing it since I can not grasp the idea of the triggers yet.

 

I will rally appreciate any help that will help me to solve this.

 

 

I am trying to convert an enterprise object to partner one, but I am missing something.

 

Can someone tell me if it's possible at all?  please see attached code.

 

What I want basiclly is the name retrieved from the Account. Do I need to change the code?  

limitations:

I need to use the partner binding for the query. - So I need to work on the partner query result.

 

If I can get the account name from the retrieved data while in partner binding, please show me  :-)

 

 

 

try
{
// retrieve the account name to display on the form
SFpartner.sObject[] sObjects = m_partnerBinding.retrieve("Id, Name",
"Account",
new String[] { l_formData.getAccountId() });

SFenterprise.Account retrievedAccount = (SFenterprise.Account)sObjects[0];
//l_formData.setAccountName(retrievedAccount.Name);
// store account name in trxData for later retrievel 13236
l_trxData.m_accountName = retrievedAccount.Name;

}

 

 

 

Message Edited by saariko on 03-19-2009 12:38 PM

Our application uses the regular SF. During development we work our application with the sandbox, we use the webreference accordingly.

 

The big Q is:

Is there a way to work with one application, but to be able to login to either sandbox or production instances?

Hi,

 

I need an advise on how to solve this sale process.

 

I need a way that when a product is sold in the regular way, it is some how getting credited to a specific account and custom object.

After that, we have an internal process that upon request, checks if that account and custom object pair has a valid credit for that product, and  if that's true, we use that credit.

 

I don't want nor think I need to use assets.  I would like that once an opportuinity closes successfully, than the credit will be shown.

 

Your advise here please.

I am building an application, and I want that my users will be actually SSP users. Is it possible?

 

I have my own site, and I code in .NET.

 

I want that if a user has SSP access, than he will be able to log to my site.

 

How is it possible?

 

thanks

I am trying to create a new DatedConversionRate through an API call, but I keep getting an error message.
I can't find any examples for this feature, so I really need some help please.

The error I get is "invalid parameter value"
and than: UNKNOWN_EXCEPTION  (In captial)


This is the code, your help will be appreciated

Please look at the
else if (rbDated.Checked)   part. this is where I handle multicurrency. The first part works perfectly.
Thanks
Code:
        private void updateFunction(string updatedId, string toCurISO)
        {
            formActive(false);
            setResultText("Updating new currency."); 
            
            //            SFenterprise.sObject[] records = binding.query();

            SFenterprise.sObject[] updateCurrencies = new SFenterprise.sObject[1];

            if (rbStandard.Checked)
            {
                
                SFenterprise.CurrencyType newCurrency = new CurrencyUpdater.SFenterprise.CurrencyType();

                newCurrency.Id = updatedId;

                newCurrency.ConversionRate = Convert.ToDouble(txtNewValue.Text);
                newCurrency.ConversionRateSpecified = true;

                updateCurrencies[0] = newCurrency;

            }
            else if (rbDated.Checked)
            {
                SFenterprise.DatedConversionRate newDatedCurrency = new CurrencyUpdater.SFenterprise.DatedConversionRate();

                newDatedCurrency.Id = updatedId;
                newDatedCurrency.ConversionRate = Convert.ToDouble(txtNewValue.Text);
                newDatedCurrency.ConversionRateSpecified = true;
                newDatedCurrency.StartDate = dateTimePicker1.Value.ToUniversalTime(); 
                newDatedCurrency.StartDateSpecified = true;
                newDatedCurrency.IsoCode = toCurISO;

                updateCurrencies[0] = newDatedCurrency;

            }

            setResultText("Updating SalesForce");
            SFenterprise.SaveResult[] sr = binding.update(updateCurrencies);

            txtResult.Text = sr.ToString();
            formActive(true);
        }

 

I have successfully installed E2C to use Google apps.

The thing is that the attachments are:
1. Large attachments are ripped form the message and stored on the local server directory. (Nothing is written in the created case to mention it)
2. Small attachments vaporize !!!  They are not saved to SF, nor to the local directory. - The user registred with E2C is an administrator, and can create and edit attachments.

Anyone  
I have a custom object which is a child of Account.
I used to have it as a lookup field.
I have changed the relationship from Lookup to Master/detail in order to have the same owner on the custom object as on the account.

The problem now is that my API appliation can not update the custom object. I get the attached error
http://i62.photobucket.com/albums/h119/saariko/Snap1.jpg

please help.

Saar

Hi All,

I have created a small utility that enables you to easily login to your SF acount, view your current currencies and values, and update them.

The reason I did it was that I found it dificult and annoying to use the current SF method (too heavy).

It's written in C# and I have created a project in SourceForge.net for it. (not approved yet).

I don't really have other places to upload it, but if anyone is interested, I will hapily send it to you.

edit:
I added an option to update the values from an online webservice at: www.webservicex.net   - it's so super easy now!!!

simon, might you want to have a look?

Cheers,

Saar

Message Edited by saariko on 10-16-2007 09:02 AM

Hi,
Just want to share with you a problem and a solution that I had.

Description:
- I have a complicated structure of objects and child objects that my API creates them.
- I can not allow my users to create the same objects using the regular web interface, because the process is too complicated.
- The same user has access to both the API application and the web (regular SF)

Problem:
- How to limit the creation of new objects from the web, and not the API? 
- Currently, the solution was to make a special profile to enable API usage only, but than that user would not have access to the web, and another license would need to be purchased.

Workaround:
1. I created a field in the objects. The field is viewable to the users.
2. I removed that field from the Page Layouts of the users.
3. Added a validation rule on the field so when new objects are created the validation rule checks them for a specific value.
4. Added the field with the correct value in my API.

Solved.


Can someone please explain what is the process of Save to Server and Deploy to Server

And to which env should I do what?  

 

 - I have both Sandbox and Production env

 

 - Do I need to first deploy to DEV - than when i need to update, can I just save?

 

Or is there another workflow requirement?

Excuse me for the NOOB Q

 

I am using the X.IDE

 

My first project included an email processor, which works perfectly, and is deployed to the server.

 

Now that I want to create a new trigger (which has nothing to do with the emailProcessor) 

 

 - Should I create a new project for that?

 - Is there a rule of thumb to when to create a new project?  (to all triggers? all classes? all related objects?)

 

Thanks

I am trying to update the field: IsUnreadByOwner - when a lead status changes to: Unqualified.

 

this is my trigger:

trigger UnqualifiedLead on Lead (before update) {
	for(Lead lead: Trigger.new)
	{
		if (lead.Status == 'Unqualified')
		{
			lead.IsUnreadByOwner = false;	
			update lead;
		}
	}
}

 

And my trigger:

@isTest
private class UnqualifiedLeadTest {

    static testMethod void myUnitTest() {
        // Setup the lead record
        Lead lead = new Lead();
        lead.LastName = 'last';
        lead.FirstName = 'First';
        lead.Company = 'Company';
        lead.Status = 'Unqualified';
        insert lead;
        lead.IsUnreadByOwner = True;
        update lead;
    }
}

 

i have a feeling, that the "update lead;" line is wrong, but not sure how to check if the change works.

 

Appreciate the help.

 

This is the error log I get

 

*** Deployment Log ***
Result: FAILED
Date: July 17, 2012 5:49:07 PM IDT

# Deployed From:
   Project name: Email2Lead
   Username: saar....@.com
   Endpoint: www.salesforce.com

# Deployed To:
   Username: saar.....@.com
   Endpoint: www.salesforce.com

# Deploy Results:
   File Name:    package.xml
   Full Name:  package.xml
   Action:  UPDATED
   Result:  SUCCESS
   Problem: n/a

   File Name:    triggers/UnqualifiedLead.trigger
   Full Name:  UnqualifiedLead
   Action:  UPDATED
   Result:  SUCCESS
   Problem: n/a

# Test Results:

Run Failures:
  UnqualifiedLeadTest.myUnitTest System.DmlException: Update failed. First exception on row 0 with id 00QD000000VgQJHMA3; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, UnqualifiedLead: execution of BeforeUpdate

caused by: System.SObjectException: DML statment cannot operate on trigger.new or trigger.old

Trigger.UnqualifiedLead: line 7, column 1: []

 

I have written an Apex class, that converts incoming emails according to the toAddress  (I know, it's great - thanks ^^ )

 

anyway, it is working perfect, when I send the email to the emailService generated address. However, in order that my users will not see such addresses, I create an alias group in our mail server (google for instance) and give the name a more suitable/readable name.

Here where the class breaks.

 

First debug code is with the direct address, as you can see, the SOQL returns 1 row (as should)

10:21:15.091 (91499000)|SOQL_EXECUTE_BEGIN|[33]|Aggregations:0|select Id from User where Alias = :tmpVar1
10:21:15.097 (97818000)|SOQL_EXECUTE_END|[33]|Rows:1

 

Second log, is when using th elias/group  (the only address in the group is the same one as in first example) however, this time, nothing is returned from the SOQL

10:14:46.127 (127098000)|SOQL_EXECUTE_BEGIN|[33]|Aggregations:0|select Id from User where Alias = :tmpVar1
10:14:46.132 (132488000)|SOQL_EXECUTE_END|[33]|Rows:0

 

I assume it's something in the way either Google transforms/creates/forwards email?

 

Anyone has an idea?

Ok, so I have created my first Apex Class.

I was able to save it to my sandbox, and everything works as planned. I am getting an error when trying to deploy to my production server, ok, so I have created a test class, but I don't understand why/how and what is needed.

 

I get 2 main errors: 1. Assertion error

2. only 72% of code is covered.

 

I'd appreciate a pointer as to what's and how I should attack this.

 

My code inherits from inbound email:

 

My inboundEmail class:

 

global class inboundEmail implements Messaging.InboundEmailHandler {

    global Messaging.InboundEmailResult handleInboundEmail(Messaging.InboundEmail email, Messaging.InboundEnvelope envelope) {
        Messaging.InboundEmailResult result = new Messaging.InboundEmailresult();


    Account account;
    Lead lead;
String [] mFromUserParams; String [] sourceText; String mCaseObject; try{ sourceText = email.toAddresses[0].split('@'); String [] mParams = sourceText[0].split('\\.'); mFromUserParams = email.fromAddress.split('@'); mCaseObject = mParams[0]; if (mCaseObject == 'lead'){ lead = new Lead(); lead.LastName = mFromUserParams[0]; lead.Company = email.fromAddress; lead.OwnerId = mParams[1]; lead.LeadSource = mParams[2]; lead.Email = email.fromAddress; lead.RequirementsDescription__c = email.subject + email.plainTextBody; insert lead; result.success = true; } else if (mCaseObject == 'case'){ } else { result.success = false; } }catch(Exception e){ result.success = false; result.message = 'Oops, I failed.'; } return result; } }

 

My inboundEmailText class as currently configured: What I did, is create a new envelope, an email and a header, and populated all the fields that are to be populated as if a real email is coming. Is that what's the idea with testing?

 

Where is my problem?

@isTest
private class inboundEmailTest {

 // Success Case
   public static testMethod void inboundEmail(){
        
        // Create a new email, envelope object and Header
        Messaging.InboundEmail email = new Messaging.InboundEmail();
        Messaging.InboundEnvelope envelope = new Messaging.InboundEnvelope();
        Messaging.InboundEmail.Header hditem= new Messaging.InboundEmail.Header();

		email.headers = new Messaging.InboundEmail.Header[1];
		hditem.name='Date';
		hditem.value='Tue, 28 Apr 2009 14:08:37 -0700';
		email.headers[0]=hditem;

		envelope.toAddress = 'lead.idinboundmail@eihnp2ha.c-cpeneac.cl.apex.sandbox.salesforce.com';
        envelope.fromAddress = 'user@acme.com';
        email.subject = 'Please contact me';
        email.fromName = 'Test From Name';
        email.plainTextBody = 'Hello, this a test email body. for testing purposes only.Phone:123456 Bye';

        // setup controller object
        inboundEmail catcher = new inboundEmail();
        Messaging.InboundEmailResult result = catcher.handleInboundEmail(email, envelope);
        System.assertEquals( result.success  ,true);
    }
}

 

on deployment, I get that most lines from inboundEmail class are not covered.

 

As for the assertion test - shouldn't I check that the actual class did what it's supposed to?  why does the check must be: false?

 

 

This is a question about a general HOWTO setup some SF objects we have today.

 

- We are a software company, and we sell our software (which is built of modules) .  We secure each module with a hardware USB dongle (Aladdin)

- Today, I have 2 custom objects to faciliate this:

1. License

2. Module

 

For each license I can have many modules, as well as add a module after any period of time. Each module has a version number (according to the released software version).

 

 

My main question is: Is there a way to combine our opportuinities with the modules? What I mean, is that when a module is sold, I want that the specific account will get some kind of a +1 indicator for that specific module, and than, I can select any License that is attached to that Account, and make the connection.

 

I tried to work with Assets, but it didn't lead to anything productive.

 

Would love to hear some input.

 

 

When we create/enable a new selfserviceuser (ssu) through SF interface, there is an option to check the box for: Create and email a new password to the user.

 

Today, in our code, we manage to create a new user, create a new SSU for this user, and we manually do a setpassword, and set an email to the user. 

 

Is it possible to do the email password via the API?  

 

 

I also think that something is weird when doing a reset password. The fact that I get the new password of the user is wrong. It should not be like that.

I need to create enable a new SelfServiceUser when a contact of specific record type is created.

 

This is what I got so far, but I am stuck.

 

Would appreciate your help

trigger test1 on Contact (after insert) { List<SelfServiceUser> newSSU = new List<SelfServiceUser>(); for (Contact c : Trigger.new) { SelfServiceUser s = null; if (c.RecordTypeId == '01220000000135y') { s = new SelfServiceUser(); s.ContactId = c.Id; s.Email = c.Email; s.FirstName = c.FirstName; s.LastName = c.LastName; s.IsActive = true; } newSSU.add(s); } insert newSSU; }

 

The errors and problems I have are;

 

1. I get an error as follow:

 

Severity and Description Path Resource Location Creation Time Id Save error: DML not allowed on SelfServiceUser Test/src/triggers test1.trigger line 23 1238057376540 70

 -- I guess I cannot create SSU like this - what is the correct way than?

 

2. I think that  my workflow is wrong, but not sure how to fix.

 

Would appreciate any help.

 

 

 

I am new to force.com

 

I am learning, and for some reasong, nothing works.

 

I have created a trigger:

 

//update Fax if LastName equals saar trigger TestContactNEw on Contact (after insert) { if (Trigger.new[0].LastName == 'saar') Trigger.new[0].Fax = '555'; }

 

I have created a testclass

 

@isTest private class TestNewContact { static testMethod void myUnitTest() { // TO DO: implement unit test Contact c = new Contact(); c.LastName = 'saar'; test.startTest(); insert c; test.stopTest(); } }

 

I am getting 2 errors

1. on the test class I get on the insert c line:

 

// Error Severity and Description Path Resource Location Creation Time Id System.DmlException: Insert failed. First exception on row 0; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, TestContactNEw: execution of AfterInsert caused by: System.Exception: Record is read-only Trigger.TestContactNEw: line 6, column 24 Test/src/classes TestNewContact.cls line 31 1237986283019 35

 

 2. on the trigger I get

 

Severity and Description Path Resource Location Creation Time Id Average test coverage across all Apex Classes and Triggers is 50%, at least 75% test coverage is required Test line 1 1237985915541 32

 

 

I don't have ANY other trigger or class in my organization, and if these small simple just work out for me, ill know how to move on (hopefully)

 

Appreciate your input.

 

 

 

 

 

 

I am trying to convert an enterprise object to partner one, but I am missing something.

 

Can someone tell me if it's possible at all?  please see attached code.

 

What I want basiclly is the name retrieved from the Account. Do I need to change the code?  

limitations:

I need to use the partner binding for the query. - So I need to work on the partner query result.

 

If I can get the account name from the retrieved data while in partner binding, please show me  :-)

 

 

 

try
{
// retrieve the account name to display on the form
SFpartner.sObject[] sObjects = m_partnerBinding.retrieve("Id, Name",
"Account",
new String[] { l_formData.getAccountId() });

SFenterprise.Account retrievedAccount = (SFenterprise.Account)sObjects[0];
//l_formData.setAccountName(retrievedAccount.Name);
// store account name in trxData for later retrievel 13236
l_trxData.m_accountName = retrievedAccount.Name;

}

 

 

 

Message Edited by saariko on 03-19-2009 12:38 PM

Our application uses the regular SF. During development we work our application with the sandbox, we use the webreference accordingly.

 

The big Q is:

Is there a way to work with one application, but to be able to login to either sandbox or production instances?

I am building an application, and I want that my users will be actually SSP users. Is it possible?

 

I have my own site, and I code in .NET.

 

I want that if a user has SSP access, than he will be able to log to my site.

 

How is it possible?

 

thanks

Newbie here..any help appreciated.

In my sfdcConfig.txt, I have:

<largeAttachmentDirectory>\\sfdcfiles\</largeAttachmentDirectory>
<largeAttachmentURLPrefix>file:\\sfdcfiles\</largeAttachmentURLPrefix>

Where exactly should this dir be? I keep getting "Invalid directory specified for large attachments"

TIA
Hi there
I have created 2 SSP users, that seem to have the same properties.
Manually, via the regular web console, i succeed to log-in with both users.
 
But when i try to log in using the APEX api (using the sample c# program), only one of them succeeds to log in. I tried to reset password, and even to re-create the second user. but it won't log in.
The error i get:

"INVALID_LOGIN: Invalid username or password or locked out."

 
What's the difference between the 2 log in methods? (API call VS. web console)
Both users are active, of course.
 
Attached a snapshot with the users' details.
 
 
I am working to install Email2Case for a client who by rule will not store any passwords on a computer in plan-text.  If you've worked with the toolkit, you know that the config is done in 2 text files.  Has anyone added onto the package with password encryption to make it more secure?  Just wondering before I start going down this road.
 
Thanks!