• netbrain
  • NEWBIE
  • 0 Points
  • Member since 2009

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

I do not know how to do
 
Who has  detailed develop document

 

thants

I want to integrate our bugzilla with salesforce. I followed the instructions in this page:http://wiki.developerforce.com/index.php/Bugzlla_Integration_with_Salesforce.com

 

But it seems that there’s no way to create s-Control in salesforce.

Could you please tell me how can I create the connection between bugzilla and salesforce?

 

Thanks very much for your help!

I have one question about the Trigger problem, and the problem details is:

Account
   Name:ABC
Contact
   Email:a1@a.a


The Account(Name:ABC) plays the role as container and the Contact(Email:al@a.a) plays the role as being container.

For testing the relationships between the Account(Name:ABC) and Contact(Email:al@a.a), I have written down one testing method

as following:


@isTest

private with sharing class Test {
    static testMethod void myUnitTest()
    {
    List<Contact> sdfe=[select id,AccountId from Contact where Contact.Email=:'a1@a.a'];
    System.debug('contact account '+sdfe.get(0).AccountId);
        
    List<Account> aade=[select id,Name from Account where id=:sdfe.get(0).AccountId];
    System.debug(aade.get(0).Name);        
    
    List<Contact> sdfet=[select id,Email from Contact where Contact.AccountId=:sdfe.get(0).AccountId];
    if(sdfet.size()>0)
    {
        System.debug('contact emailt '+sdfet.get(0).Email);
    }    
    else
    {
        System.debug('no rows');
    }
        
    Account a=[select id from Account where Account.Name='ABC'];
    delete a;
        
    }
}


From the testing result, we can see that the key function flow works, however, while trying to invoke the Delete Trigger

command, the system sent the incorrect result back.




trigger AfterDeleteAccount on Account (after delete) {   
    for(Account a:trigger.old)
    {                
        System.debug('--------------------------');
        System.debug('delete account id '+a.Id);
        System.debug('delete account name '+a.Name);        
        List<Contact> sdfe=[select id,AccountId from Contact where Contact.Email=:'a1@a.a'];
        System.debug('contact size='+sdfe.size());
        System.debug('--------------------------');            
    }
}


Why?
Display the results:



20090922051611.515:Class.Test.myUnitTest: line 9, column 15: SOQL query with 1 row finished in 5 ms
20090922051611.515:Class.Test.myUnitTest: line 13, column 30: SOQL query with 1 row finished in 3 ms
20090922051611.515:Class.Test.myUnitTest: line 26, column 22: SOQL query with 1 row finished in 6 ms
20090922051611.515:Class.Test.myUnitTest: line 27, column 3: contact account 0014000000Orxxxxxx
20090922051611.515:Class.Test.myUnitTest: line 29, column 22: SOQL query with 1 row finished in 3 ms
20090922051611.515:Class.Test.myUnitTest: line 30, column 3: ABC
20090922051611.515:Class.Test.myUnitTest: line 32, column 23: SOQL query with 1 row finished in 5 ms
20090922051611.515:Class.Test.myUnitTest: line 35, column 4: contact account a1@a.a
20090922051611.515:Class.Test.myUnitTest: line 42, column 13: SOQL query with 1 row finished in 7 ms
20090922051611.515:Class.Test.myUnitTest: line 43, column 3: Delete: SOBJECT:Account
*** Beginning AfterDeleteAccount on Account trigger event AfterDelete for 0014000000Orxxx



20090922051611.640:Trigger.AfterDeleteAccount: line 3, column 2: SelectLoop:LIST:SOBJECT:Account
20090922051611.640:Trigger.AfterDeleteAccount: line 5, column 3: --------------------------
20090922051611.640:Trigger.AfterDeleteAccount: line 6, column 3: delete account id 0014000000Orxxxxxx
20090922051611.640:Trigger.AfterDeleteAccount: line 7, column 3: delete account name ABC
20090922051611.640:Trigger.AfterDeleteAccount: line 8, column 22: SOQL query with 0 rows finished in 5 ms
20090922051611.640:Trigger.AfterDeleteAccount: line 10, column 3: contact size=0
20090922051611.640:Trigger.AfterDeleteAccount: line 11, column 3: --------------------------


Cumulative resource usage:

Resource usage for namespace: (default)
Number of SOQL queries: 7 out of 100
Number of query rows: 6 out of 500
Number of SOSL queries: 0 out of 20
Number of DML statements: 1 out of 100
Number of DML rows: 1 out of 500
Number of script statements: 21 out of 200000
Maximum heap size: 0 out of 1000000
Number of callouts: 0 out of 10
Number of Email Invocations: 0 out of 10
Number of fields describes: 0 out of 10
Number of record type describes: 0 out of 10
Number of child relationships describes: 0 out of 10
Number of picklist describes: 0 out of 10
Number of future calls: 0 out of 10
Number of find similar calls: 0 out of 10
Number of System.runAs() invocations: 0 out of 20

Total email recipients queued to be sent : 0

*** Ending AfterDeleteAccount on Account trigger event AfterDelete for 0014000000Orxxx
Message Edited by netbrain on 09-21-2009 11:23 PM
Message Edited by netbrain on 09-21-2009 11:25 PM
Message Edited by netbrain on 09-21-2009 11:12 PM

code:

 

trigger LeadConvertoContact on Lead (after update) {
    for(Lead l :Trigger.new)
    {
        if(l.IsConverted==true)
        {
            List<UsageLog__c> uls=[select id,Contact__c,OwnerId from UsageLog__c where leadname__c=:l.Id and Contact__c=:''];
            for(UsageLog__c uc:uls)
            {
                uc.Contact__c=l.ConvertedContactId;       
                //uc.OwnerId=l.OwnerId;                   
            }

           

            //If I comment out this line of code  can be saved to the server    ....... why?           

           update uls;                 

        }
    }
}

 

 

THanks!

Message Edited by netbrain on 09-21-2009 11:16 PM

I do not know how to do
 
Who has  detailed develop document

 

thants

I have one question about the Trigger problem, and the problem details is:

Account
   Name:ABC
Contact
   Email:a1@a.a


The Account(Name:ABC) plays the role as container and the Contact(Email:al@a.a) plays the role as being container.

For testing the relationships between the Account(Name:ABC) and Contact(Email:al@a.a), I have written down one testing method

as following:


@isTest

private with sharing class Test {
    static testMethod void myUnitTest()
    {
    List<Contact> sdfe=[select id,AccountId from Contact where Contact.Email=:'a1@a.a'];
    System.debug('contact account '+sdfe.get(0).AccountId);
        
    List<Account> aade=[select id,Name from Account where id=:sdfe.get(0).AccountId];
    System.debug(aade.get(0).Name);        
    
    List<Contact> sdfet=[select id,Email from Contact where Contact.AccountId=:sdfe.get(0).AccountId];
    if(sdfet.size()>0)
    {
        System.debug('contact emailt '+sdfet.get(0).Email);
    }    
    else
    {
        System.debug('no rows');
    }
        
    Account a=[select id from Account where Account.Name='ABC'];
    delete a;
        
    }
}


From the testing result, we can see that the key function flow works, however, while trying to invoke the Delete Trigger

command, the system sent the incorrect result back.




trigger AfterDeleteAccount on Account (after delete) {   
    for(Account a:trigger.old)
    {                
        System.debug('--------------------------');
        System.debug('delete account id '+a.Id);
        System.debug('delete account name '+a.Name);        
        List<Contact> sdfe=[select id,AccountId from Contact where Contact.Email=:'a1@a.a'];
        System.debug('contact size='+sdfe.size());
        System.debug('--------------------------');            
    }
}


Why?
Display the results:



20090922051611.515:Class.Test.myUnitTest: line 9, column 15: SOQL query with 1 row finished in 5 ms
20090922051611.515:Class.Test.myUnitTest: line 13, column 30: SOQL query with 1 row finished in 3 ms
20090922051611.515:Class.Test.myUnitTest: line 26, column 22: SOQL query with 1 row finished in 6 ms
20090922051611.515:Class.Test.myUnitTest: line 27, column 3: contact account 0014000000Orxxxxxx
20090922051611.515:Class.Test.myUnitTest: line 29, column 22: SOQL query with 1 row finished in 3 ms
20090922051611.515:Class.Test.myUnitTest: line 30, column 3: ABC
20090922051611.515:Class.Test.myUnitTest: line 32, column 23: SOQL query with 1 row finished in 5 ms
20090922051611.515:Class.Test.myUnitTest: line 35, column 4: contact account a1@a.a
20090922051611.515:Class.Test.myUnitTest: line 42, column 13: SOQL query with 1 row finished in 7 ms
20090922051611.515:Class.Test.myUnitTest: line 43, column 3: Delete: SOBJECT:Account
*** Beginning AfterDeleteAccount on Account trigger event AfterDelete for 0014000000Orxxx



20090922051611.640:Trigger.AfterDeleteAccount: line 3, column 2: SelectLoop:LIST:SOBJECT:Account
20090922051611.640:Trigger.AfterDeleteAccount: line 5, column 3: --------------------------
20090922051611.640:Trigger.AfterDeleteAccount: line 6, column 3: delete account id 0014000000Orxxxxxx
20090922051611.640:Trigger.AfterDeleteAccount: line 7, column 3: delete account name ABC
20090922051611.640:Trigger.AfterDeleteAccount: line 8, column 22: SOQL query with 0 rows finished in 5 ms
20090922051611.640:Trigger.AfterDeleteAccount: line 10, column 3: contact size=0
20090922051611.640:Trigger.AfterDeleteAccount: line 11, column 3: --------------------------


Cumulative resource usage:

Resource usage for namespace: (default)
Number of SOQL queries: 7 out of 100
Number of query rows: 6 out of 500
Number of SOSL queries: 0 out of 20
Number of DML statements: 1 out of 100
Number of DML rows: 1 out of 500
Number of script statements: 21 out of 200000
Maximum heap size: 0 out of 1000000
Number of callouts: 0 out of 10
Number of Email Invocations: 0 out of 10
Number of fields describes: 0 out of 10
Number of record type describes: 0 out of 10
Number of child relationships describes: 0 out of 10
Number of picklist describes: 0 out of 10
Number of future calls: 0 out of 10
Number of find similar calls: 0 out of 10
Number of System.runAs() invocations: 0 out of 20

Total email recipients queued to be sent : 0

*** Ending AfterDeleteAccount on Account trigger event AfterDelete for 0014000000Orxxx
Message Edited by netbrain on 09-21-2009 11:23 PM
Message Edited by netbrain on 09-21-2009 11:25 PM
Message Edited by netbrain on 09-21-2009 11:12 PM

code:

 

trigger LeadConvertoContact on Lead (after update) {
    for(Lead l :Trigger.new)
    {
        if(l.IsConverted==true)
        {
            List<UsageLog__c> uls=[select id,Contact__c,OwnerId from UsageLog__c where leadname__c=:l.Id and Contact__c=:''];
            for(UsageLog__c uc:uls)
            {
                uc.Contact__c=l.ConvertedContactId;       
                //uc.OwnerId=l.OwnerId;                   
            }

           

            //If I comment out this line of code  can be saved to the server    ....... why?           

           update uls;                 

        }
    }
}

 

 

THanks!

Message Edited by netbrain on 09-21-2009 11:16 PM