• Amrender
  • NEWBIE
  • 204 Points
  • Member since 2009
  • Ghangas

  • Chatter
    Feed
  • 5
    Best Answers
  • 0
    Likes Received
  • 1
    Likes Given
  • 4
    Questions
  • 52
    Replies
Hi all,

I have 2 sandboxes with the Person Account mode.
I'm deploying changes using Force.com IDE and Migration Tool but I just can't find a way to deploy Person Account Picklist Values.
Whenever I add new values to any picklist in the Person Account Record and deploy the changes, all the picklist values in Person Account Record Type (that was created by salesforce) appear in the Available Values of the picklist rather than in the Selected Values.

I've gone through the Account.object xml and it looks like the Person Account Record type isn't there so I guess it has something to do with it but I can't figure out a way to add it.

I will appreciate any help... 
trigger updaterecord on Account (before insert){

for(Account acc: trigger.new){
Account acc1;
acc1.Type= 'prospecting';
update acc1;
}
}

its give error when m going to insert..
Error: Invalid Data. 
Review all error messages below to correct your data.
Apex trigger updaterecord caused an unexpected exception, contact your administrator: updaterecord: execution of BeforeInsert caused by: System.SObjectException: DML statment cannot operate on trigger.new or trigger.old: Trigger.updaterecord: line 7, column 1
 
Hello

I am facing issue with Prechat Form could not redirect to chat window and also prechat form information could not save as a contact record.

Hello all,
this problem is bugging me since days. Below code works as long as the SOQL query is successful (an account is found), else I get the following standard Salesforce error screen:

List has no rows for assignment to SObject 
An unexpected error has occurred. Your development organization has been notified.

Instead of that, I would like to implement a behavior that, both at the beginning or after pressing the NotOK butto, should be able to handle the case: "no accounts found" instead, showing a brief customized error message and then redirectng me to salesforce homepage.

Below my code. I think I lack some basic knowledge, probably some of you is able to provide me with a solution..

public class Account_Controller_2 
{
    public Account account;

    public Account_Controller_2()  {}
    
	public Account getAccount() 
    {
        account = [SELECT Id, Name, Last_Status__c,Additional_Information__c,Ongoing_Problem__c,Last_Update__c      FROM Account WHERE (OwnerId = :UserInfo.getUserID()) AND (Type <> 'Dead') AND (Last_Update__c < LAST_N_DAYS:150) 
ORDER BY Last_Update__c LIMIT 1];
		return account;
    }
    
    public PageReference NotOK() 
    {        
        account.Ongoing_Problem__c = true;
        account.Last_Update__c = Date.today();
        try 
        {
            upsert(account);
        }	
        catch (Exception e)
        {
            System.debug('NotOk Exception1 ===> '+e);
            ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'Please use Save button at the top     of the page to save header information.'));
        }
        update account;
        try
        {
           account = getAccount(); 
        }
        catch (Exception e)
        {
            System.debug('NotOk Exception2 ===> '+e);
            ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'Please use Save button at the top of the page to save header information.'));
        }
        return null;
    }
Thanks in advance for your help on this. Cheers, Andi
hi,
 can you correct this 
Public static set<Id>getUniqueIds(list<SObject>sobs)
{
set<Id>Ids=new set<Id>();
for(SObject sob : sobs)
{
Ids.add(sob.Id);
}
return Ids;
}
Error: Compile Error: unexpected token: 'set' at line 1 column 14

 
Hello Experts

I need to merge two profiles. I would like to know what is best way to do this, specifically for the Field Level Security and Page Layouts. Is there a way to export FLS & Page Layout settings and then merge using any editor or tool.

Thanks in advance!!

Regards
Amrender 
We are using 'Custom Chat Page(visualforce page)' for our customers and the language selected is different from English on the Chat Button.

The problem is that the language parameter is not being set up if we use Custom Chat Page. But if we don't use Custom Chat Page the language parameter is getting set as the language we selected on the Chat Button.

My question is how can we set the language parameter if we use Custom Chat Page?

 I want to add a message(warning)/ alert on standard opportunity page whenever the opportunity is saved. How can we accomplish this? As we can not override the save button and Business do not want to create a custom VF page. Please suggest what other options do we hold?

 

Thanks in advance,

Amrender Singh

I am making a webservice call and want to synchronize the block for making web service call. Here is the sample code:


         Http h = new Http();
         Httprequest req = new Httprequest();
         req.setEndpoint(endPoint);
         req.setMethod('POST');
         req.setBody(xml);
         Httpresponse res = h.send(req);

 

Thnks & Regards,

Amrender Singh

Hello community,

I'm currently working on a new implementation of Service Call with omnichannel including the live agent and community.
My client and I were really interested into the Einstein bot... but we support multiple languages. Seems like there is no support at all of multi-language with the Chat bot... just like so many other functionnalities with limited multi-language support.

As a workaround, I thought it might be possible to duplicate everything for each languages (lucky we have only two) and use audience in community to show one or the other Chat snap-in. We would also need to create one bot per language and have them training individually...

Another workaround would be to use only on chat bot, and include multi language with different dialog and everything.


My question is, anyone here ever implemented a chat bot in Salesforce which was supporting multiple languages? This is relativaly new so my guess is probably no

Regards
 

I'm getting an error that doesn't seem like an error...Maybe there's something I'm not seeing. Relationship is a custom object, and it's API name is Relationship__c. Can anyone help? I'm fairly new to coding. Thank you!

trigger RelationshipReverseRecord on Relationship__c (before insert, before update, before delete)
{
    Set<string> rIDs = new Set<string>();

    if(Trigger.isInsert)
    {
        for(Relationship r : Trigger.New)
        {
            String uID = r.parentID + r.childID;
            String rID = r.childID + r.parentID;
            r.UniqueID__c = uID;
            r.ReverseID__c = rID;
            rIDs.add(rID);
        }
    }
    List<Relationship__c> existingReverseRecords = [SELECT UniqueID__c, Reverse_Record__c FROM Relationship__c WHERE ID IN : rIDs];
    List<Relationship__c> newReverseRecords = new List<Relationship__c>();
    for(Relationship__c newR : Trigger.New)
    {
        if(newR.ReverseID__c == existingR.UniqueID__c)
        {
            found = true;
            break;
        }
    }
    if(found==false && newR.ReverseRecords)
    {
        Relationship__c newReverse = new Relationship__c(ReverseRecord__c = true, Parent__c = newR.Child__c);
        newReverse.Child__c = newR.Parent__c;
        newReverseRecords.add (newReverse);
    }

    insert newReverseRecords;
}

Hello Experts

I need to merge two profiles. I would like to know what is best way to do this, specifically for the Field Level Security and Page Layouts. Is there a way to export FLS & Page Layout settings and then merge using any editor or tool.

Thanks in advance!!

Regards
Amrender 
If a user does not have permission to delete a record, but they need to be able to do so when the status changes (IE to closed), how do you give the user permission to delete that particular record?
Hi all,

How to include private constructor in test class for getting better code coverage.

Thanks

 
Hi all,

I have 2 sandboxes with the Person Account mode.
I'm deploying changes using Force.com IDE and Migration Tool but I just can't find a way to deploy Person Account Picklist Values.
Whenever I add new values to any picklist in the Person Account Record and deploy the changes, all the picklist values in Person Account Record Type (that was created by salesforce) appear in the Available Values of the picklist rather than in the Selected Values.

I've gone through the Account.object xml and it looks like the Person Account Record type isn't there so I guess it has something to do with it but I can't figure out a way to add it.

I will appreciate any help... 
trigger updaterecord on Account (before insert){

for(Account acc: trigger.new){
Account acc1;
acc1.Type= 'prospecting';
update acc1;
}
}

its give error when m going to insert..
Error: Invalid Data. 
Review all error messages below to correct your data.
Apex trigger updaterecord caused an unexpected exception, contact your administrator: updaterecord: execution of BeforeInsert caused by: System.SObjectException: DML statment cannot operate on trigger.new or trigger.old: Trigger.updaterecord: line 7, column 1
 
I am trying to create a new action plan on my lead in Salesforce.  I need it to trigger when the lead is created and I am getting the following error:



An error occurred at element myRule_1_SA1.
UPSERT --- UPSERT FAILED --- ERRORS : (INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY) insufficient access rights on cross-reference id: a27C00000008Elb --- for SFDC record with ID : null, .


I do not know what is going wrong here? Please help :(
I have created a VF Page for Patient__c object. Now i want to create record detailpage for Patient__c.

My Page like this:
<apex:page StandardController="Patient__c" extensions="PatientController" >  
    <apex:sectionHeader subtitle="{!Patient__c.Name}" title="Patient" />
<apex:form id="formid" >

----- All entered all out put field with my requirement.-----

 </apex:form> 

    <apex:relatedList list="Appointments__r"/> 
    <apex:relatedList list="ActivityHistories"  />  // which is not displayed in relatedlist.
    <apex:relatedList list="CombinedAttachments"/>
</apex:page>
while creating an object, Allow Activities check box checked. In standard Detail page, Activity History is appeared.

Please any one help me to acheive this problem. i was tried many ways but not working.


Thank you
Rakesh.S
The code which i wrote executes but doesn't work. Can you explain why??
Scheduled Class:
global class Scheduler_DeleteoldCases implements Schedulable{
  global void execute(SchedulableContext SC) {
     DeleteoldCases gm = new  DeleteoldCases() ;
  }}

Apex Class:
global class DeleteoldCases{
    Public void DeleteoldCases(){
        Case[] QueryCases = [SELECT Id FROM Case WHERE CreatedDate < LAST_N_MONTHS:18 ORDER BY CreatedDate ASC  LIMIT 9000];
            system.debug('********List of Cases********'+QueryCases);
            If (QueryCases == null || (QueryCases!=null && !QueryCases.isEmpty()))
            {
                return;
            }
            try{
                delete QueryCases;
            }catch(DmlException e) {
                System.debug('An unexpected error has occurred: ' + e.getMessage());       
        }
    }
}
 
Hi All,

I am trying to access the class varible dynamically for one of my requirment. Please see the code.

public class CaseUpdateTestingClass {
    public string AssetSN = '1AED45';
    public string CDIDId='3498474';
    public string ContactFirstName='SalesForce';
}

CaseUpdateTestingClass es = new CaseUpdateTestingClass();
string a = 'AssetSN'; // Here I do dynamic assignment
system.debug('*********** : '+es.get(a));

Thanks
Shaijan Thomas
Why doesnt Salesforce support "*"in SOQL Query when we can use a Dynamic Query to retrieve all fields of an object.

What are the reasons for not able to include an "*" operator in a query?
Hello,

Our developers are integrating our internal system with a SF and hence mapping all relevant fields. However, on the "BillingAddress" field they keep getting an error: "Unable to create/update fields: BillingAddress. Please check the security settings of this field and verify that it is read/write for your profile or permission set." I have checked field level security and permission settings to all users, and everything is fine.

Any idea why error still poping up?

Thanks in advance,
Inna
I am looking for a way to switch the fields in SF that have a zero in the "No. Of Employees" Field to make them blank so that I can update them with a data.com clean. Someone suggested that there might be a way to write an Apex trigger for "if employees=0" then "make blank" - does anyone know if there is a better way or know how to write an Apex trigger that would be willing to help me?

Thank you!
We are using 'Custom Chat Page(visualforce page)' for our customers and the language selected is different from English on the Chat Button.

The problem is that the language parameter is not being set up if we use Custom Chat Page. But if we don't use Custom Chat Page the language parameter is getting set as the language we selected on the Chat Button.

My question is how can we set the language parameter if we use Custom Chat Page?
Hi Guys,
  1. Until the Spring 15 release, Maps and Sets are Unordered Collections. So the returned order will be random.
  2. But beginning from Summer 15 release onwards, Maps and Set order is predictable. The order will be same that what you put from the beginning to end.
Example:
Map<String, String> orderedMap = new Map<String, String>();
orderedMap.put('Good', 'This is so good');
orderedMap.put('Bad', 'This is so bad');
System.debug(orderedMap);

If you run the above code snippet in Developer console you will get the returned order as below,

Until Spring 15 Release:

{Bad=This is so bad, Good=This is so good}

From Summer 15 Release:

{Good=This is so good, Bad=This is so bad}

This changes is not the API level, this is Schema level change. If anyone relying on the Map or Set order in your codes, change it as soon. 

Thanks.