• Anuj.Shukla
  • NEWBIE
  • 0 Points
  • Member since 2010

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

Hi All,

I have one strange requirement.
I need to create "Time taken" field on Case object (and also can create this field on any standard/custom object).
Assuming that my all objects have these two fields 
  • Start time
  • End time
Time taken will be calculated as difference of end time & start time (if start time and end time have proper entries). 
Now, I need to write a generic code, that would populate the time taken field whenever I update an object 
(and if object being updated has these above mentioned 3 fields, this I can find out)
I can very well write an update trigger for every object and then populate time taken field but this will have to be replicated for any future custom object.
My intended logic should be generic, and should be called irrespective of Object being updated 
(something like a global trigger which checks what's the object being updated, and then update the time taken field of that object).

Is this possible in Salesforce? I have no idea, please help.
Thanks,
Anuj

 

Hi All,

 

I have following requirements:

 

>>I have to show a dropdown which should list all the custom objects as well as all the customizable standard objects (non customizable objects should be excluded).

 

>>I also need to write a method which would return me list of fields for the object name I pass to this method.

 

Can somebody help me with these two solutions?

 

 

Thanks,

Anuj

 

Hi,

 

I am getting stuck at some place in Case module.

 

We are planning to setup some assignment & Escalation rules for Case object.

 

We have created some 10 case assignment rules and around 30 case escalation rules.

What is happening that, the moment I make one of these active, other become inactive.

 

Is it that I can have only one active case escalation rule and only one active case assignment rule at a time?

 

Please help me on this.

Hi,

 

Please see my latest reply in this question thread.

 

http://boards.developerforce.com/t5/Apex-Code-Development/help-required-in-redirecting-to-a-new-page/td-p/229133

 

It would be gerat if someone can help me on this.

 

 

Thanks,

Anuj

Hi,

 

We have built a new tab as "partner" which is very similar to standard tab Account.

 

What we need to do:

In Account tab, when new Account button is created,

  • we need to see what is role of logged in user
  • if logged in user role is Channel Sales manager, redirect to new partner page
  • if logged in user role is NOT Channel Sales manager, continue as expected and show create new account page.

I have overridden new Account button and am calling an apex page on it. On the extension of this apex page, I have written out the logic to get the logged in user role. I am able to get the role of logged in user.

 

This is well printed on Systems debug.

 

But, I do not know how to redirect to partner apex page (is case it is CSM) or continue to new standard Account page (in case non CSM) from an apex class.

 

Please help me on this one.

 

 

Thanks,

Anuj, the 'Newbie'

Hi,

 

I am writing an apex class where I have to refer certain pre-known values (I will run validation against these pre-known values). Initially I had thought to use a custom object with just one field and store as many object values as I can. Then I was planning to get those values using simple query against custom object.

 

But my customer insists that I should not be using a custom object. Rather, I should be using a static resource (some sort of text file with pre-known values) and I should read that text file using apex code. I have not done this thing before.

 

I know how to upload a text file as static resource but I have absolutely no idea of how would I read that text file in my apex code.

 

I have to read that file, get all the values that have been mentioned in text file (each individual entry  in new line) in a LIST.

I can take it from there. 

 

Just help in 'how to read static resource of text file' would be appreciated.

 

 

Thanks,

Anuj

Hi All,

I have one strange requirement.
I need to create "Time taken" field on Case object (and also can create this field on any standard/custom object).
Assuming that my all objects have these two fields 
  • Start time
  • End time
Time taken will be calculated as difference of end time & start time (if start time and end time have proper entries). 
Now, I need to write a generic code, that would populate the time taken field whenever I update an object 
(and if object being updated has these above mentioned 3 fields, this I can find out)
I can very well write an update trigger for every object and then populate time taken field but this will have to be replicated for any future custom object.
My intended logic should be generic, and should be called irrespective of Object being updated 
(something like a global trigger which checks what's the object being updated, and then update the time taken field of that object).

Is this possible in Salesforce? I have no idea, please help.
Thanks,
Anuj

 

Hi,

 

We have built a new tab as "partner" which is very similar to standard tab Account.

 

What we need to do:

In Account tab, when new Account button is created,

  • we need to see what is role of logged in user
  • if logged in user role is Channel Sales manager, redirect to new partner page
  • if logged in user role is NOT Channel Sales manager, continue as expected and show create new account page.

I have overridden new Account button and am calling an apex page on it. On the extension of this apex page, I have written out the logic to get the logged in user role. I am able to get the role of logged in user.

 

This is well printed on Systems debug.

 

But, I do not know how to redirect to partner apex page (is case it is CSM) or continue to new standard Account page (in case non CSM) from an apex class.

 

Please help me on this one.

 

 

Thanks,

Anuj, the 'Newbie'

Hi,

 

I am writing an apex class where I have to refer certain pre-known values (I will run validation against these pre-known values). Initially I had thought to use a custom object with just one field and store as many object values as I can. Then I was planning to get those values using simple query against custom object.

 

But my customer insists that I should not be using a custom object. Rather, I should be using a static resource (some sort of text file with pre-known values) and I should read that text file using apex code. I have not done this thing before.

 

I know how to upload a text file as static resource but I have absolutely no idea of how would I read that text file in my apex code.

 

I have to read that file, get all the values that have been mentioned in text file (each individual entry  in new line) in a LIST.

I can take it from there. 

 

Just help in 'how to read static resource of text file' would be appreciated.

 

 

Thanks,

Anuj