• Alex Tennant
  • NEWBIE
  • 215 Points
  • Member since 2014
  • Desynit Limited


  • Chatter
    Feed
  • 7
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 29
    Replies
I've created a Custom Object "Related List A", with two custom lookup fields: "Current" and "Related", with Related List Labels "Current" and "Related" respectively. The Related List is to be added to a custom account object "PPI".

If I'm in PPI Account A and add another PPI Account (B) to the Related field it will populate under the Current list label for Account A and under the Related List label for Account B. So to make these Accounts have a two-way relationship, I'd have to add both related lists "Current" and "Related" to the Related List A layout, which looks crappy. 

I'm wondering if there is a way to create a two-way relationship with one addition into a related field list? If I associate PPI Account B with PPI Account A in the Related field, why can't they both appear in each other's Related Lists?

This may be convoluted, it's difficult for me to lay it out without showing, haha. I hope someone can help. Thanks!!
Hi,

I am getting below error in test class for trigger on Case obj.

System.DmlException: Update failed. First exception on row 0; first error: MISSING_ARGUMENT, Id not specified in an update call: []

Trigger is working properly without any issues.
This Trigger adds Entitlement value on case based on related Service Contract.

Trigger :
trigger writeEntitlement on Case (after insert) {
    
   List<Case> caseInTrigger = [select id,Service_Contract__c,Case.EntitlementId from Case where id = :Trigger.NewMap.KeySet()];
   ID serviceContID;
   for(Case c : caseInTrigger)
   {
         serviceContID = c.Service_Contract__c;
   }
    
    ServiceContract sc = [select id,Entitlement__c from ServiceContract where id = :serviceContID];
    
    for(Case c : caseInTrigger)
    {
    
        c.EntitlementId = sc.Entitlement__c;
    }
    
    update caseInTrigger;
    
}

Test Class :
 

@isTest 
private class writeEntitlementTest {
    static testMethod void validatewriteEntitlement() {
    
     test.startTest(); 
    
       Case c = new Case();
        
       c.Service_Contract__c='81090000000D1lK';
       c.Origin='Web';
       c.Status='New';
       
       //insert c;
    
       ServiceContract sc = new ServiceContract();
       sc.id = '81090000000D1lK';
       sc.Entitlement__c = '55090000000D4pk';
   
    
  //     System.assertEquals(c.EntitlementId, sc.Entitlement__c);
       c.EntitlementId='55090000000D4pk';
       update c;
       
      test.stopTest();  

    }
}
Thanks & Regards,
Mayur
  • August 07, 2014
  • Like
  • 0
Hi folks,
        Can tell me how to extract the text from rich text area field if it contanis html tag anf image


Please Help!

Hi, 

  There are few users in our organization requesting to get accesto MERG ACCOUNT tool

  I am having a administrator role am able to see Please suggest me how to enabe this feature to users

Thanks

Sudhir

Hi

I need to change the ownership of several hundred Opportunities. The following appears to work (no errors) however when I run a query, the test opportunity assigned to this person is still assigned to the original owner. It's as is the record is not getting updated. I have tried the Mass Reassign Opportunities with the same result. The records remain with original owner.

Where is the problem. Btw I am system administrator

List<Opportunity> ops= new List<Opportunity>([select Owner.Name from Opportunity where Owner.Id='005m0000000bLBhAAM']);


if (!ops.isEmpty()){
for(Opportunity o: ops){
     o.Owner.Id='005600000017YNqAAM';
        o.Owner.FirstName = 'Kevin';
        o.Owner.LastName = 'Languedoc';
      System.debug(ops); 
}
update ops;
}
This VF page also displays future activities, but this are displayed -10hours, so the user who is booking the activity is getting wrong available times.
The way that I am using to send the datetime into VF page is by json.serialize.
i.e:this is what the vf page is receiving:
[{"title":"Meeting 1","start":"2014-08-01T08:30:00.000Z","id":"Meeting1","end1":"2014-08-01T10:30:00.000Z"}]
when the time for this appointment should be at 6.30pm
The way I am sending the time from VF Page to Controller
jQuery( 'input[id$=StartDateVisualForcePage]' ).val(Date.parse(start));
startMeetingTime = datetime.valueOf(StartDateVisualForcePage);
I am using arshaw calendar
  • July 30, 2014
  • Like
  • 0
I've created a Custom Object "Related List A", with two custom lookup fields: "Current" and "Related", with Related List Labels "Current" and "Related" respectively. The Related List is to be added to a custom account object "PPI".

If I'm in PPI Account A and add another PPI Account (B) to the Related field it will populate under the Current list label for Account A and under the Related List label for Account B. So to make these Accounts have a two-way relationship, I'd have to add both related lists "Current" and "Related" to the Related List A layout, which looks crappy. 

I'm wondering if there is a way to create a two-way relationship with one addition into a related field list? If I associate PPI Account B with PPI Account A in the Related field, why can't they both appear in each other's Related Lists?

This may be convoluted, it's difficult for me to lay it out without showing, haha. I hope someone can help. Thanks!!
I'm following this tutorial on installing the Force.com IDE in Eclipse 4.2:
https://developer.salesforce.com/page/Force.com_IDE_Installation

However, I enter the update location, Eclipse doesn't find anything at that URL:
User-added image

The update location URL from the tutorial:
http://media.developerforce.com/force-ide/eclipse42

When I open the update location in Chrome, this is what I get:
User-added image

It looks like something is wrong with the repository at that URL.
Is anyone else having issues with this?
Hi,

I am getting below error in test class for trigger on Case obj.

System.DmlException: Update failed. First exception on row 0; first error: MISSING_ARGUMENT, Id not specified in an update call: []

Trigger is working properly without any issues.
This Trigger adds Entitlement value on case based on related Service Contract.

Trigger :
trigger writeEntitlement on Case (after insert) {
    
   List<Case> caseInTrigger = [select id,Service_Contract__c,Case.EntitlementId from Case where id = :Trigger.NewMap.KeySet()];
   ID serviceContID;
   for(Case c : caseInTrigger)
   {
         serviceContID = c.Service_Contract__c;
   }
    
    ServiceContract sc = [select id,Entitlement__c from ServiceContract where id = :serviceContID];
    
    for(Case c : caseInTrigger)
    {
    
        c.EntitlementId = sc.Entitlement__c;
    }
    
    update caseInTrigger;
    
}

Test Class :
 

@isTest 
private class writeEntitlementTest {
    static testMethod void validatewriteEntitlement() {
    
     test.startTest(); 
    
       Case c = new Case();
        
       c.Service_Contract__c='81090000000D1lK';
       c.Origin='Web';
       c.Status='New';
       
       //insert c;
    
       ServiceContract sc = new ServiceContract();
       sc.id = '81090000000D1lK';
       sc.Entitlement__c = '55090000000D4pk';
   
    
  //     System.assertEquals(c.EntitlementId, sc.Entitlement__c);
       c.EntitlementId='55090000000D4pk';
       update c;
       
      test.stopTest();  

    }
}
Thanks & Regards,
Mayur
  • August 07, 2014
  • Like
  • 0
I have a Custom object Leave Application ,in that start date and end date are there and also the field leave_taken__c is there how to calculate the no.of leave taken between the two dates and which exclude the weekends and public holidays.
Hi,my profile is system admin.
(developer edtion)
now i provide grant account login access from settings it provide login link to one user only.here i want login link for every user how can i please help me
User-added image
Hi folks,
        Can tell me how to extract the text from rich text area field if it contanis html tag anf image


Please Help!
Hi Folks ,

Can anyone Brief me on this topic?

I shall appreciate your help.

How Does EMAIL LOOP PROTECTIONS WORKS IN EMAIL TO CASE PREMIUM???


Thanks in Advance
  • August 06, 2014
  • Like
  • 0
trigger partneracClone on account (after update) {

// accounts ids to query
Account[] accToClone = new Account[]{};
Account [] accToSave = new Account[]{};

Set<Id> AccountIds = new Set<Id>();
For(account acc : trigger.new)
{
     AccountIds.add(acc.id);
accToClone.add(acc);
}
if (accToClone.size() > 0)
{
// query accounts and store by there name to lookup it up quickly
    Map<Id,Account> accountMap = new Map<Id,Account>([
        select  Id  , Name,Description,Phone,Fax  from Account where Id IN: AccountIds]);

    // clone
    for (Account acc :accToClone)
    {   Account theClone = new Account();


       
        theClone.Name =  accountMap.get(acc.id).Name;
        theClone.Type =  accountMap.get(acc.id).Type;
        theClone.Phone =  accountMap.get(acc.id).Phone;

        theClone.Fax =  accountMap.get(acc.id).Fax;
        theClone.Description =  accountMap.get(acc.id).Description;

        accToSave.add(theClone);
    }

    insert accToSave;
}}


i am able to save the trigger but after saving there is no cloned account, only the onw which i create is there
I have created a Big VF page.
i want to add "Back to Top" link at the bottom of my VF page which, once you clicked  it will take them back to top of page and cursor point to specific field.

I wrote the code:
<div align="right"> <a href="#" ID="#backToTop"> Back To Top</a> </div>
but this is returing back to top of page. but i dont know how to set the cursor position.

Please help me to get this.
Thanks.


  • August 05, 2014
  • Like
  • 0
I have a custom object called Charter with a lookup relationship with accounts. I have created an apex trigger in opportunity to create Charter records. I am not getting any errors with the trigger but the records are also not created.

Does anyone knows why is this happening or is what I am trying to do even possible?
Hi,

I've a link in my visualforce page, which renders the data as Excel. However, post developement, I wanted to do some performance tuning and to reduce the view state size, have declared the list variable (having the complete set of data to be displayed) as transient. As a result, no values are being passed to the next VF page.

As of the moment, I've removed the transient type and it is working fine. However, if there is any way to pass transient values to subsequent pages, it will be very useful as I'm worried about the view state size in case of a huge volume of data.

Thanks...!!

~Ayan
Hi, I am learning REST apis, in which I can post a single record but now I want to handle a bulky calls.  Anyone having an example for the same?...I googled it but I am confused about how to start...so want a runinig code if possible. Thanks in advance