• VJSFDC
  • NEWBIE
  • 55 Points
  • Member since 2011

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

Hi,

 

Im implementing one method in controller which is used as extension for a page, in the controller I a method which returns a pagereference.

 

And in the Page I have one JavaScript fiction which displays a alert messages.

 

But here that alert message was not working because first controller methods are executing first so that the js methods in page is not calling,.

 

is their any alternate way to execute the js methods first after that only controller methods.

 

 

I need to get the actual Parent ID from the Account object while querying a custom child object.  

 

I have an existing soql that looks like this...

 

// Build IDNumber list

Map<String,ID_Number__c> IDNumbers = new Map<String,ID_Number__c> (

    [select ID__c, Parent_Rate__c ),

    from ID_Number__c

    Where ID__c IN :idsToQuery] );

 

 

 

When I try this - I get an "enexpected token; 'from' error...

 

Map<String,ID_Number__c> IDNumbers = new Map<String,ID_Number__c> (

    [select ID__c, Parent_Rate__c ), (Select Parent, from Account),

    from ID_Number__c

    Where ID__c IN :idsToQuery] );

 

Any guidance?

 

Thanks!

Given that the Type = Solutions Renewal, it should send an email alert every time the StageName is changed from the list in red to the list in blue. This is for our opportunities.


and (

and (
ISPICKVAL(Type, "Solutions Renewal"),
OR (
ISPICKVAL(StageName, "Buyout - Notification Received"),
ISPICKVAL(StageName, "Removal - Notification Received"),
ISPICKVAL(StageName, "Buyout"),
ISPICKVAL(StageName, "Removed (non-renewal)")
)
),

or(
and(ISCHANGED(StageName), ISPICKVAL(StageName, "Renewal")),
and(ISCHANGED(StageName), ISPICKVAL(StageName, "Renewed as is (auto renewed)")),
and(ISCHANGED(StageName), ISPICKVAL(StageName, "Renewed/Replaced Existing Contract(s)"))
)

)

 

 

the syntax was ok. i also made an email alert connected to it. the problem i guess is within the logic. im not sure about the ISCHANGED function that i used.



Iam trying to calculate the age of lead between 2 owners, so here is what iam doing

 

1) I created Date field X

2) I created WFR with criteria ISCHANGED(OwnerId) then field update X = Now()

3) I created other Formula field  Y with data type Number .

4) I created WFR and iam trying to enter criteria such that

(ISCHANGED(OwnerId) <> (PRIORVALUE(OwnerId)))

 

but iam getting error here, any idea what this should be , on the 4th step iam comparing the current owner should not be equal to previous owner so i can update the number field Y with NOw() - X

 

I can explain it clearly if any confusions .

 

 

 

I am new to trigger writing having only written a few and I haven't found a good example to try and understand how to write this trigger. I am trying to write a trigger to update a lookup field (Zipcode_Lookup__c) on our Account object with the Account BillingPostalCode field if it is populated.

 

Here is what I have so far:

 

trigger territoryZip on Account (after update){
    if(trigger.isUpdate){
    for(Account a : trigger.new){
    a.Zipcode_Lookup__c = Account.getBillingPostalCode ();
    }
   }
  }

 

I've tried various things such as complicated mapping values to this very simple trigger and I consistantly receive Compile Errors with the Zipcode_Lookup__c = Account.BillingPostalCode entries.

 

Here is another version I've tried:

 

trigger

territoryZip onAccount (afterinsert, afterupdate){

 

for (Account acc : Trigger.New){

List<

Account> ListAccount = [SELECT BillingPostalCode from Account where AccountID =: acc.id];

 

for (Accountacc2 : listAccount2){

acc2.Zip_Code_Lookup = acc.BillingPostalCode;

}

updatelistAccount2;

}

}

 

I would appreciate any advice as I would really like to learn this concept of updating lookup fields on the same object.

 

Thank you!

 

Hi,

 

Im implementing one method in controller which is used as extension for a page, in the controller I a method which returns a pagereference.

 

And in the Page I have one JavaScript fiction which displays a alert messages.

 

But here that alert message was not working because first controller methods are executing first so that the js methods in page is not calling,.

 

is their any alternate way to execute the js methods first after that only controller methods.

 

 

Hi,

 

I want to customize my List View page to display some VF page.Is it possible to do that.?

 

Hello,

     Iam posting this again, but here is what iam trying to do , i just need this formula to work only if case is open, it should stop calculating the case age days once the case is closed , right now this formula excludes saturdays and sundays while calculating the age but even it keeps calculating while the case is closed any idea on how to avoid this ,here is what i have

 

CASE(
MOD(DATEVALUE(CreatedDate) - DATE(1900, 1, 7), 7),
0, (TODAY() - DATEVALUE(CreatedDate)) - 1 - FLOOR((TODAY() - DATEVALUE(CreatedDate))/7)*2,
1, (TODAY() - DATEVALUE(CreatedDate)) - FLOOR((TODAY() - DATEVALUE(CreatedDate))/7)*2,
2, (TODAY() - DATEVALUE(CreatedDate)) - FLOOR((TODAY() - DATEVALUE(CreatedDate))/7)*2,
3, (TODAY() - DATEVALUE(CreatedDate)) - FLOOR((TODAY() - DATEVALUE(CreatedDate))/7)*2,
4, (TODAY() - DATEVALUE(CreatedDate)) - FLOOR((TODAY() - DATEVALUE(CreatedDate))/7)*2,
5, (TODAY() - DATEVALUE(CreatedDate)) - 2 - FLOOR((TODAY() - DATEVALUE(CreatedDate))/7)*2,
6, (TODAY() - DATEVALUE(CreatedDate)) - 2 - FLOOR((TODAY() - DATEVALUE(CreatedDate))/7)*2,
null)


Any Help would be greatly appreciated!
Thanks

 

Ok, stupid question.....

 

How long do records stay in the recycle bin? The "help for this page" says 15 days. I thought it was 30 days, but was recently told by a SFDC instructor that it was 45 days...

 

So how long really?

Hi,

 

map<id,map<id,XYZ__c>> m1=new  map<id,map<id,XYZ__c>>();

 

How can i use nested maps as shown in above syntax.

Please send a sample example.

 

 

I'm trying to create a validation rule where a license opportunity can't be closed won if the acceptance clause still has TBD (it's a required field as well):

 

I was testing different formulas but they don't seem to be working, I tried the IF validation too but that one was just not letting me close anything at all.  Below is a sample of the latest one I tried:



AND 
(AND 
(ISPICKVAL(StageName, "Closed/Won"), (ISPICKVAL( Opportunity_Type__c,"License/Maintenance")), 
NOT(ISPICKVAL(Acceptance_clause__c, "TBD"))))

 

Please advise, thanks!

  • October 27, 2011
  • Like
  • 0

HI,

 

I am scratching my head hard on this one.  What seemed very simple -- I get zero coverage!  Does anyone have an idea what I am doing wrong?  Thanks

@isTEST
private class Utils_TEST {
    static testMethod void test_1() {        
        User currentUser = new User();
        currentUser = [ Select email, Name , id from User where username = :UserInfo.getUserName() limit 1 ];        
        List<String> toAddresses = new List<String> {currentUser.Email};
        String replyToAddress = currentUser.Email;  
        Test.StartTest();      
        Utils.EmailUtil email = new Utils.EmailUtil(toAddresses);
        email.plainTextBody('Utils.EmailUtil Test');
        email.htmlBody('Utils.EmailUtil Test');
        email.senderDisplayName(currentUser.Name);
        email.subject('Utils.EmailUtil Test');
        email.replyTo(replyToAddress);
        email.bccAddresses(toAddresses);
        email.sendEmail();
        Test.StopTest();
    }
}

 

 

 

 

Hi,

 

I have 2 objects, one custom object appointments__c and another salesforce's event object.

 

I want have data from both these objects to be in sync with each other. So i have written 2 triggers one each for each object where in if any appointment is created, a event is created and when event is created then appointment is created.

 

Issue here is that both the triggers would fire and would get into infinite loop and salesforce throws error.

 

Any ideas on how to get over this

 

Thanks

  • October 27, 2011
  • Like
  • 0

 

Hi,

 

When a quote is auto-populated from within an Opportunity record, can we limit the available contacts to only those within the connected Account. Currently we can pick any contact inside of SFDC.

 

Thanks and Regards

Hari G S

When trying to convert the DateTime to Date, I am getting this error -

 

Save error: Invalid type: reqt.Last_Submitted_Date__c   


 

 

List<Requirement__c> daysDiff = new List<Requirement__c>();


daysDiff = [Select CreatedDate, Last_Submitted_Date__c, Date_Last_Approved__c,Last_Rejected_Date__c FROM    Requirement__c WHERE Id IN :Ids];
  
System.debug('TEST----------'+daysDiff.size());
        
       for(Requirement__c reqt:daysDiff)   
      
           {         
        

               reqtrack = new Requirement_Tracking__c();
        
               if (reqt.Last_Submitted_Date__c!=''){
              

               reqtrack.Days_Elapsed__c = ((reqt.Last_Submitted_Date__c) - (DateValue(reqt.CreatedDate)));   
             
          }   
      

}        

 

  • October 26, 2011
  • Like
  • 0

I have 3 custom objects: A, B and C.

 

B: Has a master-detail relationship with A

C: Has a master detail relationship with B and a lookup relationship with A

 

If I am viewing a record of a custom object type B and I create from there a NEW record of type C, it automatically fills in the field that relates C to B, but the field that relates C to A is empty. Given that B is connected to a specific A, i would like that A to be related by default to C.

 

How can I do this? Does this need to be a new custom button?

  • October 26, 2011
  • Like
  • 0