• sswamina
  • NEWBIE
  • 0 Points
  • Member since 2011

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 7
    Questions
  • 9
    Replies

Hi all,

 

I have custom object which is master detail on opportunity. The custom object configured with page layout that has a custom button which on-click goes to VF page. 

 

When I click on "new"  from the custom object related list on opportunity the page does not contain the custom button. However when I click on edit page the button appears. What could be issue

 

Please help.

 

Thanks

Shuba

Hello all,

 

Have a custom button on opportunity page. The custom object and opportunity pages  are configured with page layouts for new & edit pages not VF.

 

 

I want to achieve the following:

  1) On click on that button for very first time want it to open up "new"page of the custom object. The second time on it should open up the "edit" page.
   2) I also want to be able to pass 2 or more parameters from the opportunity page to the new/edit pages, mainly for new page.

   3) On "Save" on the custom object page want it to redirect to opportunity view page.

 

Please can you provide me sample javascript or better way of doing that.

 

Thanks.

 

 

Following is Javascript used, but causing syntax errors without the redirect:

 

If ({!Opportunity.PQQ__c})
{!URLFOR($Action.PQQ__c.New, null,
[

"PQQ__c.Name"="{!Opportunity.Name}",
"PQQ__c.Opportunity__c"="{!Opportunity.Id}",
"save"="1"
],
true)}

else{{!URLFOR($Action.PQQ__c.Edit, null,
[

"PQQ__c.Name"="{!Opportunity.Name}",
"PQQ__c.Opportunity__c"="{!Opportunity.Id}",
"save"="1"
],
true)}

Hi all,

 

I have a look-up field on my lead object to custom object events i.e. my lead can be registered for a single event. On event object I have look-up to lead so that can have related list for event on my lead detail page.

 

However although I assign the event object by using a look-up icon on the lead the related event does not show up in the related list. How can I make it available, which table I need to update using APEX

 

Regards

Shuba

I have custom upload object, which I use to import the business data (accounts, contacts, opportunities) into this object using APEX data loader from excel.

 

I have a trigger on 'after insert' on this custom upload object, that calls custom APEX classes for accounts, contacts and opportunities. When I execute the upload,  the trigger executes sucessfully, the custom object record gets inserted however none of the other objects - account, contact or opportunities get created.

 

I dont see any errors in the debug log, it says the insert is sucessful and 3 rows updated but I dont see any account, contacts & opportunities.

 

Any thoughts why this could be? Do I need a lookup relationship from the custom object to account, contact & opportunities to be able to create those?

Hi all,

 

I wrote a class to create accounts and test class to simulate the sample accounts. When I run with apex test runner the execution is sucessful and almost 98% code coverage however the records does not get inserted. Is that by design that when you run from debugger no records are created in org? Thanks much for your help.

 

Here is what I get in debug log:

17:47:31.390 (390135000)|STATEMENT_EXECUTE|[42]
17:47:31.390 (390153000)|STATEMENT_EXECUTE|[43]
17:47:31.390 (390197000)|HEAP_ALLOCATE|[43]|Bytes:4
17:47:31.390 (390297000)|VARIABLE_ASSIGNMENT|[42]|account|{"Name":"Penuvchev","Phone":"416-783-4433","Site":"Primary","BillingCity":"ABC","BillingPostalCode":"M5M","OwnerId":"005Q0000000hcC7IAI","email_address__c":"andrewpen@rogers.com","Fax":"416-276-8080","BillingStreet":"250 Lawrence Avenue  (15 more) ...","BillingState":"ON"}|0xf43b20
17:47:31.390 (390321000)|STATEMENT_EXECUTE|[42]
17:47:31.390 (390339000)|STATEMENT_EXECUTE|[43]
17:47:31.390 (390384000)|HEAP_ALLOCATE|[43]|Bytes:4
17:47:31.390 (390430000)|VARIABLE_ASSIGNMENT|[40]|accountOwner|"Tara Gibson"
17:47:31.390 (390449000)|STATEMENT_EXECUTE|[40]
17:47:31.390 (390465000)|STATEMENT_EXECUTE|[41]
17:47:31.390 (390481000)|VARIABLE_SCOPE_BEGIN|[41]|newAccounts|LIST|true|false
17:47:31.390 (390603000)|VARIABLE_ASSIGNMENT|[41]|newAccounts|[{"Name":"Dr. Jeremy Kurtz","Phone":"416-789-0705","Site":"Primary","BillingCity":"Toronto","BillingPostalCode":"M5M 12","OwnerId":"00540000000sPQbAAM","email_address__c":"@rogers (4 more) ...","Fax":"416-789-937","BillingStreet":"533 Avenue","BillingState":"ON"}]
17:47:31.390 (390626000)|STATEMENT_EXECUTE|[42]
17:47:31.390 (390719000)|VARIABLE_ASSIGNMENT|[42]|account|{"Name":"Dr. Jeremy Kurtz","Phone":"416-789-0705","Site":"Primary","BillingCity":"Toronto","BillingPostalCode":"M5M 12","OwnerId":"00540000000sPQbAAM","email_address__c":"@rogers (4 more) ...","Fax":"416-789-937","BillingStreet":" Avenue","BillingState":"ON"}|0x167f32d
17:47:31.390 (390742000)|STATEMENT_EXECUTE|[42]
17:47:31.390 (390759000)|STATEMENT_EXECUTE|[43]
17:47:31.390 (390801000)|HEAP_ALLOCATE|[43]|Bytes:4
17:47:31.390 (390833000)|STATEMENT_EXECUTE|[47]
17:47:31.390 (390880000)|STATEMENT_EXECUTE|[47]
17:47:31.390 (390898000)|STATEMENT_EXECUTE|[48]
17:47:31.390 (390914000)|VARIABLE_SCOPE_BEGIN|[48]|insertResults|LIST|true|false
17:47:31.390 (390964000)|DML_BEGIN|[48]|Op:Insert|Type:Account|Rows:3
17:47:31.391 (391044000)|HEAP_ALLOCATE|[EXTERNAL]|Bytes:16
17:47:31.507 (507221000)|DML_END|[48]
17:47:31.507 (507275000)|HEAP_ALLOCATE|[EXTERNAL]|Bytes:16
17:47:31.507 (507517000)|VARIABLE_ASSIGNMENT|[48]|insertResults|[{"success":true,"id":"001Q000000N8C66IAF"},{"success":true,"id":"001Q000000N8C67IAF"},{"success":true,"id":"001Q000000N8C68IAF"}]
17:47:31.507 (507549000)|STATEMENT_EXECUTE|[49]
17:47:31.507 (507624000)|STATEMENT_EXECUTE|[49]
17:47:31.507 (507643000)|STATEMENT_EXECUTE|[50]
17:47:31.507 (507683000)|USER_DEBUG|[50]|DEBUG|Records for Accounts inserted successfully
17:47:31.507 (507713000)|STATEMENT_EXECUTE|[51]
17:47:31.507 (507778000)|METHOD_EXIT|[56]|01pQ0000000DvDb|AccountHelper.createAccounts()
17:47:32.111 (507831000)|CUMULATIVE_LIMIT_USAGE
17:47:32.111|LIMIT_USAGE_FOR_NS|(default)|
  Number of SOQL queries: 1 out of 100
  Number of query rows: 2 out of 50000
  Number of SOSL queries: 0 out of 20
  Number of DML statements: 1 out of 150
  Number of DML rows: 3 out of 10000
  Number of script statements: 81 out of 200000
  Maximum heap size: 0 out of 3000000
  Number of callouts: 0 out of 10
  Number of Email Invo

Hi all,

 

I have a custom object Territory__c in which there is lookup(User) Regional_Director field. I am trying to assign the Regional Director to appropriate user.

 

Following is the code in a trigger I have and want to update the regional director lookup field after insert. However it gives the following error: "Regional Director: id value of incorrect type:". It looks like terr.regional_director__c returns a SObject so the assignment may not work, how can I get it working? Thanks much for your help.

 

trigger addSalesDirReps on Territory__c (before insert) {
    Territory__c [] territoryList = trigger.new;
    List <Territory__c> updatedListToInsert= new List <Territory__c>();
       
    for(Territory__c terr: territoryList){
         List<User> lookupRMUser = [select Id from User where Name=:terr.Regional_Director_Name__c];
         terr.regional_director__c = lookupRM[0].Id;  
         updatedListToInsert.add(terr);
     }
    insert updatedListToInsert;

}

 

Hi,

 

I have installed the eclipse Helios 3.6 and the force.com plugin. However when I do Cntrl + Space the autocomplete code feature is not working.

 

I have 64 bit JDK - 1.6.0_25.

 

I have also enabled Java Proposals on Preferences -> Java->Editor->Content Assist-> Advanced.

 

Please help

Hi all,

 

I have custom object which is master detail on opportunity. The custom object configured with page layout that has a custom button which on-click goes to VF page. 

 

When I click on "new"  from the custom object related list on opportunity the page does not contain the custom button. However when I click on edit page the button appears. What could be issue

 

Please help.

 

Thanks

Shuba

Hi all,

 

I have a look-up field on my lead object to custom object events i.e. my lead can be registered for a single event. On event object I have look-up to lead so that can have related list for event on my lead detail page.

 

However although I assign the event object by using a look-up icon on the lead the related event does not show up in the related list. How can I make it available, which table I need to update using APEX

 

Regards

Shuba

I have custom upload object, which I use to import the business data (accounts, contacts, opportunities) into this object using APEX data loader from excel.

 

I have a trigger on 'after insert' on this custom upload object, that calls custom APEX classes for accounts, contacts and opportunities. When I execute the upload,  the trigger executes sucessfully, the custom object record gets inserted however none of the other objects - account, contact or opportunities get created.

 

I dont see any errors in the debug log, it says the insert is sucessful and 3 rows updated but I dont see any account, contacts & opportunities.

 

Any thoughts why this could be? Do I need a lookup relationship from the custom object to account, contact & opportunities to be able to create those?

Hi all,

 

I wrote a class to create accounts and test class to simulate the sample accounts. When I run with apex test runner the execution is sucessful and almost 98% code coverage however the records does not get inserted. Is that by design that when you run from debugger no records are created in org? Thanks much for your help.

 

Here is what I get in debug log:

17:47:31.390 (390135000)|STATEMENT_EXECUTE|[42]
17:47:31.390 (390153000)|STATEMENT_EXECUTE|[43]
17:47:31.390 (390197000)|HEAP_ALLOCATE|[43]|Bytes:4
17:47:31.390 (390297000)|VARIABLE_ASSIGNMENT|[42]|account|{"Name":"Penuvchev","Phone":"416-783-4433","Site":"Primary","BillingCity":"ABC","BillingPostalCode":"M5M","OwnerId":"005Q0000000hcC7IAI","email_address__c":"andrewpen@rogers.com","Fax":"416-276-8080","BillingStreet":"250 Lawrence Avenue  (15 more) ...","BillingState":"ON"}|0xf43b20
17:47:31.390 (390321000)|STATEMENT_EXECUTE|[42]
17:47:31.390 (390339000)|STATEMENT_EXECUTE|[43]
17:47:31.390 (390384000)|HEAP_ALLOCATE|[43]|Bytes:4
17:47:31.390 (390430000)|VARIABLE_ASSIGNMENT|[40]|accountOwner|"Tara Gibson"
17:47:31.390 (390449000)|STATEMENT_EXECUTE|[40]
17:47:31.390 (390465000)|STATEMENT_EXECUTE|[41]
17:47:31.390 (390481000)|VARIABLE_SCOPE_BEGIN|[41]|newAccounts|LIST|true|false
17:47:31.390 (390603000)|VARIABLE_ASSIGNMENT|[41]|newAccounts|[{"Name":"Dr. Jeremy Kurtz","Phone":"416-789-0705","Site":"Primary","BillingCity":"Toronto","BillingPostalCode":"M5M 12","OwnerId":"00540000000sPQbAAM","email_address__c":"@rogers (4 more) ...","Fax":"416-789-937","BillingStreet":"533 Avenue","BillingState":"ON"}]
17:47:31.390 (390626000)|STATEMENT_EXECUTE|[42]
17:47:31.390 (390719000)|VARIABLE_ASSIGNMENT|[42]|account|{"Name":"Dr. Jeremy Kurtz","Phone":"416-789-0705","Site":"Primary","BillingCity":"Toronto","BillingPostalCode":"M5M 12","OwnerId":"00540000000sPQbAAM","email_address__c":"@rogers (4 more) ...","Fax":"416-789-937","BillingStreet":" Avenue","BillingState":"ON"}|0x167f32d
17:47:31.390 (390742000)|STATEMENT_EXECUTE|[42]
17:47:31.390 (390759000)|STATEMENT_EXECUTE|[43]
17:47:31.390 (390801000)|HEAP_ALLOCATE|[43]|Bytes:4
17:47:31.390 (390833000)|STATEMENT_EXECUTE|[47]
17:47:31.390 (390880000)|STATEMENT_EXECUTE|[47]
17:47:31.390 (390898000)|STATEMENT_EXECUTE|[48]
17:47:31.390 (390914000)|VARIABLE_SCOPE_BEGIN|[48]|insertResults|LIST|true|false
17:47:31.390 (390964000)|DML_BEGIN|[48]|Op:Insert|Type:Account|Rows:3
17:47:31.391 (391044000)|HEAP_ALLOCATE|[EXTERNAL]|Bytes:16
17:47:31.507 (507221000)|DML_END|[48]
17:47:31.507 (507275000)|HEAP_ALLOCATE|[EXTERNAL]|Bytes:16
17:47:31.507 (507517000)|VARIABLE_ASSIGNMENT|[48]|insertResults|[{"success":true,"id":"001Q000000N8C66IAF"},{"success":true,"id":"001Q000000N8C67IAF"},{"success":true,"id":"001Q000000N8C68IAF"}]
17:47:31.507 (507549000)|STATEMENT_EXECUTE|[49]
17:47:31.507 (507624000)|STATEMENT_EXECUTE|[49]
17:47:31.507 (507643000)|STATEMENT_EXECUTE|[50]
17:47:31.507 (507683000)|USER_DEBUG|[50]|DEBUG|Records for Accounts inserted successfully
17:47:31.507 (507713000)|STATEMENT_EXECUTE|[51]
17:47:31.507 (507778000)|METHOD_EXIT|[56]|01pQ0000000DvDb|AccountHelper.createAccounts()
17:47:32.111 (507831000)|CUMULATIVE_LIMIT_USAGE
17:47:32.111|LIMIT_USAGE_FOR_NS|(default)|
  Number of SOQL queries: 1 out of 100
  Number of query rows: 2 out of 50000
  Number of SOSL queries: 0 out of 20
  Number of DML statements: 1 out of 150
  Number of DML rows: 3 out of 10000
  Number of script statements: 81 out of 200000
  Maximum heap size: 0 out of 3000000
  Number of callouts: 0 out of 10
  Number of Email Invo

Hi all,

 

I have a custom object Territory__c in which there is lookup(User) Regional_Director field. I am trying to assign the Regional Director to appropriate user.

 

Following is the code in a trigger I have and want to update the regional director lookup field after insert. However it gives the following error: "Regional Director: id value of incorrect type:". It looks like terr.regional_director__c returns a SObject so the assignment may not work, how can I get it working? Thanks much for your help.

 

trigger addSalesDirReps on Territory__c (before insert) {
    Territory__c [] territoryList = trigger.new;
    List <Territory__c> updatedListToInsert= new List <Territory__c>();
       
    for(Territory__c terr: territoryList){
         List<User> lookupRMUser = [select Id from User where Name=:terr.Regional_Director_Name__c];
         terr.regional_director__c = lookupRM[0].Id;  
         updatedListToInsert.add(terr);
     }
    insert updatedListToInsert;

}