• Vivek_Patel
  • NEWBIE
  • 382 Points
  • Member since 2015


  • Chatter
    Feed
  • 11
    Best Answers
  • 0
    Likes Received
  • 3
    Likes Given
  • 2
    Questions
  • 79
    Replies
while searching on Google about dynamic VF pages I found this blog (http://opfocus.com/blog/how-to-dynamically-add-a-configurable-list-of-fields/).
I created the custom settings and added few fields and records.But code is not working properly.

I am getting this error:
Could not resolve field 'NewOpp' from <apex:inputField> value binding '{!dummyOpp[FieldName]}' in page customsettingsvf 

thanks.
Hi,

the saveLog parameter looks like this:
...&MyPhoneField__c=+49(0)89/1250-0&...
The Task gets saved with all data except the phone number field which is now 49(0)89/1250-0.

Any help or suggestions appreciated.
Hi All,

I want to search Contacts using this query.
List<Contact> listcontact=[SELECT id,name,phone from Contact where Lastname=:lname and MailingAddress=:mailingaddress];

But unexpectedly it give the error.
Address fields can only be filtered using Distance expressions
Please help me..
Dear all, I`m trying to create a code which will prevent duplication in my org. THis code will run if lead is being created/updated and contact is already exisiting. If contact is already exisitng, lead will give an error. what I want to do is, if creator of this lead (user) is "Internal Login", trigger should not be applied and lead should be allowed to create. When I add "If" argument**, it is not working. It is either allowing everyone to create or no one to create dupe. I need a condition where only "Internal User" should be allowed to create dupes.. Can someone please help?

 
trigger AvoidDupe on Lead (before insert, before update) {

  for (Lead myLead : Trigger.new) {
              String Fullname;

                *//adding "if " argument below is not helping. it is either allowing everyone to create or no one to create dupe. I need a condition where only "Internal User" should be allowed to create dupes.

                 if (myLead.CreatedById == '00580000003a935') {
 
if (myLead.Email != null) {
List<Contact> dupes = [SELECT Id, FirstName, LastName,Name FROM Contact WHERE Email = :myLead.Email];
if (dupes.size() > 0) { 
FullName = dupes[0].Name;
mylead.addError('ERROR: There is already an identical record with same email. <a href=\'https://cs1.salesforce.com/' + dupes[0].Id + '\'> Contact - '+ FullName  +  '</a>', false);

} }
  }
}
}

 
Can someone help me in overriding the Salesforce1 date picker in my VF page ??

I am trying to get the salesforce1 datepicker look and feel in my VF page, which I am using as overriden page for Account..I want to get the same look and feel for date picker and date time picker...
Hi Guyz,

I am running into a scheduling problem with my apex class. I have a batch apex class named 'MyBatchApex' which I want to schedule to run every 5 minutes. I created a class with implements the Schedulable interface and here goes the code..
 
global class MySchedulerClass{
    global void execute(SchedulableContext sc) {
        ID BatchId = Database.executeBatch(new MyBatchApex(), 50);

    } 
    public static void scheduleThis(){
       String cronString='0 5 * * * ?';
       System.schedule('MyJob', cronString, new MySchedulerClass());
    }
}

To schedule this, I am running the following snipper from Developer Console 
MySchedulerClass.scheduleThis()

The job creates a async job and executes the batch after 5 mins as expected and then stops to run. I want this to execute every 5 minutes like a cron job. Am I doing anything wrong here? How to acheive a frequency of 5 min execution then?
Hi all,
          While working on my lightning components, one error is coming .  Is there anybody who can help me out ?
Error-  Cannot read property 'push' of undefined.
here is the sample of Helper.js


({
    createBAccount : function(component,BAccount) {
        this.upsertExpense(component, expense, function(a) {
            var BAccount = component.get("v.BAccount");
            BAccount.push(a.getReturnValue());
            component.set("v.BAccount", BAccount);
            this.updateTotal(component);
        });
    },
    upsertExpense : function(component, BAccount, callback) {
        var action = component.get("c.saveBAccount");
        action.setParams({
            "BAccount": BAccount
        });
        if (callback) {
            action.setCallback(this, callback);
        }
        $A.enqueueAction(action);
    },
})


The bold one is  getting an error over here .
  • February 16, 2015
  • Like
  • 0
<apex:page controller="CustopPopupTaxController"  
  title="Search" 
  showHeader="false" 
  sideBar="false" 
  tabStyle="Tax__c" 
  id="pg">

  <apex:form >
  <apex:outputPanel id="page" layout="block" style="margin:5px;padding:10px;padding-top:2px;">
    <apex:tabPanel switchType="client" selectedTab="name1" id="tabbedPanel">

      <!-- SEARCH TAB -->
      <apex:tab label="Search" name="tab1" id="tabOne">

        <apex:actionRegion >  
          <apex:outputPanel id="top" layout="block" style="margin:5px;padding:10px;padding-top:2px;">
            <apex:outputLabel value="Search" style="font-weight:Bold;padding-right:10px;" for="txtSearch"/>
            <apex:inputText id="txtSearch" value="{!searchString}" />
              <span style="padding-left:5px"><apex:commandButton id="btnGo" value="Go" action="{!Search}" rerender="searchResults"></apex:commandButton></span>
          </apex:outputPanel>

          <apex:outputPanel id="pnlSearchResults" style="margin:10px;height:350px;overflow-Y:auto;" layout="block">
            <apex:pageBlock id="searchResults"> 
              <apex:pageBlockTable value="{!results}" var="a" id="tblResults">
                <apex:column >
                  <apex:facet name="header">
                    <apex:outputPanel >Name</apex:outputPanel>
                  </apex:facet>
                   <apex:outputLink value="javascript:top.window.opener.lookupPick2('{!FormTag}','{!TextBox}_lkid','{!TextBox}','{!a.Id}','{!a.Name}', false)" rendered="{!NOT(ISNULL(a.Id))}">{!a.Name}</apex:outputLink>     
                </apex:column>
              </apex:pageBlockTable>
            </apex:pageBlock>
          </apex:outputPanel>
        </apex:actionRegion>

      </apex:tab>

      <!-- NEW Tax TAB -->
      <apex:tab label="New Tax" name="tab2" id="tabTwo">

        <apex:pageBlock id="newTax" title="New Tax" >

          <apex:pageBlockButtons >
            <apex:commandButton action="{!saveTax}" value="Save"/>
          </apex:pageBlockButtons>
          <apex:pageMessages />

          <apex:pageBlockSection columns="2">
            <apex:repeat value="{!$ObjectType.Tax__c.FieldSets.Tax_field_sets_for_Lookup}" var="f">
              <apex:inputField value="{!Tax__c[f]}"/>
            </apex:repeat>
          </apex:pageBlockSection> 
        </apex:pageBlock> 

      </apex:tab>
    </apex:tabPanel>
  </apex:outputPanel>
  </apex:form>
</apex:page>
This is my visualforce page which is showing a unknown property error. I don't know what is the reason. Below I have given my controller. Please Help me out. I have looked some of the discussions here but unable to understand exactly why this is happening.
public with sharing class CustopPopupTaxController {

  public Tax__c t1 {get;set;} // new account to create
  public List<Tax__c> results{get;set;} // search results
  public string searchString{get;set;} // search keyword

  public CustopPopupTaxController() {
    t1 = new Tax__c();
    // get the current search string
    searchString = System.currentPageReference().getParameters().get('lksrch');
    runSearch();  
  }

  // performs the keyword search
  public PageReference search() {
    runSearch();
    return null;
  }

  // prepare the query and issue the search command
  private void runSearch() {
    // TODO prepare query string for complex serarches & prevent injections
    results = performSearch(searchString);               
  } 

  // run the search and return the records found. 
  private List<Tax__c> performSearch(string searchString) {

    String soql = 'select id, name from Tax__c';
    if(searchString != '' && searchString != null)
      soql = soql +  ' where name LIKE \'%' + searchString +'%\'';
    soql = soql + ' limit 500';
    System.debug(soql);
    return database.query(soql); 

  }

  // save the new account record
  public PageReference saveTax() {
    insert t1;
    // reset the account
    t1 = new Tax__c();
    return null;
  }

  // used by the visualforce page to send the link to the right dom element
  public string getFormTag() {
    return System.currentPageReference().getParameters().get('frm');
  }
  
  

  // used by the visualforce page to send the link to the right dom element for the text box
  public string getTextBox() {
    return System.currentPageReference().getParameters().get('txt');
  }

}

 
Hello,

We are using {!case.link} almost in all of our email templates (HTML).
When clicking on the link directly from the email, some users receiving the following error:

"List has no rows for assignment to SObject "

We tried to analyze this issue and this is our findings:
When I clicked on the email template I was able to get into the case without problem.
Other users, used the same email template, got the error above. I noticed that there were some changes between the Id's in the URL:
My Id included uppercase letters: '5006000000lQenhAAC' and AAC addition in the end, while the other URL contained only lowercase characters: '5006000000lqenhAAA' and AAA addition.

It is important to understand that this issue started just recently, we are using this templates for almost two years now. Our Case layouts are VF pages, but I already checked the permissions...

Could you please advise?

Udi
Hi everyone,
My company needs to sync between our AWS MySQL db and the SalesForce db.
The sync will be bidirectional, and updates on both ends should have a latency of less than 1 min.
I've seen https://developer.salesforce.com/forums/ForumsMain?id=906F00000008sHdIAI, which asked the same thing 6 years ago. One of the solutions over there were to use a framewrok called CloudConnect (http://www.cloudconnect.com/). Is looks promising, but evidently SalesForce acquired them 2 years ago.
  1. Anybody knows if CloudConnect still exists for mySQL?
  2. Are there other framewroks for this purpose that you know of?
Thanks a lot,
Assaf
I have to display this tr only when there is a value in EOL_Info__c field in VF TEmplate

but for the following code i'm getting sytax error and if i remove (!) before IF then it will get save but wont work.

<tr style="display: {!IF((ISBLANK({!relatedTo.PRM_EOL_Info__c})), 'none', 'table-row')};">
                    <td>EOL Info:</td>
                    <td>{!relatedTo.EOL_Info__c}</td>
</tr>

Please suggest some solution

Thanks in advance

Regards,
GM
  • February 11, 2015
  • Like
  • 0
Hi,

I am trying to update a exiting JSON structure, but I couldn't find any method or way to do that.

This is how I am creating the JSON
 
JSONGenerator generator = JSON.createGenerator(true);
generator.writeStartObject();               
generator.writeStringField('action', 'VerifyEmail');
generator.writeEndObject();      
System.debug(generator.getAsString());

and now I want to update the existing "action" field's value and write some new fields in the same JSON.

Does apex support this?
I am looking for alternatives of Data.com which can be easily used with Salesforce and comparison between them in possible.

Regard,
Vivek Patel.
I've created an Apex class that makes a callout to an external SOAP-based web service. The web service provider has whitelisted Salesforce IP ranges and I'm getting an error. "System.CalloutException: IO Exception: java.security.cert.CertificateException: No subject alternative names present"

I think it has to do with the certificate because looking at the debug logs, certificate info like clientCertName_x in not populated when the call is made.(see yellow highlights in the image below). 
My teammate says it's because the endpoint URL (which points to dev environment) is an IP address & not a fully qualified URL with a publicly signed certificate securing it.
Debug logs:
User-added image
Please advice on what the issue is and list the steps to resolve it.
I found this solution and I think perhaps it's what I need also.
Please advice.
 
I have a json file : 
{"@odata.context":")","value":[{"id":"DA5019C32CA4C20F!107","name":"770-small.jpg","webUrl":""},{"id":"DA5019C32CA4C20F!108","name":"images.png","webUrl":""},{"id":"DA5019C32CA4C20F!109","name":"Salesforce_com_thumb230.png","webUrl":""}]}

I need to show this JSON file in VF table .
Need to get the id name and web url in three cloumn in table. 

Please Help . Thanks in advance . 


 
I have wriiten a test class for apex class.i got 89% but for loop is not covered.please see the screenshot for clarification.how to cover' for loop' and improve code coverage?
apex class:
public with sharing class Rfleet_Commericialcondition {
    //Variable Declaration Parts
    public List < RFLEET_Protocol_Grid__c > contt {get;set;}
    public List < EditableContact > myAssociatedContact {get;set;}
    public Integer editableContactNumber {get;set;}
    public Boolean refreshPage {get;set;}
    public String protocolname {get;set;}
    String id;
    //Constructor for invoking the Records from Protocol Grid Object
    public Rfleet_Commericialcondition(ApexPages.StandardController stdCtrl) {
            id = ApexPages.currentPage().getParameters().get('id');
            myAssociatedContact = new List < EditableContact > ();
            Integer counter = 0;
            RFLEET_Protocol__c conn = [select name from RFLEET_Protocol__c where id = : id];
            protocolname = conn.name;
            contt = [select id, Name, Rfleet_Type_of_Grid__c, Rfleet_Type_of_Sales__c, Rfleet_Protocol__c from RFLEET_Protocol_Grid__c where Rfleet_Protocol__r.name = : protocolname];

            for (RFLEET_Protocol_Grid__c myContact: contt) {
                myAssociatedContact.add(new EditableContact(myContact, false, counter));
                counter++;
            }
        }
        // This method is used for deleting the Row
    public void deleteRowEditAction() {
        try {
            myAssociatedContact.get(editableContactNumber).editable = false;
            delete(myAssociatedContact.get(editableContactNumber).myContact);
        } catch (Exception e) {}
        refreshPage = true;
    }
    public class EditableContact {
        public RFLEET_Protocol_Grid__c myContact {get;set;}
        public Boolean editable {get;set;}
        public Integer counterNumber {get;set;}
        public EditableContact(RFLEET_Protocol_Grid__c myContact, Boolean editable, Integer counterNumber) {
            this.myContact = myContact;
            this.editable = editable;
            this.counterNumber = counterNumber;
        }
    }
}
test class:
@isTest
public class Rfleet_Commercialcondition_Test {
    @isTest Static void Testcommercial(){
       
         RFLEET_Protocol_Grid__c myContact = new RFLEET_Protocol_Grid__c (Name='testing');
           insert myContact;
             myContact.Rfleet_Input_Mode__c = 'manually';
        update myContact;
            
            String Name = 'ListConditionCheck';
            Boolean editable; 
            Integer counterNumber;
            Boolean refreshPage;
            Integer editableContactNumber;        
            Rfleet_Commericialcondition.EditableContact wra= new Rfleet_Commericialcondition.EditableContact(myContact, editable, counterNumber);
            RFLEET_Protocol__c test = new RFLEET_Protocol__c(Name='prabu');
            insert test;
            test.Name = 'prabu';
            update test;
            System.debug('Before Query');
          
           
            RFLEET_Protocol__c myCondtest = new RFLEET_Protocol__c();
            myCondtest = [select id,Name from RFLEET_Protocol__c LIMIT 1];
            PageReference vfpage = Page.Rfleet_Commericialcondition;
            System.test.SetCurrentpage(vfpage);
            Apexpages.currentPage().getparameters().put('id',myCondtest.id);
            System.assertEquals(myCondtest.id,ApexPages.currentPage().getParameters().get('id'));
            Apexpages.StandardController sc = new Apexpages.StandardController(myCondtest);
            Rfleet_Commericialcondition commtest = new Rfleet_Commericialcondition(sc);
            commtest.deleteRowEditAction();
            System.assertEquals('prabu',test.Name);
        
               
    }
    
}
red color mark in test class

 
We want to enable My Domain for our Live org. we already have some existing sites working and we’ve implemented My Domain in our full copy  Sandbox, the urls for existing sites are not changed. Please let us know a possible reason for this and if implementing My Domain impact the existing Site urls in any manner.

Thanks
while searching on Google about dynamic VF pages I found this blog (http://opfocus.com/blog/how-to-dynamically-add-a-configurable-list-of-fields/).
I created the custom settings and added few fields and records.But code is not working properly.

I am getting this error:
Could not resolve field 'NewOpp' from <apex:inputField> value binding '{!dummyOpp[FieldName]}' in page customsettingsvf 

thanks.
Hello Team,

I have a custom object with tabs created inside the record as section separators.  If I put APEX;Detail it shows ALL the section of the record.  What code should I use to just show them by section so I can show them by each tab.

My APEX Code Below.  


<apex:page standardController="Property__c" showHeader="true" sidebar="false">
    <!-- Define Tab panel .css styles -->
    <style>
    .activeTab {background-color: #081f3f; color:white; background-image:none}
    .inactiveTab { background-color: lightgrey; color:black; background-image:none}
    </style>

    <!-- Create Tab panel -->
    <apex:tabPanel switchType="client" selectedTab="Property__c" id="AccountTabPanel"
        tabClass="activeTab" inactiveTabClass="inactiveTab">
        <apex:tab label="Property Information" name="name1" id="tabOne">content for tab one</apex:tab>
        <apex:detail subject="{!Property__c.ownerId}" relatedList="false" title="false"/> 
        
        <apex:tab label="Building Information" name="name2" id="tabTwo">content for tab two</apex:tab>
        <apex:tab label="Financial Information" name="name3" id="tabThree">content for tab two</apex:tab>
        <apex:tab label="Loan Information" name="name4" id="tabFour">content for tab two</apex:tab>
    </apex:tabPanel>
</apex:page>


Thanks nin advance
I want to store some information in the in session so that it can be exchange globally by different pages./
Is it possible. if not is there a way or work arround for this.

Thanks
Abhilash Mishra
Hi Team,
    I want to create a e-commerce shopping cart website using force.com. I am thinking about the standard salesforce objects for my database architeture. Those are Accounts, Contact, Contract, Products, PriceBook, Attachment & Document, Opprtunities etc. Could you please guide me to build this? I have created a basic ER- digram for a normal shopping cart, but I have no idea about what salesforce objects can use insted of my entity. Dou you have any shopping cart ER-Diagrmas related to salesforce. Otherwise Please tell me the sfdc object relations. I am not looking for any external  applications  on app exchange for now.

Please chek the ER diagram for shopping cart :  http://creately.com/diagram/hjs63tgx1/A4lBATFQ0CuG88bdEUMDzPrXc=
    
  • December 22, 2015
  • Like
  • 0
why is not return type of the constructor in class ???
Hi there,
We are looking for a freelance salesforce developer / adminsitrator to work freelance on various ongoing projects.  The person must be based in the UK and able to come into the office occasionally should we need them too. 
If you are interested and immediately free, please contact me via idalina.lucas@rb-a.org (mailto:idalina.lucas@rb-a.org). Many thanks, Idalina
I am looking for someone to create a tool for exporting to a specific file type (I have no idea the best way to accomplish what I need, counld be Web Services, could be something built-in) that does the following:

1. Generate a tab-delimited file that will be used for import into our accounting software. Name file with an extension of .iif (Quickbooks import file).
2. The file will require specific header names, and a repeating pattern for each row of data. For example:

Row 1 - Header names
Row 2 - Second row of header names
Row 3 - Close header names section

Row 4 - Open Data Row
Row 5 - Data
Row 6 - Close Data Row

Rows 4-6 repeat that pattern until the data runs out. 

If you think this is something you can handle, please let me know and perhaps offer up a bid. You can email me directly at shantelle AT openlegalservices.org .
could anyone please provide me a PDF for Salesforce Integration basic concepts
Hi All,

I'm using visualforce page to show Quotes. Withing VF page I use <apex:detail> to show standard Quote layout. However Create PDF button don't work and browser debug console is showing this error

Uncaught SecurityError: Blocked a frame with origin "https://c.na23.visual.force.com" from accessing a frame with origin "https://na23.salesforce.com". Protocols, domains, and ports must match.
Can someone help me in overriding the Salesforce1 date picker in my VF page ??

I am trying to get the salesforce1 datepicker look and feel in my VF page, which I am using as overriden page for Account..I want to get the same look and feel for date picker and date time picker...
I have reuirement to calculate distance between Shipping location and Customer.
We maintaned customer address(USA) in Account object with Zip code and Shipping location is customer object with full zip code address(USA).

Is there an app? What do I have to do.

Thanks
Hi,
It is not a question, I share my experience because I spent hours on this...
on my visualforce page, chrome kept telling me (in the Javascript console):
XMLHttpRequest cannot load https://eu3.salesforce.com/_ui/common/request/servlet/JsLoggingServlet.
No 'Access-Control-Allow-Origin' header is present on the requested resource.
Origin 'https://c.eu3.visual.force.com' is therefore not allowed access.
Browsing the net, I didn't find info on this error.
At the end, It appears this was due to a call to the "alert" javascript box just before the call to an "<apex:actionFunction". See below,
Javascript is:
function jsRemoveLineItemCatBtn() {
alert( 'CURRENT ID ' + vLICInProgressNum );
afRemoveLineItemCatBtn( String(vLICInProgressNum) );
}
where afRemoveLineItemCatBtn is the name of my action function.
Since I commented the call to alert, I don't have the error message anymore...
Hope to help few to save time.