• ajay rawat 14
  • NEWBIE
  • 245 Points
  • Member since 2016
  • Software Developer
  • Capgemini

  • Chatter
    Feed
  • 6
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 42
    Replies
<apex:commandButton styleClass="select-block-button" value="{!$Label.Select_Button}" action="{!selectedProducts}"  id="myCmdButton" disabled="false"  />









<apex:column >
                    
                    <apex:inputCheckbox styleClass="" value="{!productVar.aCheckBox}" immediate="true" />
                </apex:column>

 
Hello,

When a process builder or flow is active , it is not possible to deploy the same version of flow unless it is disactivated in destination environment.

Is there still a any way to deploy it without disactivating the flow in destination org.

I use ant to deploy.

thanks for suggestion !
  • May 31, 2017
  • Like
  • 0
I am getting below error

System.DmlException: ConvertLead failed. First exception on row 0; first error: FIELD_CUSTOM_VALIDATION_EXCEPTION, Validation error on Contact: This field is alpha only​

please help me to solve this error
 
Hi
I have a requirement that i need to perform dynamic dml operations and when i have custom object registration and vf pages like login and registration And registration object with fields name,password,email.When i entered name dynamically in vf page if i entered name is existed in object it returns null if i entered name is doesn't exist in object then we need to insert the data and go to login page. 
Please check my code:
ApexClass
public class Registrationapex_Rum {
public String rumname{set;get;}
public String password{set;get;}
public String email{set;get;}
public list<Registartion__c> reg{set;get;}
public void search(){
reg=[select Rum_Name__c,Password__c,E_Mail__c from Registartion__c where Rum_Name__c=:rumname];
for(Registartion__c rl:reg){
if(rl.Rum_Name__c==rumname){
clear(); 
}else{
create();
}
}
}
public PageReference create(){
Registartion__c r=new Registartion__c();
r.Rum_Name__c=rumname;
r.Password__c=password;
r.E_Mail__c=email;
insert r;
PageReference p=new PageReference('/apex/loginpage_Rum');
return p;
}
public void clear(){
rumname=null;
password=null;
email=null;
}
}
VF Page:
<apex:page controller="Registrationapex_Rum">
<apex:form >
<apex:pageBlock title="Registration" id="pb1">
<apex:pageBlockSection columns="1">
<apex:pageBlockSectionItem >
<apex:outputLabel value="Rum Name"/>
<apex:inputText value="{!rumname}"/>
</apex:pageBlockSectionItem>
<apex:pageBlockSectionItem >
<apex:outputLabel value="Password"/>
<apex:inputText value="{!password}"/>
</apex:pageBlockSectionItem>
<apex:pageBlockSectionItem >
<apex:outputLabel value="E-mail"/>
<apex:inputText value="{!email}"/>
</apex:pageBlockSectionItem>
<apex:pageBlockSectionItem >
<apex:commandButton value="Submit" action="{!search}"/>
<apex:commandButton value="Clear" action="{!clear}" reRender="pb1"/>
</apex:pageBlockSectionItem>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>
Thanks In Advance
Sampath
I have a list of values in one picklist field (A) and would like to have some of those values (abc, dfe) trigger to update another picklist field's (B) value (xyz) upon selection. The reason i would like to use Apex is because I have a field dependency already used for those fields and cannot overwrite it with another dependency. Any suggestion? I am new to apex and I have trouble creating the trigger.
Hello,

I'm new to the Community and the SF Community cloud. I am currently taking the Admin Beginner courses, and there are times when I come across terms in the text that are not self-explanatory.

As example, in the Understanding Custom and Standard Objects module, the text says, under "Overview of Objects":

"Each table comprises a number of columns of a particular data type, such as text, number, or date. Information is stored in rows of the table. Tables can be related to other tables, using primary and foreign keys. Apps manage information by creating, reading, updating, and deleting rows in a table"

The problem is, I am not a database programmer, and I have no idea what primary and foreign keys are. They are not described in this document.
Is it relevant to what I am learning and if so, can someone please provide a description of these terms as they relate to the paragraph above?

Thank you for any feedback!

 
Hi All,
What is difference between FeedItem and EntityFeed ?
From  SOAP API guide both object have almost same field and its SOQL query return same result.
https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_objects_feedcomment.htm

And If we see ERD of chatter feed then it shows EntityFeed is subset of FeedItem so is there any relation between two object ?
 
Thanks
Ajay Rawat
 
I have a VR that makes a field required , I would like to have this to be excluded while cloning(custom button), Please let me know if this possible through configuration, currently cloning process is handling by an Apex class in my Org,if apex is the way to resolve this issue, sample piece of code would be much appreciated.
Either bypassing the VR or making the Product__c field empty upon cloning works for me.
VR as follows:
AND(RecordType.Name = 'Global', 
ISBLANK(Product__c), 
OR(IsPickVal(Confirmed__c,"Yes")))

Thanks
CK
Hello,

I have a field 'Location' with picklist data type on user object. I have the same field on another object object2.
I want to populate 'Location' field in object2 with a value from user object.

Both fields are picklist.

Any suggestions how it can be done?
 
Hi All,

When I try to test run the flow I created, it just gives me 'YOUR FLOW FINISHED' when I click 'Run'.

The 1st step of the flow is looking up accounts where the 'Type' of account equals a specific picklist value.
I filled in the criteria and also filled in 'assign the record's fields to variables to reference them in your flow'.

This is being created in a Sandbox and the sandbox in question has got test records in there.

Could anyone advise on wether this is the right starting point for a flow or I need to edit something.

If you need more info, do ask.

Thanks

 
<apex:commandButton styleClass="select-block-button" value="{!$Label.Select_Button}" action="{!selectedProducts}"  id="myCmdButton" disabled="false"  />









<apex:column >
                    
                    <apex:inputCheckbox styleClass="" value="{!productVar.aCheckBox}" immediate="true" />
                </apex:column>

 
I am trying to update a contact based on accout Code not a account name (field of contact). this Account code is available in Account.
When i create a new contact i will give a account code , at that time account name need to update based on this account code only...

Here is the following Code, can you please give me a proper trigger for this process

********************************************************************************
trigger ContactMapToAccount on Contact (before insert , before update) {
     
    //Set Of Id In Contact Code & Id
    Set<Id> conId = New Set<Id>();
    Set<Id> conCode = New Set<Id>();
    for(Contact c : Trigger.New){
        conId.add(c.Id);
        
    }
    
    List<Contact> lstCont = [Select id, Account_Code__c, name from Contact Where ID IN :conId];
    Map<Id,Account> acMap = new Map<Id,Account>();
    for(Account a : lstCont){
        acMap.put(a.id, a);
        
    }
    
    for(Contact c : lstCont){
        
        c.Account_Code__c = acMap.get(a.Account_Code__c);
    }
}


**************************

Thnaks in advance
Hello,

When a process builder or flow is active , it is not possible to deploy the same version of flow unless it is disactivated in destination environment.

Is there still a any way to deploy it without disactivating the flow in destination org.

I use ant to deploy.

thanks for suggestion !
  • May 31, 2017
  • Like
  • 0
Hello,
 I am creating a process builder where i want to update a field when criteria is met. But in my condition its showing syntax error. 

OR
(ISPICKVAL([Case].Reason, Support-Fault) , 
ISPICKVAL([Case].Reason, Support-Change Request) ,
ISPICKVAL([Case].Reason, Support-Information Request)  , 
ISPICKVAL([Case].Reason, Support-Routine)  , 
ISPICKVAL([Case].Reason, Support-Password Reset)  ,
 ISPICKVAL([Case].Reason, Support-Outage)  ,
 ISPICKVAL([Case].Reason, Support-Outage Cleared))  

Please help me with the correct solution.

Thanks & Best Regards,
Utkarsha
Hi,
I Create one user in salesforce with admin account.
I want to delete that user using Java Soap services.
I able to revoke his permissions but i am unable to delete created user. even in salesforce console also.
when i selecting the from date it will fetch starting date of a week
 in following text boxes
first textbox will be a start date of a week and following 6 textboxes continuous date of a week
I am getting below error

System.DmlException: ConvertLead failed. First exception on row 0; first error: FIELD_CUSTOM_VALIDATION_EXCEPTION, Validation error on Contact: This field is alpha only​

please help me to solve this error
 
this is my visualforce code...
Actually i want to show the loading image button on click of upload attachment  button
On click of select Attachment the apex method is being called which makes the page to rfresh...
i want to avoid the page refresh...
and rerender cannot be used on <apex:inputfile>
////////visualforce code /////////

<apex:page standardController="Account" extensions="extendAccountforstandardController">
<apex:form id="frm">
<apex:pageBlock >
<apex:pageblockSection >
<apex:inputFile value="{!objAttachment.body}" fileName="{!objAttachment.name}"/> 
</apex:pageblockSection>
<apex:pageBlockButtons >
<apex:commandButton value="Select Attachment" action="{!selectAttachment}" rerender="none" />
</apex:pageBlockButtons>
</apex:pageBlock>
<apex:actionRegion >
<apex:pageBlock id="pgBlkId" >
<apex:pageBlockSection >
<apex:inputField value="{!objAccount.parentid}"/>

</apex:pageBlockSection>
<apex:pageBlockButtons >
<apex:outputpanel id="image">
<apex:commandButton action="{!attachRecord}" value=" upload attachment" reRender="image" status="actStatusId" />
</apex:outputpanel>
 <apex:actionStatus id="actStatusId" >
<apex:facet name="start"  >
<img src="/img/loading.gif" />                    
</apex:facet>
</apex:actionStatus> 
</apex:pageBlockButtons>
</apex:pageBlock>
</apex:actionRegion>
</apex:form>
</apex:page>

///// Apex Code

public class extendAccountforstandardController {

    public PageReference attachRecord() {
    
    System.debug('@@objAccount.id'+objAccount.id);
    
     System.debug('@@objAccount.parentId'+objAccount.parentId);
      
      objAttachment.parentId=objAccount.parentId;
      objAttachment.body=bodyAttachment;
      objAttachment.name=nameAttachment;
      
      if(objAccount.parentid!=null){    
        
            insert objAttachment;
        
        }
        return null;
    }

    public blob bodyAttachment;
    
    public string nameAttachment;
    
    public Account objAccount { get; set; }

    public Attachment objAttachment {get; set;}
    
    public extendAccountforstandardController(ApexPages.StandardController controller) {

        objAccount =new Account();
        objAttachment=new Attachment();

    }
    
    public void selectAttachment(){
    bodyAttachment=objAttachment.body;
    nameAttachment=objAttachment.name;
    System.debug(''+'@@nameAttachment'+nameAttachment);
    }
}

 
User-added image
This is my VisualForce code I want to display My contact detail in this table form. But it is not showing although I have record in my contact and account object.
Thank You
Hi I am new to salesforce and trying to write a trigger to update field(live to site) in Lead based on some condition.

we have a custom field in Account Account_id__c(ex:25679) which is a number and also similar field(seller_id__c-which is also a number ex:25679) in lead which is also a number. When there is a new account with some account id matches with lead seller id then a field live to site(picklist with values Yes, No) in lead should update with Yes.

Here's is my trigger, please correct me.


trigger LTS_Update1 on Account (after update) {
    set<Id> acctIds = new set<Id>();
    map<Id, Account> mapAccount = new map<Id, Account>();
      List<Lead> listLead = new List<Lead>();
    
    for(Account acct : trigger.new) {
        acctIds.add(acct.Id);
        mapAccount.put(acct.Id, acct);
    }
    
    listLead = [SELECT Id, Live_to_site__c, Account__c FROM Lead WHERE Account__c IN : acctIds];    
    
    List<Account> acc=new List<Account>();
    for(Account acct: acc)
    {
    if(acc[0].Account_ID__c == listLead[0].seller_id__c) {
        for(Lead ld : listLead) {
            ld.Live_to_site__c = 'Yes';
          }  
        }
        update listLead;
    }
}
I am a noob with Salesforce, please bare with my question.

I am creating an App which enables easy edit/creation of PermissionSets on an ORG.

In this process, I am creating a tree view with Permission Sets -> Objects + Permissions -> Fields + Permissions

Step 1. I have retrieved Permission Sets with SOQL "SELECT Id,Name,Description,NamespacePrefix,UserLicenseId,CreatedDate FROM PermissionSet"
Step 2. I am retrieving Objects with "Schema.getGlobalDescribe()"
Here is my question, I am able to fetch all the objects from my ORG.
But, The Object names does not match with the Object names which we generally see in Permission Set -> Object Settings

For example,
With "Schema.getGlobalDescribe()", I get the Object Names, something like this,

Label: Contract, Name: Contract
Label: Contract History, Name: ContractHistory
Label: Order, Name: Order
Label: Order Share, Name: OrderShare

but, in Permission Set -> Object Settings I see something like this,

Accounts
App Launcher
Assets
Campaign Members
Campaigns
Cases
Chatter Coaching
Coaching
Contacts
Content Contracts

All I need is same set of Object Names as we see in "Permission Set -> Object Settings"
I read that the Object names displayed in Permission Set -> Object Settings are the whole set of Objects from ORG but, I see some of them are missing and some are different with just being singular to plural like,

From my code: "Case"
From Permission Set -> Object Settings: "Cases"

Btw, I am doing all of this in Lightning components

Thanks!
Hi 

my task is to writea valodation rule on number field that should allow only 1-10 number like rating and it should not exceed 10 
how to aciheve this...?
can anyone help out
  • March 15, 2016
  • Like
  • 0

Hi, 
 
 In account we need to add a validtion on email domain field which is in email format eg. sudhir@gmail.com

 Field name is Email_Domain__c

 if any of the mail contains “gmail.com”, “hotmail.com”, “yahoo.com”, “gmx.de”, “googledomain.com”, “mail.ru”, “web.de”, “live.com”, “aol.com”, “gmx.net”, “yandex.ru”, “me.com”, “msn.com”, “comcast.com”, “hushmail.com”, “yahoo.de”, “hotmail.co.uk”, “lavabit.com”, “sbcglobal.net”, “safe-mail.net”, “ymail.com”, “yahoo.co.uk”

It should through message saying personal email cannot be entered.

Thanks
Sudhir