• Vetriselvan Manoharan
  • NEWBIE
  • 139 Points
  • Member since 2014
  • Salesforce Developer
  • Dazeworks


  • Chatter
    Feed
  • 1
    Best Answers
  • 2
    Likes Received
  • 0
    Likes Given
  • 56
    Questions
  • 84
    Replies
The check boxes like d not call, email opt out, fax opt out are present as fields and in the layout. But doesn't appear in the actual page. Why so ?
I am using LWC in a screen flow. I get response from an API and need to bind that value in the lightning combo box. It's in the json array format. Here is the code. 
 
import { 
    LightningElement,
    track,
    wire,
    api
     
} from 'lwc';
import getCooridinatesFromPinCode from '@salesforce/apex/ChurchNearYouController.getCooridinatesFromPinCode';
import { FlowAttributeChangeEvent } from 'lightning/flowSupport';

export default class ChurchNearYouComponent extends LightningElement {
    @api postalCode;
    @api selectedChurch;
    @track churchDropDown = [];
    @track value;
    
    @wire(getCooridinatesFromPinCode, { postalCode: '$postalCode'})
    wiredChurchList({ error, data }) {
        if (data) {
            console.log(data);
            this.churchDropDown = data;
        }
    }

    get churchList() {
        console.log('Get' + this.churchDropDown);
        return this.churchDropDown;
        /*return [
            { label: 'St James Piccadilly', value: '623055' },
            { label: 'St Anne Soho', value: '623058' },
            { label: 'St Paul Covent Garden', value: '623070' },
        ];*/

        //return [{"value":623055,"label":"St James Piccadilly"},{"value":623058,"label":"St Anne Soho"},{"value":623070,"label":"St Paul Covent Garden"},{"value":623065,"label":"St Martin-in-the-Fields"},{"value":823011,"label":"Guards Chapel of Wellington Barracks"}];
    }

    /*set churchList(val){
        console.log('Set' + val);
        this.churchDropDown = val;
    }*/
   

    handleChange(event) {
        const attributeChangeEvent = new FlowAttributeChangeEvent('selectedChurch', event.detail.value);
        this.dispatchEvent(attributeChangeEvent);
    }

}
<lightning-combobox name="ChurchListSource" 
                label="Church" value={value} placeholder="-Select-"
                options={churchList} onchange={handleChange}>
            </lightning-combobox>
            <lightning-formatted-text value={churchList} ></lightning-formatted-text>
            

If I hard code the json array and return then it binding the combo-box but when returing the churchDropDown it is not working as expected. I can see the response in the text value but not getting binded on the dropdown. 

Any help will be appreciated
Our client is using Salesforce CPQ and they want to show the product images on the quote line editor. But they want the images to be stored in private folders so that no one can download their images. Is there any connected app available to accomplish this or should be go for integration? 
We have a connected app that shows the external website inside canvas within Salesforce. The external site, headers are set to allow and also in Salesforce, in the Session settings, headers are allowed and the domain is also website. It is working fine but not only on the first when logging in.

When we trying viewing the site first time, it throws a cross-origin exception in the browser console. Clicking the error link it opens up the site in different windows and then it is working within the canvas. The canvas is kept within visualforce. Any thoughts?
I have a connected canvas which shows an external site in Salesforce using OAuth. In the site, the users can edit and click save button which calls a rest resource and creates the record in Salesforce. 

this is working fine for one user but working for a different user. It says session expired. I made the session settings the same for both the users and they have the same profile too. 
I am using apex:inputfile to get the file uploaded and want to attach it email attachment and send it as email.. I tried
 
public Transient Attachment emailAttachment{get;set;}

<apex:inputFile value="{!emailAttachment.body}" filename="{!emailAttachment.name}" id="file"/>

    List<Messaging.Emailfileattachment> fileList = new List<Messaging.Emailfileattachment>();
    if(emailAttachment != null)
    {
        Messaging.EmailFileAttachment efa1 = new Messaging.EmailFileAttachment();
        efa1.setBody(emailAttachment.Body);
        efa1.setFileName(emailAttachment.name);
        fileList.add(efa1);
    }

     for(String toContactId : toAddressesList) {
        List<Messaging.SingleEmailMessage> msgList = new List<Messaging.SingleEmailMessage>();
        Messaging.SingleEmailMessage msg = new Messaging.SingleEmailMessage();
        msg.setTargetObjectId(toContactId);
        msg.setFileAttachments(fileList);
        msg.setHTMLBody(htmlEmailBody);
        msg.setSubject(EmailSubject);
        msgList.add(msg);

    }
    Messaging.sendEmail(msgList);

But I can't able to get the file in the email attachment. Any ideas on how to do it?
I have a Header component inside which another component named FeedHeader is rendered. My problem is FeedHeader component should not render on load. It should get rendered on button click. Any ideas how to do it?
Hi All,
 
public void GetRecruitmentDetails()
    {
        List<Candidate__c> recruitment = new List<Candidate__c>();
        List<Contact> contactIds = new List<Contact>();
        contactIds  = [ SELECT Id from Contact where FirstName = :firstname and LastName = :lastName ];
        if(contactIds.size() > 0)
        {
            System.debug('Job Id' + jobId);
            System.debug('Contact Id' + contactIds[0].Id);
            recruitment = [ SELECT Id, Available_Date__c, Bottom_line_closed_on__c, Ideally_looking_for__c, Interview_Availability__c, Notice_Period__c, Submitted_at__c from Candidate__c where Job__c = :jobId and Contact__c = : contactIds[0].Id  ];
            if(recruitment.size() == 0)
            {
                try
                {
                    if(recruitmentDetails != null)
                    {
                        insert recruitmentDetails;
                    }
                }
                catch(Exception e)
                {
                    System.debug('Exception : ' + e.getMessage() + ' - ' + e.getStackTraceString());
                }   
            }
            else
            {
                recruitmentDetails = recruitment[0];
            }
        }
    }

recruitmentDetails is the variablle which is binded to visual force page.
 
<div class="col-lg-12 zero-padd marg-five-b">
                                        <div class="col-sm-6 col-md-6 two-padd">
                                            <label for="bottomline" class="marg-five-t col-xs-12 zero-padd">Idealy Looking For </label>
                                        </div>
                                        <div class="col-sm-6 col-md-6 two-padd">
                                            <input type="text" class="amount col-xs-12 zero-padd" placeholder="$" value= "{!recruitmentDetails.Ideally_looking_for__c}"/>
                                        </div>
                                    </div>
                                    <div class="col-lg-12 zero-padd marg-five-b">
                                        <div class="col-sm-6 col-md-6 two-padd">
                                            <label for="bottomline" class="marg-five-t col-xs-12 zero-padd">Submitted At</label>
                                        </div>
                                        <div class="col-sm-6 col-md-6 two-padd">
                                            <input type="text" class="amount col-xs-12 zero-padd" placeholder="$" value= "{!recruitmentDetails.Submitted_at__c}"/>
                                        </div>
                                    </div>

This method is also called in page action method. The logic of the method is if the recruitment details available for particular contact it should display the value. And also if we enter values in textbox and click save button it should insert the recruitment details.

I am getting an error "cannot specify id in an insert call"

Any ideas
 
Hi Guys,
I have a scenario

I would like the ability to mark leads as "read". There are instances where the sales team has acted on the lead but not via Salesforce. Is there a way I can simply go in and mark the lead as read instead of having to ask them to do so? I do not want the system to automatically change the status of leads that are not mine simply by opening them

Any ideas how shall we achieve this?

 
I need to track the lead status has at least 3 touch points within 20 days. The lead status should have changed at least 3 times within 20 days. If the status is not changed we need to send the lead owner an email.. How could we handle this?
Hi,

I want to sort the list based on the field
 
List<Hydra_ConversationView> theGroups = new List<Hydra_ConversationView>();
Hydra_ConversationView cbGroup;

// Get the Recent Message to be displayed 
        Map<id, FeedItem> feedMap = new Map<id, FeedItem>();
        Map<id, FeedItem> queryLatestMessage = new Map<id, FeedItem>([SELECT CreatedDate, body, Id FROM FeedItem where ParentId=:parentIds AND NetworkScope = 'AllNetworks' AND Visibility = 'AllUsers' ORDER BY CreatedDate DESC LIMIT : 1]);           
        for (FeedItem feed : queryLatestMessage.values()) {
          feedMap.put(feed.parentId, feed);
        }
        for (Hydra_ConversationView cGroup : theGroups) {
          if (feedMap.ContainsKey(cGroup.Id)) {                        
              
              System.debug('Found group id in image map: ' + cGroup.IconId);                        
              FeedItem fi = feedMap.get(cGroup.Id);              
              cGroup.RecentMessage = fi.body;
          }   
        }
        return theGroups;

I want to get the List of Groups based on the feed date.. If it is standard chatter group we can use the lastModifiedFeedDate..

 
Hi All,

I want to write a time based trigger on Lead object. I will explain my requirement

If the lead rating is set as "Hot" it should be acted within 1 business day, else will should send an email.. Similarly "Warm" it should be 5days..
 
Hi,
I need to query the Contract lookup field from Opportunity to check if contract exists. But I can't able to see the contract field to query.

Any help
Hi,

I have a Visual force page which uses a component. I need to assign value for textbox in a component through JQuery for some IE 9 placeholder issue. I tried something like this

var placeholderText = 'Contribute a post..';
        $(window).load(function() {
            $('#newPostContent').val(placeholderText);
        });

When it loads it shows the text and after loading it disappears.Any ideas?

Hi,

I need to something what we get while click the To me button in chatter. 

User-added image

Its gives the list of feeds we are mentioned and need to display it as seperate VF page.
Hi,

We are allowing user to mention other user in our community website. Now I need the list of Feeds the user is mentioned based on the user Id. Can anyone help me with it?
Hi Guys,

I need test class for the method below:

This class is written for overriding the view..

public PageReference redirectGroup()
    {
        if(Url.getSalesforceBaseUrl().toExternalForm()  == 'https://hello.cs20.force.com') // Checks for Community URL...
        {
            Id groupId = ApexPages.currentPage().getParameters().get('id');
            Id feedId = ApexPages.currentPage().getParameters().get('fid');
            if(feedId != null)
            {
                PageReference pg = new PageReference('/Community_FeedDetail');
                pg.getParameters().put('Id', groupId);
                pg.getParameters().put('fid', feedId);
                return pg;
            }
            else
            {
                PageReference pg = new PageReference('/Community_Groups_Feed');
                pg.getParameters().put('Id',groupId );
                return pg;
            }   
        }
        else
        {
           PageReference pg = new PageReference('/'+ApexPages.currentPage().getParameters().get('id')+'?nooverride=1');
           pg.setRedirect(true);
           return pg;
        }
Hi,

I have couple of controller method named getName() and getName1(remote action). Both returns a string.

I call them from javascript var data = {!Name}; and getName1  through remote action.

I get the "data" as object, whereas remote action returns it as string.. I want the remote action also to return as object.

 

 
Hi,

I am using pattern and matcher to [@name1]. Below is the regex
 
Pattern.compile('\\[\\@([a-z|A-Z|0-9].*?)\\]');
Using the matcher to get the values

String mentionName = pm.group(1);

Everything is works fine if it has only one [@name1] with specified pattern.

If it has more than one like [@name1] [@name2] only one value is returned. is it possible to get more than one value from the group?
Hi,

I need to get list of user names and return a string like below

['first', 'second', 'third', 'fourth', 'fifth', 'sixth', 'seventh', 'eighth', 'ninth', 'tenth']



Thanks,
Vetri

 
Hi Guys,
I have enabled chatter notification on each post to a group in the settings. But the problem is I get email only on commenting on the post, but not on new post. Can anyone help me with this?

Thanks,
Vetri
Hi,
I need to add discount to line item dynamically. For eg: If a customer orders mac + iphone it should add 10% discount, mac + samssung 15% discount, again mac + iphone + samsung 25% should get added. It should check for all possible products and its discount. Can anyone help me with it? 

Thanks,
Vetri
Hi,

is 'letter-spacing' not supported in visualforce rederas PDF? i have my css but the letter-spacing seems not working. works well in HTML..
 
tr.stdstyle{
                    text-align:left;
                    font-size:12px;
                    font-family: sans-serif;
                    letter-spacing:1px;

                }


<table border="0" cellspacing="0" cellpadding="0" width="100%" id="table1">

<tr class = "stdstyle" style="vertical-align:top">
                        <td>&nbsp;</td>
                        <td >Address</td>
                        <td width = "1%">: </td>
                        <td >some very very very long long long text</td>
                    </tr>

</table>
Thanks.
We are availing the facility of email-to-case in our organization. Everytime a case is created through email, a task is getting created automatically and its getting assigned to the current user.

Is there any settings to stop creating these tasks at all? If not, is there any way to get these removed automatically either immediately after creation or periodically?
  • January 20, 2016
  • Like
  • 0
I am using apex:inputfile to get the file uploaded and want to attach it email attachment and send it as email.. I tried
 
public Transient Attachment emailAttachment{get;set;}

<apex:inputFile value="{!emailAttachment.body}" filename="{!emailAttachment.name}" id="file"/>

    List<Messaging.Emailfileattachment> fileList = new List<Messaging.Emailfileattachment>();
    if(emailAttachment != null)
    {
        Messaging.EmailFileAttachment efa1 = new Messaging.EmailFileAttachment();
        efa1.setBody(emailAttachment.Body);
        efa1.setFileName(emailAttachment.name);
        fileList.add(efa1);
    }

     for(String toContactId : toAddressesList) {
        List<Messaging.SingleEmailMessage> msgList = new List<Messaging.SingleEmailMessage>();
        Messaging.SingleEmailMessage msg = new Messaging.SingleEmailMessage();
        msg.setTargetObjectId(toContactId);
        msg.setFileAttachments(fileList);
        msg.setHTMLBody(htmlEmailBody);
        msg.setSubject(EmailSubject);
        msgList.add(msg);

    }
    Messaging.sendEmail(msgList);

But I can't able to get the file in the email attachment. Any ideas on how to do it?
I have a Header component inside which another component named FeedHeader is rendered. My problem is FeedHeader component should not render on load. It should get rendered on button click. Any ideas how to do it?
Hi,
I need to query the Contract lookup field from Opportunity to check if contract exists. But I can't able to see the contract field to query.

Any help
Hi,

I have a Visual force page which uses a component. I need to assign value for textbox in a component through JQuery for some IE 9 placeholder issue. I tried something like this

var placeholderText = 'Contribute a post..';
        $(window).load(function() {
            $('#newPostContent').val(placeholderText);
        });

When it loads it shows the text and after loading it disappears.Any ideas?
Hi,

We are allowing user to mention other user in our community website. Now I need the list of Feeds the user is mentioned based on the user Id. Can anyone help me with it?
Hi Guys,

I need test class for the method below:

This class is written for overriding the view..

public PageReference redirectGroup()
    {
        if(Url.getSalesforceBaseUrl().toExternalForm()  == 'https://hello.cs20.force.com') // Checks for Community URL...
        {
            Id groupId = ApexPages.currentPage().getParameters().get('id');
            Id feedId = ApexPages.currentPage().getParameters().get('fid');
            if(feedId != null)
            {
                PageReference pg = new PageReference('/Community_FeedDetail');
                pg.getParameters().put('Id', groupId);
                pg.getParameters().put('fid', feedId);
                return pg;
            }
            else
            {
                PageReference pg = new PageReference('/Community_Groups_Feed');
                pg.getParameters().put('Id',groupId );
                return pg;
            }   
        }
        else
        {
           PageReference pg = new PageReference('/'+ApexPages.currentPage().getParameters().get('id')+'?nooverride=1');
           pg.setRedirect(true);
           return pg;
        }
Hi,

I am using pattern and matcher to [@name1]. Below is the regex
 
Pattern.compile('\\[\\@([a-z|A-Z|0-9].*?)\\]');
Using the matcher to get the values

String mentionName = pm.group(1);

Everything is works fine if it has only one [@name1] with specified pattern.

If it has more than one like [@name1] [@name2] only one value is returned. is it possible to get more than one value from the group?
Hi Guys,
I have enabled chatter notification on each post to a group in the settings. But the problem is I get email only on commenting on the post, but not on new post. Can anyone help me with this?

Thanks,
Vetri
I have a scenario where I am trying to run a method as a portal user and that method inturn creates a new account but when I try to do the same I am getting the below error can some one please help me.

System.DmlException: Insert failed. First exception on row 0; first error: OP_WITH_INVALID_USER_TYPE_EXCEPTION, Operation not valid for this user type: []
Hi,

I am getting an error as follows "Javascript proxies were not generated for controller. FeedController: may not use public remoted methods inside an iframe". The weired things is this was working fine before an hour or so. Now it is throwing errors. Can anyone please help me?

Thanks,
Vetri
Hi Experts,

Could any one write trigger on this please:
"Notes & Attachment section – Delete should not be available to any user except System Administrator for the Notes & Attachments."

Thanks in advance
Here my requirments is when i use the apexpages.standardsetcontroller the follwoing error will coming how can i rectify it.
here my line
public claimedTickets(ApexPages.StandardSetController con)
and error is  Constructor not defined: [ApexPages.StandardSetController].<Constructor>(Case)
please help me any one
Hi friends
I have a requirement where for every account name I need to show the related contact details in a separate visual force page.
For this I have written code to display all account names with a link button which will fetch related contact details.
But I am stuck at the code part in the second VF page.

VF_GetAllAccounts
<apex:page controller="DisplayAccountNamesController">
    <apex:form >
        <apex:messages />
        <apex:pageBlock >
            <apex:pageBlockTable value="{!Accounts}" 
                                                  var="a">
                <apex:column value="{!a.Name}"/>
               <apex:column value="{!a.Phone}"/>
               
                <apex:column width="12%">
                 <apex:commandLink action="{!OpenAccount}">
                        <apex:param name="SelectedAccountId" 
                                              value="{!a.Id}" 
                                              assignTo="{!SelectedAccountId}"/>
                        <h1>Open</h1>
                    </apex:commandLink>
                </apex:column>
            </apex:pageBlockTable>
        </apex:pageBlock>
    </apex:form>
</apex:page>

apex class1:

public class DisplayAccountNamesController 
{
   public string SelectedAccountId{get;set;}
   
   public DisplayAccountNamesController ()
   {
   }
    public list<Account> getAccounts() 
    {
        return [select ID,Name from Account order By Name Limit 20];
    }
    
    public PageReference OpenAccount()
    {
        return new PageReference('/' + SelectedAccountId);
    } 
}

Now I create the second VF page

VF_Page2

 <apex:dataTable value="{!contacts}" var="con" id="theTable">

        <apex:facet name="caption">table caption</apex:facet>

        <apex:facet name="header">table header</apex:facet>

        <apex:facet name="footer">table footer</apex:facet>

        <apex:column >
            <apex:outputText value="{!con.name}"/>
        </apex:column>

       <apex:column >

            <apex:outputText value="{!con.LastName}"/>

        </apex:column>

 
    </apex:dataTable>


In apex class1, I have SelectedAccountID  by which I can fetch related contacts but where do I code the soql query. because when I save this VF_page2
it will create another apex class .

Please let me know

regards
sonali verma



 
I'm having trouble rerendering a section on a Visualforce page.

I want to rerender the "Output Panel" with the id 'changeEm'. I've got a lookup to a Contact ct.Buyer__c and a checkbox that if changed to show/hide id='changeEm'

Let me know if there is a better Apex solution. Also, is there a way to how this occured in an AJAX fashion on page?
 
<apex:form >
      <apex:pageBlock >
     	
          Find Existing Contact <apex:inputField value="{!ct.Buyer__c}" ><apex:actionSupport event='onchange' reRender='changeEm'/></apex:inputField><br/><br/>
          Create New Buyer? <apex:inputCheckbox value ='{!turn}'><apex:actionSupport event='onchange' reRender='changeEm'/></apex:inputCheckbox>
           
      </apex:pageBlock>
      <apex:outputPanel id='changeEm'>
      <apex:pageBlock>
          First Name: <apex:inputText title="First Name" /><br/>
          Last Name: <apex:inputText title="Last Name" /><br/>
          		Email Address: <apex:inputText title="Email Address"/>
          
      </apex:pageBlock>
          </apex:outputPanel>
      
     <apex:dataTable id="cart" value="{!cart}" var="carti" rowClasses="odd,even">
			
   <apex:column headerValue="ID" rendered="false">
       <apex:outputText value="{!cart[carti].merchandise.Id}" >
       </apex:outputText>
          </apex:column>
          <apex:column headerValue="Product">
              <apex:outputText value="{!cart[carti].merchandise.name}">
          	
         </apex:outputText>
          </apex:column>
          <apex:column headervalue="Price">
              <apex:outputText value="{!cart[carti].merchandise.price__c}" />
          </apex:column>
          <apex:column headerValue="#Items">
              <apex:outputText value="{!cart[carti].count}"/>
          </apex:column>
      </apex:dataTable>
      <apex:commandButton action="{!back}" value="Back"/>
    </apex:form>