• Ramakant
  • NEWBIE
  • 380 Points
  • Member since 2015

  • Chatter
    Feed
  • 12
    Best Answers
  • 0
    Likes Received
  • 11
    Likes Given
  • 0
    Questions
  • 103
    Replies
Hi Team,

Could you please help me with below validation rule. i have to want inlcude two user ids..


AND(
RecordTypeId == $Setup.ObjectRecordTypeIds__c.Case_RecordType__c,
LEN( Subject) >250,
OR(
ISNEW(),
ISCHANGED(RecordTypeId)
),
!AND(ISNEW(), RecordTypeId == $Setup.ObjectRecordTypeIds__c.Case_RecordType__c,ISPICKVAL (Contact_Type__c , 'employee'), $User.Id = '0058000000', $User.Id = '0053000000'),
skipValidations__c = False
)

Thanks,
Kumar
  • January 12, 2018
  • Like
  • 0
Hi,

  I do not know what is wrong in below formula picklist field it keeps giving error Please suggest me what is the error in below formula
 
  Error: Field Partner_Information__c is a picklist field. Picklist fields are only supported in certain functions.​
AND(
OR
(ISPICKVAL(Partner_Information__c, "Partner Sourced"),
 ISPICKVAL(Partner_Information__c, "Partner Influenced")
),
ISBLANK(Partner_Information__c)
)
Partner_Information__c is a pick list
Partner_Information__c is a lookup field 

Thanks
Sudhir
I am using email-to-case functionality to create cases from emails. I have used a custom field say mail_body__c(rich text area) to store email body and updating the field using trigger. this is working fine. Now my requirement is to store all incoming emails(from customers) related to a particular case in the custom field mail_body__c. How can I acheive that? Any help on this would be highly appreciated. Thanks.
Hey all!
I am new in Salesforce development. I am trying to show all records in my own object, but all that I get is empty table with headers. 
I suppose there is something wrong with calling my object's records. This is my code:

<apex:pageBlock title="Students">
       <apex:pageBlockTable value="{!tudent__c}" var="all_students">
          <apex:column value="{!all_students.Name__c}"/>
          <apex:column value="{!all_students.Surname__c}"/>
          <apex:column value="{!all_students.Address__c}"/>
       </apex:pageBlockTable>
   </apex:pageBlock>

I can't find the reason why is empty, so any helping clue is great:) 
Is there a limit to the number of fields that can be defined as Criteria for a Sharing Rule?
Hello,

I have a picklist value "XYZ", "PQE",

If ( picklist value ==  "XYZ")
 then i want to create aformula with value CHECKED.

If above is not possible then it is unchecked.

How can i achieve this ?

thanks for suggestion !
Hello,

I want to execute a processbuilder when a button is clicked, 
my custom button is like below
User-added image

thanks you for suggestion
I have one text fields 

input ::::Feeler - 62, Exciter - 58, Bottom-Liner - 58, Detailer - 54


and in a new field i only want to see output as :::Feeler - 62    how can i achieve using formula field?? 
I am trying to understand if there is a way to see the Label and API name of all my custom objects. I wish there is a way to add the API Name as a column to the view below. My main problem is I know the API name of my object and its hard to find the actual object. 

User-added image
Hello,

I've never written a trigger before and was wondering if someone can help. All I need is a trigger on the Account object, on update, that will check to see if Tax ID changed. If this is true, then update the Comments field with something like "Tax ID was last updated on" & Today(). The pseudocode would be something like this:

Trigger TaxIdChanged on Account (On Update)
If ISCHANGED(Tax_id__c) = True
    Comments = "Tax ID was last updated on" & Today()
End

It is important to know that Tax_Id__c is an encrypted field and this is why I'm having to try to create a trigger to do this since I believe is the only way to look at the contents of an ecrypted field. I've tried doing this via a workflow rule or process builder, and unfortunately was not able to do it becuase I'm dealing with an encrupted field.

Thank you so much!!
Hi guys,

My requirement is to get a list of all standad and custom object apis in a list.
I dont want to list Objects like RecordType, ApexPage etc.
I want only buesness objects (Such as Account,Contact,Opportunity etc) ,and custom objects if any.
Please Help Me Out.......
Hi Team,

Could you please help me with below validation rule. i have to want inlcude two user ids..


AND(
RecordTypeId == $Setup.ObjectRecordTypeIds__c.Case_RecordType__c,
LEN( Subject) >250,
OR(
ISNEW(),
ISCHANGED(RecordTypeId)
),
!AND(ISNEW(), RecordTypeId == $Setup.ObjectRecordTypeIds__c.Case_RecordType__c,ISPICKVAL (Contact_Type__c , 'employee'), $User.Id = '0058000000', $User.Id = '0053000000'),
skipValidations__c = False
)

Thanks,
Kumar
  • January 12, 2018
  • Like
  • 0
We have a code that prevents us from closing a project if there are still open activities.
The trouble is that it picks up the "Not Started" Status update on the Recurring Tasks Series, even when the series has ended (end date has passed).

The Status of the actual Recurring Series record can't be updated: 
Recurring Task Error

The code is: public static void checkIncompleteTask(List<amc__Project__c> newList, Map<Id, amc__Project__c> oldMap) {
        List<Task> taskList = [SELECT Id, WhatId FROM Task WHERE WhatId IN: newList AND Status != 'Completed'];


Can anyone assist in excluding Recurring Series records from this? It doesn't appear as a separate RT, and isn't a reportable activity in itself.

Cheers, Nat
 
Hi Folks, 

Need help to develop visualforce page with search option account.
Should Use Current loggedin User Phone and Account phone. 
if iam trying to search with my account id = 12345.
if Account has phone number (900000001) and 
Current Loggedin User Phone number (900000001) 
Then
 User.phone==account.phone(if user phone and account phone both are same) then Account(12345) should disply on visualforce. except Account(12345) no one other account should not display. 
Please do help. this is an urgent thing need to have. 
Thanks in Advance.
  • December 22, 2017
  • Like
  • 0
I want o create an Apex Trigger on Macros, to update case custom fileds.

Please help its urgent.
global class BatchApex implements Database.Batchable<sObject>{
    
    String query = 'SELECT Id,CLOSED__c, Priority FROM Case';
    
    global Database.QueryLocator start(Database.BatchableContext BC){
        return Database.getQueryLocator(query);
    }
    
    global void execute(Database.BatchableContext BC, List<Case> cas){
        for(Case c : cas){
            if(c.priority=='High'){
                c.CLOSED__c = TRUE;           
            }
        }
        update cas;
        for(Case cs:cas){
            if(cs.Business_days__c==5){
                cas.add(cs);
                sendmail(); 
            }
        }
        update cas; 
    }
    
    global void finish(Database.BatchableContext BC){     
        
    }    
    
    public void sendmail()
    {
        
        Messaging.SingleEmailMessage email = new Messaging.SingleEmailMessage();
        String[] toAddresses = new String[] {'iswarya.sekar@excelenciaconsulting.com'} ;
            email.setToAddresses(toAddresses) ;
        email.setPlainTextBody('this is a test mail');
        email.setSubject('New Case Logged');
        Messaging.sendEmail(new Messaging.SingleEmailMessage[] { email });
    }
}
Its updating CLOSED__c to True, But it is not sending email when Business_days__c==5
 
How can I update a Contact Record Field, IF Today's Date "DD/MM" value = Account Date Field Day and Month? I need this to happen without having to edit a record. 

Account: Has a Renewal_Date__c of January 1 (year does not matter - should I do a Date field or text for this?)
Contact: Update a Amount_Field__c to $0, IF today is January 1 (again year does not matter)

Thanks!
Hello All,
I have a very basic trigger in sandbox which i want to push it through the production. Without the test class i am getting the 0% code coverage error. Can someone please help me with this?
My Trigger: Order__c (Custom object), i want to update the OwnerId with the value in custome field Owner_Id__c.

trigger UpdateOwner on Orders__c (before insert) {
for (Orders__C a : Trigger.New) {
a.OwnerId = a.Owner_Id__c;
}
}

Thanks.
Create a new VisualForce Page, such that the page enables creation of a new Lead
when inserted, the details should be displayed in a new page, that means the record detail page should open in a new tab/page
the page should be reloaded with the detail page.
I'd like to calculate the IRR of an investment and I'm using the following schema:
User-added image
The red circle captures Investments with transactions and market values rolling up to each investment.  Each transacton captures the following details:

1. Transaction Date
2. Transaction Type
User-added image
3. Units
4. Unit Price
5. Investment (Lookup)
6. Currency

I'd like to roll-up the IRR to a field on the Investment record.  Is there an application that doesnt' require APEX code that I can use for this?  I'm also open to suggestions that involve an Excel to Salesforce integration.

Thanks!
trigger updateaccount on Contact (after update) {
    map<id,contact> conmap = trigger.newmap;
    set<id> allconids = conmap.keySet();
    list<account> acclist = [select id,phone from account where id in: allconids];
    for (account acc : acclist){
        
       acc.Phone = conmap.get(acc.Id).phone;
    }
update acclist;
I am trying to do this Trailhead, and stuck on this procedure.
https://trailhead.salesforce.com/modules/lex_customization/units/lex_customization_page_layouts

" To change page layout assignments, click Page Layout Assignment and then click Edit Assignment. "

Where do I find the Page Layout Assignment ?

Thanks in advance.
 
I'm trying to create a vf page- its more like a review/feedback form. 

<apex:page standardController="Purchase_Order__C" extensions="PO_VendorPerformanceForm" >
<apex:form>
 <apex:pageBlock > 
                    <apex:outputPanel >
                <apex:pageBlockSection title="Submitted by:" showHeader="true" collapsible="false">
                    <apex:outputText value="Name: {!Purchase_Order__c.Requesitioner_Liaison__r.name}"/>
                    <apex:outputText value="Date: {!today()}"/>                    
                    <apex:outputText value="Division Name: {!Purchase_Order__c.Division_Name__c}"/> 
                    <apex:outputText value="Division No: {!Purchase_Order__c.Requesitioner_Liaison__r.DivisionNum__c}"/> 
                    <apex:outputText value="Title: {!Purchase_Order__c.Requesitioner_Liaison__r.Title}"/>
                </apex:pageBlockSection>
                    </apex:outputPanel> 
            </apex:pageBlock>
            <apex:pageBlock >
                <apex:pageBlockSection title="1. Contract Designation:" collapsible="false">
                    <apex:pageBlockSectionItem > 
                        <apex:selectcheckboxes >
                            <apex:selectOption itemLabel="Commodities" itemValue="f"/>
                            <apex:selectOption itemLabel="Services" itemValue="cpp"/>    
                        </apex:selectcheckboxes>     
                    </apex:pageBlockSectionItem>
                </apex:pageBlockSection>
            </apex:pageBlock>
</apex:form>
</apex:page>

Controller: 
public class PO_VendorPerformanceForm {
 public PO_VendorPerformanceForm(ApexPages.StandardController controller) {
        Purchase_Order__c po = (Purchase_Order__c)controller.getRecord();
        parentId = po.Id;
        pdfName = po.Name + '-VPR';
    }
 public ID parentId {get;set;}
    public String pdfName {get;set;}
    public string contentType {get;set;}
    
    /*    SAVE PDF     */
    public PageReference savePdf() {
        // ATTACH VPR TO PO
        // Get PDF of Vendor Perf. Form
        PageReference pdf = Page.POVendorPerfForm;
        pdf.getParameters().put('id',parentId);
        // Initialize attachment
        Attachment attach = new Attachment();
        // the contents of the attachment from the pdf
        Blob body;
        try {
            body = pdf.getContentAsPDF(); // PDF body
        } catch (VisualforceException e) {
            body = Blob.valueOf('Some Text');
        }
        
        attach.Body = body;
        attach.Name = pdfName + '.pdf';
        attach.IsPrivate = false;
        attach.ParentId = parentId; // PO's Id
       
        insert attach;
        
        // (Future) Send Email
        sendEmail(attach.Id);
        return page.POVPRSuccessPage;
    }
    
    /* SEND EMAIL    */
    @future(callout=true)
    public static void sendEmail(Id vprFormId) {
        // Get VPR
        Attachment vprAttachment = [SELECT Id,Name,ParentId,Body,BodyLength 
                                    FROM Attachment 
                                    WHERE Id = :vprFormId];
        
        // Get Template
        EmailTemplate ev = [select id,name,Subject,Body 
                            from EmailTemplate 
                            where name='VPR_Email_template'];

        // Create Email
        Messaging.SingleEmailMessage email = new Messaging.SingleEmailMessage();
        List<Messaging.EmailFileAttachment> emailAttachments = new List<Messaging.EmailFileAttachment>();
        Messaging.EmailFileAttachment efa = new Messaging.EmailFileAttachment();
        efa.setFileName(vprAttachment.Name);
        efa.setBody(vprAttachment.Body);
        emailAttachments.add(efa);
        email.setFileAttachments(emailAttachments);
        // Set "To" address
        List<String> toAddresses = new List<String>();
        toAddresses.add('xyz@gmail.com');
        email.setToAddresses(toAddresses);
        // Set "From" address (not applicable in this case)
        /*(OrgWideEmailAddress[] owea = [select Id 
                                      from OrgWideEmailAddress 
                                      where Address = ''];
        if (owea.size() > 0 ) {
            email.setOrgWideEmailAddressId(owea.get(0).Id);
        }*/
        email.subject = ev.Subject;
        email.setSaveAsActivity(True);
        email.setHtmlBody(ev.Body);
        List<Messaging.SendEmailResult> results = new List<Messaging.SendEmailResult>();
        results = Messaging.sendEmail(new Messaging.SingleEmailMessage[] { email });
    }
}

The problem is I'm able to save the vf page as pdf but I'm not able to see the checkboxes in that pdf. Can some one help me with this ? 
I appreciate your help.  Thank you in advance!
  • December 15, 2017
  • Like
  • 0
I am trying to do this Trailhead, and stuck on this procedure.
https://trailhead.salesforce.com/modules/lex_customization/units/lex_customization_page_layouts

" To change page layout assignments, click Page Layout Assignment and then click Edit Assignment. "

Where do I find the Page Layout Assignment ?

Thanks in advance.
 
Can someone give me detailed references/articles of how triggers work in asynchronous apex. in normal synchronous apex trigeers inserts records in the batch count of 200s each for every iteration. mean 1000 rows go in 5 batches. what happens in asynchronous processing. If i have a queueable inserting 1000 rows how they are processed.
Can someone give me detailed references/articles of how triggers work in asynchronous apex. 
  • December 10, 2017
  • Like
  • 1
Hi Experts,
I am creating an app (through point and click), in which user gets register. Is it possible to give login credential to user through this app so s/he can acces the app or I need to create user only from Standard Admin> User Management to provide login to my salesforce app. Please help.
 
How to store 700 picklist fileds ?
Hi All,

i have a standard opportunity page. also i have a field update on this. so i have to auto refresh my opportunity page when a field update happen. now i need to manully refresh the page. how can i achieve this. i have written a inline visual force page with a 'Reload' button embadded with the satndard page. but i need to manually click this button. i need the auto refresh the page.

Thanks,
Hi All,

I want to discuss a business hours senario with you. We are using business hours for calculate Plan date of custom Activities. Our shift timing are 06:30 AM(Monday) to 03:30 AM(Tuesday),06:30 AM(Tuesday) to 03:30 AM(Wednesday) and so on. When I am going to set these hours to business hours, it is throwing the error "Error: Start time must be earlier than end time".

User-added image
Please help me to fix this issue.
Thanks,
Parteek
 
Hello
I having a custom object C1 with fields like name,email and mobile number.On an visualforce page I will enter the values and save the data.This part is fine with me.
Now my requirement is when I enter email in <apex:inputfield> say on keypress event I should be able to call an server side method in apex controller.
This method will check if the email already exists in object. If it exists then some action needs to be taken.

Please anybody any help will be greatly appreciated
thanks
vandana
 
Hi,

I have a requirement where I need to add validation rule(saying that a field is blank), but that validation should fire if in approval process the stage gets to in review/ or the approver is the Queue of the assigned approver.

I tried using validation rule, but it seems it is not achievable via validation rule.
It seems I need to write a trigger and use StepsAndWorkitems to get the actorId.

Can someone please guide me on how to achive this requirement?
 
Hi,
Is it possible to create a scheduled job for npsp data imports. I am able to create data import objects using APEX, but I am not able to process it automatically.

Thanks.
In the Video demo you can see a full site view, is that something out of the box or do we have to create it by hand. Also if there is a tutorial of how to recreate that would be great:

https://youtu.be/d3jD25SNp6g?t=70

User-added image
I am looking for -any- way to thumbs up/down a content record from a visualforce page. It is doesn't look like I can edit ContentVersion record.

Thanks in advance,
Marijus