• Sujit Karande
  • NEWBIE
  • 45 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 41
    Questions
  • 15
    Replies
Hi Everyone, 

Hope you're doing great. I stuck at some point where I am not aware of how we can write a tests for below piece of code from main class
 
Case obj = new Case();

if(

((obj.field1=='Yes' || obj.field2=='Yes') && checkNull(obj.field3))

||

((obj.field4=='Yes' || obj.field5=='Yes') && checkNull(obj.field6))

)

Note : checkNull() is method in the same class which checks for blank values

I have around 30 such conditions in IF statement and for few of conditions, it is showing that Tests are passed as I checked it in Developer Console

How could we tackle this? 

Thanks for your help in advance
Hi Everyone,

I'm trying to create report which shows opporunities with products. I was able to show the multiple product name but how we can show multiple products with their respective sales prices. Is there any way we can achive this? or any workaround?

Thank you in advance for help. 

Here is my screenshot for more and exact information : 

User-added image
I have a Formula field "Renewal Date" whose return type is Date.

I am trying to create one more formula field say "Days Remaining For Renewal" which is nothing but (Renewal Date - Today)

But I'm getting null/blank values in field Days Remaining For Renewal.

Am I doing something wrong? Can you please help me with this?
 
Hi All,

I have a Date field in opportunity object say "Renewal Date

I want to create a formula field say "Final Renewal Date"(Because it needs to add into the report to show the final renewal date for existing opportunities)

What I am trying to achieve is 

If (Renewal Date == 1st day of month)        // For eg : 1 Aug 2018
{
     Final Renewal Date should be last day of previous month          // It should be 31 July 2018
}
else 
{
   Take renewal date as it is to the Final renewal date
}

Can we achieve this? It's so urgent, I stuck completely. Please help me :(
Hello Everyone,

One of Sales user has asked me that what does a Star icon mean on the Account Hierarchy Page, But for security purpose, I am not able to show any screenshot .

Any Suggestion?
Hello All,

I know how we can count the Number Of Attachment attached to the opprtunity using "Attach File" button, as we can use methods of Attachment class. 

But I also have one more button "Add Google Doc" and I would like to count the number of files attached to the Opportunity using Add Google Doc button.

(Some more info - When I upload file using Attach File button, it shows Type=Attachment, & when I upload it using Add Google Doc button, it shows Type=File)

Appreciate your help in advance.
Hi,

I have two DateTime fields ApprovedAt, SubmittedAt.

What I am trying to do is I would like to calculate turn around time by using this -> (ApprovedAt - SubmittedAt)

How we can do that in APex trigger? And what should be the type of field TurnAroundTime

I appreciated your help.
Hi Everyone,

I have created 3 fields in Case object (SubmittedAt, ApprovedAt, TurnAroundTime) and I want to make them null or blank when a case is rejected by approvers.

I know the normal way creating 3 different field updates on Final Rejection Action.

But is there any way to make these 3 fields blank or null in Only one field update?

Thank you,
Sujit
Hi everyone, 

I receive a requirement from clients where they wanted to track the Turn around time for approval processes.

We have approval processes for Case object and we want to calculate something like this : 

Turn Around Time = Time when a case is approved - Time when a case is submitted for approval

Any suggestion? 
Hello all, I have done alot of modifications in the sandbox and wanted to deploy the changes in the production (I do not have production access, so I want to make less mistakes in change set)

I have added new custom fields, updated existing page layputs, uptdated triggers. updated existing custom fields, updated apex classes, and updated visualforce page.

I would like to know what is the best sequence to add the components to the change set? 

Or is it good practice to create multiple change sets?

Any suggestions on this?
Below is the code for my test class.
Opportunity opp = [select Deal_Type__c from opportunity where Id: = <some id>]; 
Case objCase = new Case(); 

objCase.standard_or_nonstandard__c = 'Yes';

if(objCase.standard_or_nonstandard__c = 'Yes'){ // this if is getting tested 
    opp.Deal_Type__c = 'Standard'; 
}
 else{                                          // else part is getting skipped
     opp.Deal_Type__c = 'Not Standard'; 
}


And only first if condition is getting tested and other is skipping which is why the code is not reaching 75% off code coverage. 

the field standard_or_nonstandard__c  is picklist having two values Yes & No.

And if the value if Yes, the deal type should be standard, and if No, the deal type is not standard.

Any suggestion on this?
 
I have an apex class which checks for the value of String. For eg :
String region = opportunity.Region_c;
if(region!=null){
  if(region.equals('India')){
    //Do someting
  }
  else if(region.equals('US')){
     // do something
  }
}
And I have written a test class but it only tests if(region!=null) and inner if conditions are not getting tested which is why it is not reaching the criteria of 75% of code coverage.

Any suggestion how could I do this?
 
Hi,

My profile is System Administrator in one of Salesforce Org.

And there is one user who creates an opportunity and goes on leave.

So, I have been asked to change the owner of that opportunity to another user.

I tried changing the owner and get this error: There should be atleast one contact role before you update the record.

Any help or suggestion will be really appreciated.
Hello everyone,

I found a similar question on this forum but my problem is something different related to this.

In one of my approval process, the option "The approver's delegate may also approved this request" is checked. But in one of Users account, the delegated approver field is blank.

However, the manager field has manager name.

So, I would like to know if there is no delegated approver mentioned in the user's profile, does the approval routed to Manager?

Any suggestion will be really appreciated.
Hi, 

I have custom object in related list in Opportunity.

In Opportunity, I have picklict field named Region with values INDIA, UK, US

And depend on the region value, I want to show the value in formula field in related list.

For rg : If region is INDIA, the formmula field say State = Maharashtra

How should I do that?
I have related list called "Approvers" in opportunity object.

And I created few dummy records in approvers.

I am trying to fetch all those related list record associated with opportunity in apex trigger. As I wannted to assign values to the picklist field in realted list depend on Oppotunity pickist field value

For eg : Select all approvers where opportunity id="some-id";

Any suggestion would be really appreciated.
Hello everyone,

I have picklist field in opportunity object named Region having values India, America.

User-added image

And I have related list in opportunity called Additional Approval 

User-added image


In additional approval layout, I have a field called Billing Queue with values India Billing Queue, America Billing Queue, England Billing Queue

And I am trying to Auto-populate Billing Queue picklist depend on the value of Region..

For eg. If Region in opportunity is India, then Billing Queue value should populate with India Billing Queue and so on for America and England

User-added image

Any help or suggestion will be really appreciated
Hello Everyone,

I have a visualforce page on which I am showing some field depending on opportunity price book

Let's say, if Pricebook is the USA, the field will be  Newyork, California etc

And if Pricebook is the UK, the field will be London.

Remember, I have only one visualforce page and using isReneded function to display the field depending upon price book.

Now my problem is, currently I have only one Page layout which shows all the field, like Newyork, California, London etc after submitting visualforce page data.

And now I have created 2 separate layouts for 2 different price books (i,e USA, UK).

I would like to know, how should I trigger the page layout depending on price book? I want to show USA fields on the USA page layout and UK field on UK layout after submitting same visualforce page data.

Any help or suggestion will be really appreciated.
 
Hello Everyone.

I know that field level help text is allowed to 255 characters.

I would like to know what is the limit on the visualforce page?
Hello everyone, 

I hope you all are doing well.

I am working on some approval process and found something weird that was never happened before.

The issue is: whenever any approver approves the request, he/she need to approve it twice. I was working on approval process before, but that time I used to approve/reject for only one time.

Why is this happening? Any idea for resolution?
Hi Everyone, 

Hope you're doing great. I stuck at some point where I am not aware of how we can write a tests for below piece of code from main class
 
Case obj = new Case();

if(

((obj.field1=='Yes' || obj.field2=='Yes') && checkNull(obj.field3))

||

((obj.field4=='Yes' || obj.field5=='Yes') && checkNull(obj.field6))

)

Note : checkNull() is method in the same class which checks for blank values

I have around 30 such conditions in IF statement and for few of conditions, it is showing that Tests are passed as I checked it in Developer Console

How could we tackle this? 

Thanks for your help in advance
Hi All,

I have a Date field in opportunity object say "Renewal Date

I want to create a formula field say "Final Renewal Date"(Because it needs to add into the report to show the final renewal date for existing opportunities)

What I am trying to achieve is 

If (Renewal Date == 1st day of month)        // For eg : 1 Aug 2018
{
     Final Renewal Date should be last day of previous month          // It should be 31 July 2018
}
else 
{
   Take renewal date as it is to the Final renewal date
}

Can we achieve this? It's so urgent, I stuck completely. Please help me :(
Hi,

I have two DateTime fields ApprovedAt, SubmittedAt.

What I am trying to do is I would like to calculate turn around time by using this -> (ApprovedAt - SubmittedAt)

How we can do that in APex trigger? And what should be the type of field TurnAroundTime

I appreciated your help.
Hi Everyone,

I have created 3 fields in Case object (SubmittedAt, ApprovedAt, TurnAroundTime) and I want to make them null or blank when a case is rejected by approvers.

I know the normal way creating 3 different field updates on Final Rejection Action.

But is there any way to make these 3 fields blank or null in Only one field update?

Thank you,
Sujit
Hi everyone, 

I receive a requirement from clients where they wanted to track the Turn around time for approval processes.

We have approval processes for Case object and we want to calculate something like this : 

Turn Around Time = Time when a case is approved - Time when a case is submitted for approval

Any suggestion? 
Below is the code for my test class.
Opportunity opp = [select Deal_Type__c from opportunity where Id: = <some id>]; 
Case objCase = new Case(); 

objCase.standard_or_nonstandard__c = 'Yes';

if(objCase.standard_or_nonstandard__c = 'Yes'){ // this if is getting tested 
    opp.Deal_Type__c = 'Standard'; 
}
 else{                                          // else part is getting skipped
     opp.Deal_Type__c = 'Not Standard'; 
}


And only first if condition is getting tested and other is skipping which is why the code is not reaching 75% off code coverage. 

the field standard_or_nonstandard__c  is picklist having two values Yes & No.

And if the value if Yes, the deal type should be standard, and if No, the deal type is not standard.

Any suggestion on this?
 
Hi, 

I have custom object in related list in Opportunity.

In Opportunity, I have picklict field named Region with values INDIA, UK, US

And depend on the region value, I want to show the value in formula field in related list.

For rg : If region is INDIA, the formmula field say State = Maharashtra

How should I do that?
Hello all,

I am creating "Users with account and opportunities" report. My report looks like this :

User-added image
However, I am trying to get the users whose opportunities are closed/won. The report is giving me correct data, but the problem is some user's are having multiple opportunities which are closed/won.

I am trying to get only one user, so does not matter how many opportunities he/she closed. 

In short "I am trying to get the uniques users so that I will be able to know the count of users"

Is there any way or workaround to achive this? I will be really appreciated.
Hello,

I have opportunity inside which I have added some products, lets say p1, p2.

Those two products are having different price books. So if user select pricesbook1, product p1 is available to select.

And if user select pricebook2, product p2 is available to select.

So when user createn an ooportunity, I have added one Button which redirects user to custom visualforce page(say Form) where user needs to put the data and submit. 

And I would like to show the fields on that form depend on product's pricebook.

Lets say. if the product belongs to pricebook1, I will show only few fields on that form.

And if the product belongs to pricebook2, I will show it will show some other fields on that form.

I have done some R&D and found that "ISRENDERED" function might help. But Product object is lookup field inside opportunity. 

How could I check if the poduct's pricebook inside visualforce page?
Hello,

I hope you all are well. Here I am looking for some suggestion to proceed on one of requirement.

Consider, I have 10 fields in Case object :

Field1
Field2
Field3
....
Field10 

And whenever a user creates any opportunity, that user has to add the product. And let's say products are :

P1, P2

And on the opportunity page layout, I have one button which redirects user to create the Cases.

So now, depending on which product user has selected, I want to show those field.

Let's say, If product is P1, I want to show below fields

Field1
Field2
Field3

And if product is P2, I want to show below fields

Field4
Field5
Field6

And the remaining fields should present no matter what the product selected are.

Could you please help me on this?  Any help or suggestion will be really appreciated.
Hello,
     I am trying to create a database on my local machine and wanted to access that data into salesforce. I read some documents and get to know we can achive this using integration services like REST API, Web services etc. If anyone knows or implemented it, I will be happy to know it.
Hi,
1)what is meant by public group and why do we use pg in sfdc can anyout help me out with brief explanation?
2)what is meant by Queues and why do we use  queues in sfdc can anyone give me a explanation with example ?
 Difference between Public Group and Queue?
Advance Thanks.