• Vinod Tomar
  • NEWBIE
  • 75 Points
  • Member since 2011

  • Chatter
    Feed
  • 3
    Best Answers
  • 2
    Likes Received
  • 0
    Likes Given
  • 18
    Questions
  • 18
    Replies
Dear Salesforce Team,
Can somebody share his/her experience of integration SAP and SFDC. Actually we want to view data from SAP to SFDC and send data from SFDC to SAP without saving data in SFDC.

Can you please share your thought on this.

Best Regards,
VInod Kumar

Hi,

I am accessing custom setting values in my apex code and its working fine. When I am calling it through test class then No values gets in from Custom Setting. It always blank in test class. Can somebody help me to understand why custom settings values are not accessible in test class.

 

Thanks,

Vinod Kumar

Hi Friends,

In my company users are complaining that their contacts are getting deleted automatically. We are suspecting Outlook Integration might be the reason. But users does not change anything in the outlook or in SFDC still their contacts are getting deleted from SFDC.

 

Can somebody help us to get the solution of the issue.

 

Thanks,

Vinod Tomar

Hi I have written the below code to fufill some requirement. Can you hele me to write Test class for this code. Please keep in mind that we can not create eventattendee records using API

 

public with sharing class ctlr_participants {

private string eventid {get; set;}

public ctlr_participants (ApexPages.StandardController eventcontroller) {
this.eventid = eventcontroller.getId();


}

public List<EventAttendee> getparticipants(){

system.debug('eventID'+ this.eventid);
string str = this.eventid;
List<EventAttendee> participants = new List<EventAttendee>();
system.debug(str);
participants = [select AttendeeId from EventAttendee where eventid =: str ];
system.debug('count of attendee'+ eventparticipants.SIZE());
return participants ;
}

}

Hi All,

I am getting below error

 

System.NullPointerException: Attempt to de-reference a null object



 

in code

 

Integer monthChangecount  = firstDate.monthsBetween(newStartDate);

 

where firstdate is 2011-02-01 and newstartdate is 2011-01-01

Hi,

Our users are facing issues with Opportunity if they change owner at the time of opportunity creation then they get below error-

 

insufficient access rights on cross-reference id

 

If they dont change owner and save opportunity then it get saved successfully. If the same user open it again and change the owner then its gets update successfully.

 

Can somebody help me on this?

Hi,

Can you please let us know if we can create trigger on these objects-

 

Account Team
Open Activities
Partner
Contact Role
Activity History
Notes and Attachment

Hi,

There is 1 requirement where If we edit opportunity from edit button of opportunity related list on Account then after updating opportunity page should redirect to revenue schedule VF page not Account page.

 

Can you please let me know how can we do this?

I have one requirement where if on Account one checkbox is checked then nothing should be changed on Account. Also no record should be added to its all related list like Contact Opportunity, Activity etc. Do we have any standard functionality to achieve this requirement.

Appreciate your help.

I have one requirement where if on Account one checkbox is checked then nothing should be changed on Account. Also no record should be added to its all related list like Contact ,Opportunity, Activity etc. Do we have any standard functionality to achieve this requirement.

Appreciate your help.

We have 1 VF page. We have added link of this VF page from standard page layout. We have provided access of this VF page to some selected profiles. Rest of the profiles can not access the VF page  but they see the below error message on Standard page-

 

"Content can not be displayed: You have insufficient privileges to access the page"

 

Can somebody help us how to remove this error for the users who do not have access to VF page. We can create new page layout but we don't want to create this because we have plenty of page layout in our org.

We have 1 VF page. We have added link of this VF page from standard page layout. We have provided access of this VF page to some selected profiles. Rest of the profiles can not access the VF page  but they see the below error message on Standard page-

 

"Content can not be displayed: You have insufficient privileges to access the page"

 

Can somebody help us how to remove this error for the users who do not have access to VF page. We can create new page layout but we don't want to create this because we have plenty of page layout in our org.

We have code to share/unshare account with other Org using Salesforce to Salesforce connection. Code ws running fine but now when I unshare the account it throughs below error-

 

There were custom validation error(s) encountered while saving the affected record(s). The first validation error encountered was "Apex trigger shareAccountWithSalesforceToSalesforce caused an unexpected exception, contact your administrator: shareAccountWithSalesforceToSalesforce: execution of AfterUpdate caused by: System.DmlException: Delete failed. First exception on row 0 with id 04V300000003cBlEAI; first error: INVALID_OPERATION, operation is not allowed: []: Class.SalesforceToSalesforce.unshareRecords: line 32, column 3".

 

when I debugg the issue then found that deletion is not allowed in PartnerNetworkRecordConnection object and below exception occured-

 

System.DmlException: Delete failed. First exception on row 0 with id 04V300000003cBlEAI; first error: INVALID_OPERATION, operation is not allowed: []

 

Can somebody help me how can I unshare the account?

Hi,

I want to hide some objects from standard side seach bar. Can someone please help to hide this?

Hi,

We have 2 workflow. First workflow send an email if value of one field(say Amount) is greater than 50 and second workflow update Amount field to 0 in some condition.

 

Now the problem is if one user put the value 60 and hit the save button then email will be fired, but due to second workflow Amount value will 0.

 

When Amount value is 0 email should not be fired. I need a solution where 2nd workflow should always run first then first workflow should run.

 

Can somebody help me on this

Below is the function for edit access-

 

public static void verifyEditAuthority(Opportunity[] opportunityListNew,Opportunity[] opportunityListOld) {
        
        ClosedOpptyUserAccess__c oppEditAccess = ClosedOpptyUserAccess__c.getInstance();
        string oldStageName ='';       
        //Retreiving old stage value
        oldStageName = opportunityListOld[0].StageName;
                
        System.debug('oldStageName:  ' + oldStageName );
        for(Opportunity myOpp : opportunityListNew) {
            if (myOpp.StageName == 'Closed Lost' && !oppEditAccess .Can_Edit_Opportunity__c || !oppEditAccess .Can_Edit_Opportunity__c && oldStageName  == 'Closed Lost') {
                myOpp.addError('You do not have access to edit this opportunity because it is in a Closed Lost stage. Please contact the system administrator.');
            }
           
        }

 

In this code I am trying to stop editing the opportunity for some profiles. I am getting value of new stage through loop. but oldstage value for one record only. 

 

Now qurestion is would this work if we update multiple records?    

One user is not able to edit one dashboard others she can edit. Her profile has Manage Dashboard (All check box checked for Dashboard for her profile) and View All access still she is not able edit the dashboard.

 

Can somebody help me.

Hi,

Can any friend help me to view Login button at User detail page for another user. If I Iogin as system admin profile then I can see the login button but If I login using another profile then I am not able to see login button.

Hi,

I am accessing custom setting values in my apex code and its working fine. When I am calling it through test class then No values gets in from Custom Setting. It always blank in test class. Can somebody help me to understand why custom settings values are not accessible in test class.

 

Thanks,

Vinod Kumar

Hi All,

I had a requirement of adding the oppporunity amount to all of its contact roles. if the contact role added the opportunity, the amount of opportunity has be added to a field "Achieved" on contact Object. The contact might be a contact role on multiple opportunities. If the contact role has been removed from td the opportunity, the respective amount to be subtracted from Achieved field of Opportunity object.

Please do let me know how can i get the solution. I appreciate all of your responses with code or any recommendations.

 

Also i have attached a screenshot for better understanding and any other solution based on the image.

Thanks,
Veeru

 

Task - update Opportunity__c lookup field on case - from a text field on case with an opportunity id. This is my first coding task - but unsure how to troubleshoot the following issue.

 

Test code covers 100% in sandbox and manual testing of trigger works as required.  But ony 72% covered in production and it fails to delploy.

 

Here is class:

 

public class ImpCaseOppUpdate {
public static void ImpOppUpdate(Case[] oids) {
for (Case c :oids){
c.Opportunity__c = c.Opportunity_id_w__c;
}
}

}

 

 

Here is trigger:

 

trigger ImpCaseOppTrigger on Case (before insert,before update) 
{
Case[] oids = Trigger.new;
ImpCaseOppUpdate.ImpOppUpdate(oids);

}

 

Here is test class:

 

@isTest
private class ImpOppCaseTestClass{
 static testMethod void validateImpOppCase(){
Case c = new Case(Opportunity__c=Null,Opportunity_Id_w__c='006R0000007Jt1j');
System.debug('Opportunity before inserting new: ' +c.Opportunity__c);

insert c;

c=[SELECT Opportunity__c FROM Case WHERE Id=:c.id];
System.debug('Opportunity after trigger fired:' +c.Opportunity__c);

System.assertEquals('006R0000007Jt1j',c.Opportunity__c);
}
}

 

Here are the errors after attempting to deploy to production.

 

MassUpdateSimpleControllerTest.singleUpdateTest()

 

Failure Message: "System.NullPointerException: Attempt to de-reference a null object", Failure Stack Trace: "Class.MassUpdateSimpleController.__sfdc_fieldName: line 111, column 1 Class.MassUpdateSimpleControllerTest.singleUpdateTest: line 33, column 1"

 

Deploy Error

 

Average test coverage across all Apex Classes and Triggers is 72%, at least 75% test coverage is required.

Hi,

There is 1 requirement where If we edit opportunity from edit button of opportunity related list on Account then after updating opportunity page should redirect to revenue schedule VF page not Account page.

 

Can you please let me know how can we do this?

We are a small company that uses Salesforce and are looking to make it more effective by incorporating a workflow.  We need someone who can help us build this out, probably requiring an initial meeting followed by a few hours of work.

 

Please email me at cdonner@glconline.com if you are interested.

How can i take the backup of custom objects,classes,workflows,vf pages,triggers,components,layout and etc.,into an desktop.

 

As i developer edition we have reset security token,but in enterprises edition we dont have that option..soo can i connect enterprises edition with force IDE

 

 

 

 

We have 1 VF page. We have added link of this VF page from standard page layout. We have provided access of this VF page to some selected profiles. Rest of the profiles can not access the VF page  but they see the below error message on Standard page-

 

"Content can not be displayed: You have insufficient privileges to access the page"

 

Can somebody help us how to remove this error for the users who do not have access to VF page. We can create new page layout but we don't want to create this because we have plenty of page layout in our org.

We have 1 VF page. We have added link of this VF page from standard page layout. We have provided access of this VF page to some selected profiles. Rest of the profiles can not access the VF page  but they see the below error message on Standard page-

 

"Content can not be displayed: You have insufficient privileges to access the page"

 

Can somebody help us how to remove this error for the users who do not have access to VF page. We can create new page layout but we don't want to create this because we have plenty of page layout in our org.

This may not be the appropriate place to ask this question but I don't know if there is a discussion board about the force.com IDE. The problem I'm having is that the force.com IDE I just downloaded and installed is missing the Run Tests option. The docs I find about running tests all say to right click on a test class and then go to Force.com > Run Tests. Unfortunately the Run Tests option is missing.

 

Does have any suggestions for fixing this problem?

 

Thank you

We have code to share/unshare account with other Org using Salesforce to Salesforce connection. Code ws running fine but now when I unshare the account it throughs below error-

 

There were custom validation error(s) encountered while saving the affected record(s). The first validation error encountered was "Apex trigger shareAccountWithSalesforceToSalesforce caused an unexpected exception, contact your administrator: shareAccountWithSalesforceToSalesforce: execution of AfterUpdate caused by: System.DmlException: Delete failed. First exception on row 0 with id 04V300000003cBlEAI; first error: INVALID_OPERATION, operation is not allowed: []: Class.SalesforceToSalesforce.unshareRecords: line 32, column 3".

 

when I debugg the issue then found that deletion is not allowed in PartnerNetworkRecordConnection object and below exception occured-

 

System.DmlException: Delete failed. First exception on row 0 with id 04V300000003cBlEAI; first error: INVALID_OPERATION, operation is not allowed: []

 

Can somebody help me how can I unshare the account?

Is there a way to move trigger logic into an apex class?  I want to add a few lines into a current trigger that references an apex class that does the logic.  I'm running into trouble when trying to replicate the trigger in a class, mainly when I get to the Trigger.new method, can this be called into an apex class, as well as the Trigger.oldmap?

 

Here is the logic in the trigger, which works fine, it creates a record into a related list if a field changes.

 

Any advise?  Will the logic be possible to put into a class and how would I use the trigger.oldmap and Trigger.New methods?

 

Below is the trigger and then below this is the class I am trying to move it too:

 

trigger FieldChangeTrigger on QuoteLineItem (after update) {

 

List <QLI_History_Tracking__c> history = new List <QLI_History_Tracking__c>();

for (QuoteLineItem qli : Trigger.new) {

if(qli.UnitPrice != Null && qli.UnitPrice != trigger.oldMap.get(qli.Id).UnitPrice)
{
history.add(new QLI_History_Tracking__c (
Quote_Line_Item__c = qli.Id,
Sales_Price_From__c = trigger.oldMap.get(qli.Id).UnitPrice,
Sales_Price_To__c = qli.UnitPrice
));
}

if(history.size() >0)
{
insert history;
}

}

 

 

 

Here is what I will be changing the trigger into:

 


trigger FieldChangeTrigger on QuoteLineItem (after update) {

//need to copy all relevant fields so they will always pick up previous values when one is changed
//object wil be called pricing history

if(Trigger.isUpdate && Trigger.isAfter){

managePricingHistory.afterupdate(Trigger.New);

}

 

 

 

An then the above trigger will reference this class

 

public with sharing class managePricingHistory {


public static list<QuoteLineItem> afterUpdate(list<QuoteLineItem> qli) {

List <QLI_History_Tracking__c> history = new List <QLI_History_Tracking__c>();

 

for (QuoteLineItem qlit : Trigger.new) {  

// I'm getting an error message here that says "Loop variable must be of type SObject


}

if(history.size() >0)
{
insert history;
}

return qli;
}

}

 

 

 

 

Hi,

We have 2 workflow. First workflow send an email if value of one field(say Amount) is greater than 50 and second workflow update Amount field to 0 in some condition.

 

Now the problem is if one user put the value 60 and hit the save button then email will be fired, but due to second workflow Amount value will 0.

 

When Amount value is 0 email should not be fired. I need a solution where 2nd workflow should always run first then first workflow should run.

 

Can somebody help me on this

One user is not able to edit one dashboard others she can edit. Her profile has Manage Dashboard (All check box checked for Dashboard for her profile) and View All access still she is not able edit the dashboard.

 

Can somebody help me.

I need to add 50 users to the system ,  whats the efficient way to  load.  Is Data Loader an option ?

  • September 28, 2011
  • Like
  • 0

Hi,

Can any friend help me to view Login button at User detail page for another user. If I Iogin as system admin profile then I can see the login button but If I login using another profile then I am not able to see login button.