• sh-at-yousee
  • NEWBIE
  • 250 Points
  • Member since 2010

  • Chatter
    Feed
  • 10
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 10
    Questions
  • 53
    Replies

I need to create a workflow rule based on the Opportunity Stage being closed and the product. I created a case with Salesforce and they said the only way that the workflow will trigger off of the Opportunity Product is if the product is edited. That's not the way our company currently is using opportunities. We create the opportunity along with the products and then at a later date when we close the opportunity, we don't edit the products. I can't imagine that we are the only company that does it this way. Does anyone have any other suggestions or best practices? How can I create a task when an opportunity closes based off of the product for that opportunity? Any help is greatly appreciated.

 

Thanks,

Wendy

Stumbling thru examples, I have successfully written and tested my first trigger.   I did this in my Sandbox and now want to deploy it to production.  I've installed the Migration Tool , Ant and Java SDK and done the required configurations.    But, the instructions for using Ant to move move it are too confusing and use too many terms I'm not familiar with.  Plus the Migration Tool User Guide is 25 pages long.  It can't be that complex to move a 6 line trigger from Sandbox to production.   Please help!

Hey!

 

For some reason there is diference in some fields in two profiles.

 

For "Admin" login, we have the MM/DD/YY format for dates. Whereas, for other profiles, it is DD/MM/YY.

 

Similarly, more disturbing is that: in ADMIN login, the mobile number occurs as (123) 456- 7890 and in other profiles, it is 1234567890 format.This is causing problems for us in certain validations.

 

Please help, from where can we remove these dissimilarities.

 

Require urgent help!

 

Thanks

Ruchi

I am trying to create a Javascript button to custom sort Quote Line Items by a custom field. All I have is:

doSort({!QuoteLineItem.Quote_Item_Number__c}, asc)

 

I have been trying to find an example of how to do this, but have come up short. Can anyone point me to an example or how to write a button from Javascript?

 

What is another way to achieve the same result?

 

Thank you

HI Every one,

 

   I have a custom object "Transactions".The fields are Id, Name, Amount, TransactionDate. How to calculate % change(Increase or decrease ) in amounts month to month this year. In this format I need to display.

 

Month         Amount received     % change(When compared to last month) 

 

 

Kindly help me its my urgent requirement.If any one worked on same requirement, please provide the code here, It will be a great help.

 

Thanks in advance,

Naresh

Hallo,

 

I am designing a force.com application with different locations. In these locations are different warehouses. Each user of the platform should only work with the items in the warehouse of the specific location. So the user should have a lookup-relationship to the location. But if I try to generate a customer field for the user a lookup-relationship is not possible. What can I do, to link the user to the location?

 

Thanks!

Harry

I need to identify how long specific users are logged into salesforce.com for. Currently, I just can see date/time stamps of when they modify records and when the login, but not time spent while logged in. This information is important to my business. How can his be done?

Hi,

 

Is there a way we can add cases to the Home page layout.

When ever users log in they should be able to view the cases assigned to them.

 

Any idea/help on this is highly appreciated.

 

Thanks,

Sales4ce

 

 

Hi,

The title pretty much says it all, is there a way to mark a text field as a password on a custom object? I haven't seen a way to do this.

Thanks

Hi all,

 

I have a trigger where the SOQL and DML statements fired are getting close to the govenor limits.

 

One of the issues is this:

    for(Opportunity o : Trigger.New) {
    	// This only concerns Opportunities being inserted
    	if(Trigger.isInsert) {
	    	// If it is the first Opportunity ensure that
	    	// Type is set to New Business.
    		account = [SELECT Id, Number_of_Opportunities__c FROM Account WHERE Id = :o.AccountId];
    		if(account.Number_of_Opportunities__c == 0) {
    			o.Type = 'New Business';
    		}
    	}
    }

 
Now, we all know it's a big no-no to have a select within a loop as the code above. My initial thought was I'd simply use this instead:

 

 

 

    for(Opportunity o : Trigger.New) {
    	// This only concerns Opportunities being inserted
    	if(Trigger.isInsert) {
	    	// If it is the first Opportunity ensure that
	    	// Type is set to New Business.
    		if(o.Account.Number_of_Opportunities__c == 0) {
    			o.Type = 'New Business';
    		}
    	}
    }

 
As you can see the select statement is now gone but this leaves me with another problem. It seems if I do that (access Number_of_Opportunities__c through o.Account it is null. Actually, it seems all fields found like that return null.

 

Any idea why?

 

Thanks.

 

/Søren Nødskov Hansen

 

Hi all,

 

I have posted this in the VisualForce section as well but maybe this part of it can be answered from someone in here. To see my follow-up comments please take a look at my VisualForce Board Message

 

I have a VF Page called SiteLogin which includes a component called SiteLogin.

The component is tied to a controller named SiteLoginController.

Now, when I type in my username and password in the form (component) and hit the login button all is well and I'm logged in.

I've tried to build a bit further on this controller so that in the constructor of the controller checks the URL parameters. If a username and password is found the login method is called. This also works as intended but I get the following error message back:

Error:This form must be secure. Use the 'forceSSL' attribute and set it to 'true.'

 

In the form-tag of the SiteLogin Component forceSSL is set to true. As a bit of additional info I can mention that Setup --> Develop --> Site --> Login Settings --> Require Non-Secure Connections (HTTP) is unchecked.

The same goes for Setup --> Security Controls --> Seesion Settings --> Require secure connections (HTTPS). So, this is also unchecked.

Checking either one of them didn't solve the problem for me.

If someone can tell me why (and how to go around this error) I would really appreciate it. Basically, what I'm looking for is a way to automatically log in the user if the credentials are provided in the URL.

Thanks.

/Søren Nødskov Hansen

 

Hi all,

 

I have a VF Page called SiteLogin which includes a component called SiteLogin.

 

The component is tied to a controller named SiteLoginController.

 

Now, when I type in my username and password in the form (component) and hit the login button all is well and I'm logged in.

 

I've tried to build a bit further on this controller so that in the constructor of the controller checks the URL parameters. If a username and password is found the login method is called. This also works as intended but I get the following error message back:

 

 

Error:This form must be secure. Use the 'forceSSL' attribute and set it to 'true.'

 

 

In the form-tag of the SiteLogin Component forceSSL is set to true. As a bit of additional info I can mention that Setup --> Develop --> Site --> Login Settings --> Require Non-Secure Connections (HTTP) is unchecked.

 

The same goes for Setup --> Security Controls --> Seesion Settings --> Require secure connections (HTTPS). So, this is also unchecked.

 

Checking either one of them didn't solve the problem for me.

 

If someone can tell me why (and how to go around this error) I would really appreciate it.

 

Thanks.

 

/Søren Nødskov Hansen

Hi,

 

We have a requirement that says to update case description with the body of the last inbound email. That part is easily handled with a workflow.

 

The workflow simply runs everytime an inbound email is created in the system and then carries out a field update where case description is updated with TextBody of the email.

 

However, some email clients only send out HTML emails and do not include a plain text version of the email body. In that case the description will be updated with nothing (empty string). A possible workaround for this is to check if the TextBody is empty and if not, use the TextBody else use HtmlBody.

 

The formula used as field update looks like this: IF(ISBLANK(TextBody), HtmlBody, TextBody)

 

And this is where the topic question comes into the picture. The problem is that HtmlBody contains all HTML tags as well which makes it impossible for users without HTML knowledge to read the text.

 

According to SF Premium Support, emails that arrive in the system are passed through a number of  "parsers" before the text is populated in the case description field and that's why the HTML codes aren't showing by default.

 

My question is this. Does anyone have experience with a HTML parser/stripper we could utilize in this situation? Basically, what we need is to remove any HTML tags, scripting tags, stylesheet tags etc. etc. and only be left with the plain text version of the email.

 

Thanks.

 

Søren Nødskov Hansen

Hi,

 

I have a class that search for cases where LastModifiedDate is 3 business days in the past. All cases found are modified and then updated accordingly.

 

My question is this: How do I create a test case in my test method where LastModifiedDate is e.g. 5 business days ago to ensure proper code coverage (nd verify the outcome?

 

Cheers.

 

Søren Nødskov Hansen

Hi all,

 

I'm just wondering if it is possible to use SOQL LIKE with IDs? I tried the following but without any luck.

 

 

List<Case> cases = [SELECT Id FROM Case WHERE Id LIKE '005%'];

 

 

What I'm trying to achieve is to fetch all cases owned by a user (and therefore not a queue). I know I could just fetch all active users and use IN but that would esentially create another query towards the database because I'd first have to fetch the users and then fetch the cases.

 

My current solution is this:

 

 

List<Case> cases = [SELECT Id, OwnerId, Urgent__c FROM Case WHERE (Owner.Profile.Name LIKE '%YFF%' OR Owner.Profile.Name LIKE '%YK%' OR Owner.Profile.Name LIKE '%YO%' OR Owner.Profile.Name LIKE '%YB%') AND OwnerId != '005200000013dtq' AND LastModifiedDate > :lastUpdated AND Reserve_Until__c = null];

 

I'm not too keen on this approach because I'd have to update this SOQL whenever a new profile should be added to the list which brings me back to my initial approach.

 

 

All suggestions are welcome.

 

Cheers.

 

/Søren Nødskov Hansen

Hi,

I've previously posted regarding recursive data structures. But, as it now turns out, it's still causing me some headache.

What I want to model is a many-to-many relationship between the same custom object.

My scenario is this:

I have a custom object called Sales Product. Any Sales Product has a Type of either Subscription, One-Time Fee or Bundle.

Now, the issue is this. In my data model a Sales Product of Type Bundle holds a list of other Sales Products (where Type isn't Bundle). However, these Sales Products (where Type isn't Bundle) must be able to be part of many bundles which brings me back to a many-to-many relationship between Sales Product and Sales Product.

When reading through the documentation of many-to-many relationships the followint is stated: "You cannot create a many-to-many self relationship, that is, the two master-detail relationships on the junction object cannot have the same master object."

I'm guessing it's exactly that sentence that's preventing me from creating a many-to-many relationship between 2 x Sales Product.

A recursive data structure is fairly common these days. Is there any known workaround for this limitation which would help me overcome my headaches?

Thanks.

 

/Søren Nødskov Hansen

Hi,

 

We're facing a bit of a challenge in my company and I hope someone here might be able to help.

 

The first challenge might be a bit off-topic but I'll give it a go anyway. How can one model a recursive data structure in SFDC?

 

Basically, we have a custom object called Sales Products which has a type. When type is "Bundle", we would like to be able to link a number of other Sales Products (same object but different type) to it.

 

The second challenge is displaying the Sales Products to select. It would be nice if we could list the existing Sales Products in e.g. a multi-select picklist but as I understand it the inputField shown is based on the actual type of field on the object (i.e. a text field will give a text field, a picklist will give a picklist and so on).

 

Does anyone have any good ideas on how to achieve both recursive data structure and a user friendly way of displaying the recursive link?

 

Cheers.

 

Søren Nødskov Hansen

All,

 

We have a button which takes the next case from a given queue, changes the owner to the logged in user and then displays the case to the customer service rep.

 

Now, if 2 customer service reps click the button simultaneously it can happen that they both get the case. Of course, only one of them acutually owns the case but they don't know that because it looks like they both own it (a refresh reveals the true owner).

 

We've tried locking the record using "for update" when fetching the case yet still it seems to be possible to end up with 2 different screens (on one screen the case is owned by user A and on the other it's owned by user B). Again, hitting F5 reveals the actual owner.

 

I was hoping that when trying to select for update I would get an exception which I could catch and from there do some error handling. However, it seems that either no exception is thrown or, if an exception is thrown, it isn't catchable.

 

Then I thought that maybe it would be possible to code my way out of it. E.g. using synchronized methods like in Java but it seems that is not yet possible in Apex (see http://forums.sforce.com/t5/Apex-Code-Development/quot-synchronized-quot-where-s-it-documented-Anyway-to-control/m-p/124811).

 

Has anyone else had a similar issue and if so, how was it solved (if it was solved...)?

 

Kind regards,

 

Søren Nødskov Hansen

I'm currently looking for a way to save a MS Word document directly from Word to SF. This is the procedure I want to simplify:

1. User creates a letter in SF using the standard mail merge functionality
2. Letter is opened in Word and fields have been merged
3. Letter is modified and saved to user's local hard drive
4. User (in SF) navigates back to the case and locates the attachments
5. User uploads locally saved document to SF as an attachment on the case

I want to replace those steps with the following (ideally replacing the last 2):

1. User creates a letter in SF using the standard mail merge functionality
2. Letter is opened in Word and fields have been merged
3. User hits CTRL-S (or a new/separate button) in MS Word which automatically saves the document directly back to the case (replacing any existing documents with the same filename)

I know there are options on the AppExchange that (partly) solves this problem but they are all huge apps providing a lot of functionality which is not needed. I "only" want that one button available in Word ;-)

Since SF already provides desktop integration for Word, Excel, Outlook etc. it must be possible. I'd be fine with doing the development myself but I need someone to point me in the right direction.

Thanks.

Søren Nødskov Hansen

All,

 

We have a button which takes the next case from a given queue, changes the owner to the logged in user and then displays the case to the customer service rep.

 

Now, if 2 customer service reps click the button simultaneously it can happen that they both get the case. Of course, only one of them acutually owns the case but they don't know that because it looks like they both own it (a refresh reveals the true owner).

 

We've tried locking the record using "for update" when fetching the case yet still it seems to be possible to end up with 2 different screens (on one screen the case is owned by user A and on the other it's owned by user B). Again, hitting F5 reveals the actual owner.

 

I was hoping that when trying to select for update I would get an exception which I could catch and from there do some error handling. However, it seems that either no exception is thrown or, if an exception is thrown, it isn't catchable.

 

Then I thought that maybe it would be possible to code my way out of it. E.g. using synchronized methods like in Java but it seems that is not yet possible in Apex (see http://forums.sforce.com/t5/Apex-Code-Development/quot-synchronized-quot-where-s-it-documented-Anyway-to-control/m-p/124811).

 

Has anyone else had a similar issue and if so, how was it solved (if it was solved...)?

 

Kind regards,

 

Søren Nødskov Hansen

Hi all,

 

I have a trigger where the SOQL and DML statements fired are getting close to the govenor limits.

 

One of the issues is this:

    for(Opportunity o : Trigger.New) {
    	// This only concerns Opportunities being inserted
    	if(Trigger.isInsert) {
	    	// If it is the first Opportunity ensure that
	    	// Type is set to New Business.
    		account = [SELECT Id, Number_of_Opportunities__c FROM Account WHERE Id = :o.AccountId];
    		if(account.Number_of_Opportunities__c == 0) {
    			o.Type = 'New Business';
    		}
    	}
    }

 
Now, we all know it's a big no-no to have a select within a loop as the code above. My initial thought was I'd simply use this instead:

 

 

 

    for(Opportunity o : Trigger.New) {
    	// This only concerns Opportunities being inserted
    	if(Trigger.isInsert) {
	    	// If it is the first Opportunity ensure that
	    	// Type is set to New Business.
    		if(o.Account.Number_of_Opportunities__c == 0) {
    			o.Type = 'New Business';
    		}
    	}
    }

 
As you can see the select statement is now gone but this leaves me with another problem. It seems if I do that (access Number_of_Opportunities__c through o.Account it is null. Actually, it seems all fields found like that return null.

 

Any idea why?

 

Thanks.

 

/Søren Nødskov Hansen

 

Hi all,

 

I have posted this in the VisualForce section as well but maybe this part of it can be answered from someone in here. To see my follow-up comments please take a look at my VisualForce Board Message

 

I have a VF Page called SiteLogin which includes a component called SiteLogin.

The component is tied to a controller named SiteLoginController.

Now, when I type in my username and password in the form (component) and hit the login button all is well and I'm logged in.

I've tried to build a bit further on this controller so that in the constructor of the controller checks the URL parameters. If a username and password is found the login method is called. This also works as intended but I get the following error message back:

Error:This form must be secure. Use the 'forceSSL' attribute and set it to 'true.'

 

In the form-tag of the SiteLogin Component forceSSL is set to true. As a bit of additional info I can mention that Setup --> Develop --> Site --> Login Settings --> Require Non-Secure Connections (HTTP) is unchecked.

The same goes for Setup --> Security Controls --> Seesion Settings --> Require secure connections (HTTPS). So, this is also unchecked.

Checking either one of them didn't solve the problem for me.

If someone can tell me why (and how to go around this error) I would really appreciate it. Basically, what I'm looking for is a way to automatically log in the user if the credentials are provided in the URL.

Thanks.

/Søren Nødskov Hansen

 

Hi all,

 

I have a VF Page called SiteLogin which includes a component called SiteLogin.

 

The component is tied to a controller named SiteLoginController.

 

Now, when I type in my username and password in the form (component) and hit the login button all is well and I'm logged in.

 

I've tried to build a bit further on this controller so that in the constructor of the controller checks the URL parameters. If a username and password is found the login method is called. This also works as intended but I get the following error message back:

 

 

Error:This form must be secure. Use the 'forceSSL' attribute and set it to 'true.'

 

 

In the form-tag of the SiteLogin Component forceSSL is set to true. As a bit of additional info I can mention that Setup --> Develop --> Site --> Login Settings --> Require Non-Secure Connections (HTTP) is unchecked.

 

The same goes for Setup --> Security Controls --> Seesion Settings --> Require secure connections (HTTPS). So, this is also unchecked.

 

Checking either one of them didn't solve the problem for me.

 

If someone can tell me why (and how to go around this error) I would really appreciate it.

 

Thanks.

 

/Søren Nødskov Hansen

Hello everyone,
I am facing a weird problem when updating lead owner based on some criteria in my trigger.I am getting two emails, one the default one from salesforce(out of box email functionality) and the other is a custom email triggered from my trigger. Is there any way we could restrict the salesforce default email or can we update the template that's being used for this out of box functionality?
(We don't have any auto response / assignment rules defined in the org)

Thanks in advance.

Pavan.

we need at least 40 fields for each member/contact of our organization. I got an error message when setting up our data - only "15 fields" allowed. how do we get around this? Salesforce will not work for us if we don't have at least 40 fields of information.

I would like to make it easier for users to update oppty product schedules. Currently, the schedule is buried in the opportunity product screen. Is there a way to build a list view to display the schedule months so users can edit all their opptys' schedules in one screen?

 

Thanks!

 

CL

  • November 29, 2010
  • Like
  • 0

I need to create a workflow rule based on the Opportunity Stage being closed and the product. I created a case with Salesforce and they said the only way that the workflow will trigger off of the Opportunity Product is if the product is edited. That's not the way our company currently is using opportunities. We create the opportunity along with the products and then at a later date when we close the opportunity, we don't edit the products. I can't imagine that we are the only company that does it this way. Does anyone have any other suggestions or best practices? How can I create a task when an opportunity closes based off of the product for that opportunity? Any help is greatly appreciated.

 

Thanks,

Wendy

HIII,

 

how to integrate salesforce with outlook 2010

 

plz help iam new to salesforce

Hi,

 

I need to make a page level workflow like:

 

I have 10 fields displaying on a page say GENERALINFO and some one update those fields and assigned this record for further Updates/modifications to someone else, Now, the next person see 10 previous fields and some additional fields for further modifications and reassign the record to some other higher/lower level person. So, same like this, a record is modifying by different users until it reaches its final step.

 

So, Is it some how possible to create a Workflow like this?

If yes, then can some one please provide the useful code or tutorial?

 

 

Thanks in advance

Himanshu Jain

Developer

 

HAPPY THANKS GIVING DAY!!!:manhappy:

  • November 26, 2010
  • Like
  • 0

What is the actual meaning of template in salesforce.com?

 

 

Regards:

SRI

  • November 26, 2010
  • Like
  • 0

I am new to Force.com development.

How do I do object inheritance?

I have created say a Person object and in my application there are several specializations of this Person identified as type. 

Instead of repeating all the fields of the Person object individually in these specializations, I thought I could create the specialization object as inherited from Person, so I get all content/layout of the Person.

 

I tried with Record Type and it is confusing if that is intended to serve what I want to do.

Is this possible?

 

Any help is appreciated

 

Thanks

Vidya

Stumbling thru examples, I have successfully written and tested my first trigger.   I did this in my Sandbox and now want to deploy it to production.  I've installed the Migration Tool , Ant and Java SDK and done the required configurations.    But, the instructions for using Ant to move move it are too confusing and use too many terms I'm not familiar with.  Plus the Migration Tool User Guide is 25 pages long.  It can't be that complex to move a 6 line trigger from Sandbox to production.   Please help!

Basically, start time and end time appear to always be equal.  It takes 5-10 minutes for Salesforce to deploy anything in our production org, so these times should reflect reality, not be arbitrarily equal.