• Saransh
  • NEWBIE
  • 119 Points
  • Member since 2015

  • Chatter
    Feed
  • 3
    Best Answers
  • 0
    Likes Received
  • 1
    Likes Given
  • 4
    Questions
  • 34
    Replies
test
<apex:pageBlock >         
                <apex:repeat value="{!pList}" var="x">                  
                    <apex:pageBlockSection title="{!x}" columns="1"  >
                        <apex:repeat value="{!pList[x]}" var="y">
                            <apex:pageBlockSection title="{!y}" columns="8" >
                                <apex:repeat value="{!pList[x][y]}" var="z">
                                    <apex:dataTable value="{!pList[x][y][z]}" var="z" border="1"  width="12.5%"  >
					 <apex:column>
					 1
                                        </apex:column>
					 <apex:column>
					 2
                                        </apex:column>   
                                    </apex:dataTable>
                                </apex:repeat>                                      
                            </apex:pageBlockSection>
                        </apex:repeat>
                    </apex:pageBlockSection>
                </apex:repeat>
            </apex:pageBlock>

I have a above snippet, which tries to display blocks in manner in second diagram but it displays in manner in first diagram.

Is there way i can fix the table width.
 

  • March 20, 2015
  • Like
  • 0
I have a Stanadard Object "SkillUser".
https://www.salesforce.com/developer/docs/api/Content/sforce_api_objects_profileskilluser.htm

there is no workFlow activated, for this Object.

Is there way, i could activate it.  We do not want to create a custom object beacause of limitation of licence
  • March 20, 2015
  • Like
  • 0
Hello,

Even after i delete the headerValue from Column, I can still see a thin header consuming space.
<apex:pageblocktable value="{!pList}" var="item">
    <apex:column headerValue="test"/>
</apex:pageblocktable>

 
  • March 18, 2015
  • Like
  • 0
I have a question, which is kind of bugging me from past few days.

Let suppose we are integrating Youtube with Salesforce. For that first we need to create a project to get access to Client id and secret key. Now my question was that this project I am creating on my google developer account but in case if we are implementing this integration for big clients like Chevron, Kroger etc in this case, will they going to create this project on their side using their account or we can use same project what we have created on our side, which I think shouldn't be a case?

User-added image
I am not able to get access_token from above URL.

I have tried below code but even then 'token' is returning null value.
token = ApexPages.currentPage().getParameters().get('%23access_token');

 
Hi, I am just checking if custom component work the way I want it to be. Please if anyone of you can guide me why 
//Account Visualforce Page

<apex:page standardController="Account" extensions="multiCycle" showHeader="false" sidebar="false">
<style>
td
{
vertical-align:top;
}
</style>
<apex:form >
 <apex:panelGrid columns="2" id="theGrid" border="1" rules="group" width="100%">
    <apex:pageBlock title="Accounts">
    <apex:pageBlockSection >
        <apex:pageBlockTable width="" value="{!lstAccount}" var="Account">
                <apex:column >
                <apex:facet name="header">Name</apex:facet>
                    <apex:actionSupport event="onclick" reRender="getContactId">
                        {!Account.name}
                        <apex:param value="{!AccountId}" name="ParamAccId"/>
                    </apex:actionSupport>
                </apex:column>            
            <apex:column value="{!Account.phone}"/>
            <apex:column value="{!Account.Industry}"/>
            <apex:column value="{!Account.type}"/>
        </apex:pageBlockTable>
    </apex:pageBlockSection>
</apex:pageBlock>

<c:contacts getContact="{!$CurrentPage.Parameters.ParamAccId}" id="getContactId"> </c:contacts>

</apex:panelGrid>
</apex:form>

</apex:page>

//multiCycle apex class

public with sharing class multiCycle {

public list<account> lstAccount{get;set;}
public String AccountId{get;set;}

    public multiCycle(ApexPages.StandardController controller) {
        lstAccount = new list<Account>();
        AccountId = '';
        lstAccount = [select id,name,phone,type,Industry from Account limit 3];
    }

}


//Component "Contacts"

<apex:component controller="getContacts" allowDML="true">
<apex:attribute name="getContact" assignTo="{!getAccountId}"  type="String" description="Provide Account Id"/>
<apex:pageBlock title="Contacts" >
    <apex:pageBlockSection>
        <apex:pageBlockTable value="{!lstofcontacts}" var="contact">
            <apex:column value="{!contact.name}"/>
            <apex:column value="{!contact.Account.name}"/>
            <apex:column value="{!contact.Phone}"/>
            <apex:column value="{!contact.Email}"/>
        </apex:pageBlockTable>
    </apex:pageBlockSection>
</apex:pageBlock>
</apex:component>

//Component Class

public class getContacts{

public string getAccountId{get;set;}
public list<contact> lstofcontacts{get;set;}

public getcontacts(){
    lstofcontacts = new list<Contact>();

    system.debug('Debug AccountID = '+getAccountId); //getAccountId is coming as NULL here.

    if(!String.isEmpty(getAccountId))
            {
                lstofcontacts = [Select id,name,account.name,AccountId,phone,email 
                                            from contact 
                                            where AccountId =:getAccountId];
            } 
}

}



 
<apex:page id="pgid" standardController="Account">

<script> 
function callDelete(paramId) { 
alert(document.getElementById(paramId)); 
<b>//Need value of hidden field containing account id but during rendering <apex:inputHidden></b>
} 
</script>

<apex:form id="frmid">
      <apex:pageblock id="pgblockId">
      <apex:pageBlockSection id="pgblcksec1" >
      </apex:pageBlockSection>
          <apex:pageBlockSection id="pgblcksec2">
              <apex:pageBlockTable id="pgblcktb" value="{!lst}" var="acc">
                  <apex:column value="{!acc.name}"/>
                  <apex:column value="{!acc.type}"/>
                  <apex:column value="{!acc.phone}"/>
                  <apex:inputHidden value="{!acc.id}" id="hdnaccid"/>
                  <apex:column >
                      <apex:commandButton id="cmdId" onclick="callDelete('{!$Component.hdnaccid}');" value="Delete"/>
                  </apex:column>
          </apex:pageBlockTable>
       </apex:pageBlockSection>
      </apex:pageblock>
      </apex:form>
</apex:page>
Hi,
I am a newbie to salesforce,my company hired some salesforce contractor to integrate salesforce with our internal database. I thought it is not difficult to do:
1. for each account, we add a custom field which is a List of object Tool.
2. For each object Tool, it has a list of object Group.
3. For each group, there are some custom fields.

So it is a grandparent -child relationship and I want to run a query for each account to return:
1. a list of custom tool objects,
2. in individual tool object, also return a list of group objects.

The contractor told me that it is rather difficult to implement in salesforce, is it right? I am a database and c# developer, at the moment, not really sure why this is difficult?

Can someone give me some idea?

Many Thanks 
 
How to filter in SOQL on count criteria ?This Query give me info more than one review related list record on acocunt
SELECT Account_Name__c, count(id) FROM Review__c GROUP BY Account_Name__c HAVING Count(Account_Name__c) > 1

My question is how to ensure that duplicates are not part of below FOR query, please provide code or syntax to me.

for(Private_Account_Information__c reviewForVar : [select id , Account_Name__c , Subject__c, X20_Group__c, Current_Provider__c, DRAD__c, PVR__c, Service_Contract_Participation__c from Review__c where Account_Name__c!= null])
Im unable to create a new Force.com project in Eclipse Kepler Version: 4.3.0. 
I enter my username/password & security token but still no success.
Hi All,

What I need to implement:
A VF page includes a command button "Date Entry", once users click the button, a few pramas need to be past (use POST rather than GET) to external data entry website, the page also need to be redirected to external data entry website.

I googled many related solutions, they all use GET which is appended all parameters in URL, such as:
---------------------------------------------------------------------------------
public PageReference redirect2DataEntry(){
        PageReference pageRef = new PageReference('https://www.dataentry.com/login');
        pageRef.getParameters().put('username', 'abc');
        pageRef.getParameters().put('passcode', 'xyz');
        .... ....
        return pageRef;
    }
------------------------------------------------------------------------------

My question is, can we use POST (append params in HTTP header) to pass the parameters? Some one mentioned that HttpRequest class can be used to send POST request (see below), but the problem is how can I redirect to external web page at the same time by using HttpRequest class in the controller?

-----------------------------------

String endpoint = 'http://www.example.com/service'; 
String body = 'fname=firstname&lname=lastname&age=34'; 
HttpRequest req = new HttpRequest(); 
req.setEndpoint(enpoint); 
req.setMethod('POST'); 
req.setbody(body); 
Http http = new Http(); 
HTTPResponse response = http.send(req);
---------------------------------------------------------------------------------



Thanks in advance.
  • March 22, 2015
  • Like
  • 0
Hi,

I have two interfaces, called A and B and I want to create a third interface, called C, that extends both of these, e.g.
global interface C extends A, B {
 
}

However, it isn't valid.  Have I missed something or does Salesforce not allow this?

Thanks,

Carl
  • March 20, 2015
  • Like
  • 0
test
<apex:pageBlock >         
                <apex:repeat value="{!pList}" var="x">                  
                    <apex:pageBlockSection title="{!x}" columns="1"  >
                        <apex:repeat value="{!pList[x]}" var="y">
                            <apex:pageBlockSection title="{!y}" columns="8" >
                                <apex:repeat value="{!pList[x][y]}" var="z">
                                    <apex:dataTable value="{!pList[x][y][z]}" var="z" border="1"  width="12.5%"  >
					 <apex:column>
					 1
                                        </apex:column>
					 <apex:column>
					 2
                                        </apex:column>   
                                    </apex:dataTable>
                                </apex:repeat>                                      
                            </apex:pageBlockSection>
                        </apex:repeat>
                    </apex:pageBlockSection>
                </apex:repeat>
            </apex:pageBlock>

I have a above snippet, which tries to display blocks in manner in second diagram but it displays in manner in first diagram.

Is there way i can fix the table width.
 

  • March 20, 2015
  • Like
  • 0
Hi

When I create a new page like this:

<apex:page>
  <!-- Begin Default Content REMOVE THIS -->
  <h1>Congratulations</h1>
  This is your new Page
  <!-- End Default Content REMOVE THIS -->
</apex:page>

The source of that page looks like this:

&lt;apex:page &gt;
&lt;!-- Begin Default Content REMOVE THIS --&gt;
&lt;h1&gt;Congratulations&lt;/h1&gt;
This is your new Page
&lt;!-- End Default Content REMOVE THIS --&gt;
&lt;/apex:page&gt;

Why is this , and how can I make it render html tags with < and > intact.

Thanks
 
Hello All,

I've been assigned the task of creating a custom button on the Contact object to automagically convert Contacts to Person Accounts. I came across a great post online here:

http://www.x2od.com/2008/08/19/convert-between-business-and-person-accounts-b2b-b2c#comment-70797

... which seems like the direction I need to go. I did create the custom button to execute Java - here's the code:

{!REQUIRESCRIPT("/soap/ajax/13.0/connection.js")} 
var ContactObj = new sforce.SObject("Account"); 
ContactObj.Id = '{!Account.Id}'; 
ContactObj.RecordTypeId = '0120000000099Lo'; 
sforce.connection.update([ContactObj]); 
location.reload(true);

No syntax errors, created the button, put it on the Contact layout, created a test Contact, hit the button ... and ... zippo; nothing happens, not even an error message.

Anyone have a clue what I might be missing?

Thanks!
hello,
I'm having trouble with creating the formula syntex for a date field update.  I am trying to get a custom date field to update.  the field is called "Survey Sent Date and it is on a custom object called Special Events.   i have email alerts set up to send out an email 24 hours after the date listed on another field called "End Date" that's on the special events object.   so I was wondering how can i write the formula for the Survey sent date as an immediate workflow action based on the date entered from End Date.  the date in (Survey Sent Date field) should be 24 hours away from the End date.  I hope this makes sense.  any help would be greatly appreciated. 

Thanks!
 
system.debug([Select COUNT() from XXX__c]);

will raise:
FATAL_ERROR|System.LimitException: Too many query rows: 50001
How can i add a link to page in Chatter ?
  • March 20, 2015
  • Like
  • 0
I have a Stanadard Object "SkillUser".
https://www.salesforce.com/developer/docs/api/Content/sforce_api_objects_profileskilluser.htm

there is no workFlow activated, for this Object.

Is there way, i could activate it.  We do not want to create a custom object beacause of limitation of licence
  • March 20, 2015
  • Like
  • 0
User-added image
It takes long time to save this simple apex page. So long that i lost patience and closed the browser.
I have tried a few times but saw the status changing to "Saved" .
When i forcibly close the console window all changes are lost.
Tried it on latest Firefox and Chrome browsers with same result.

 
Hi guys,
i want to share with you a solution I come up with, to wrap long url when rendering a VF page.
Basically the problem was this:
A customer pasted a very long URL (more than 400 chars) in a Rich Text Area. When rendering the page as PDF, to print it, the URL overflow the page margin, so it wasn't visible at all.

This is the code i come up with
private String addWhiteSpaceInUrlTooLong(String text) {
        // Step 1 - Search anchor links
        Pattern ptn = Pattern.compile('<a[^>]*(>.*?)</a>'); // WATCH OUT! This regex doesn't match nested anchor
        Matcher mch = ptn.matcher(text);
        Integer charPerLine = 50; // A whitespace is inserted each charPerLine chars
        while (mch.find()) {
            String toReplace = mch.group(1);
            String substitute = '';
            Integer len = toReplace.length();

            if (len < charPerLine) //No need to replace
                continue;

            Integer elems; // White space to insert

            if (len / charPerLine == 0)
                elems = len / charPerLine;
            else
                elems = len / charPerLine + 1;

            // Insert white spaces
            for (Integer i = 1; i <= elems; i++) {
                if ((charPerLine * i) < len)
                    substitute += toReplace.substring(charPerLine * (i - 1), charPerLine * i) + ' ';
                else
                    substitute += toReplace.substring(charPerLine * (i - 1), len) + ' ';
            }

            text = text.replace(toReplace, substitute);            
        }

        // Step 2 - Search pasted links
        ptn = Pattern.compile('\\b\\s(https?://\\S.*?)(\\s|$)');
        mch = ptn.matcher(text);
        charPerLine = 60;

        while(mch.find()) {
            String toReplace = mch.group();
            String substitute = '';
            Integer len = toReplace.length();

            if (len < charPerLine)
                continue;

            Integer elems;

            if (len / charPerLine == 0)
                elems = len / charPerLine;
            else
                elems = len / charPerLine + 1;

            // Insert white spaces
            for (Integer i = 1; i <= elems; i++) {
                if ((charPerLine * i) < len)
                    substitute += toReplace.substring(charPerLine * (i - 1), charPerLine * i) + ' ';
                else
                    substitute += toReplace.substring(charPerLine * (i - 1), len) + ' ';
            }

            text = text.replace(toReplace, substitute);
        }

        return text;
    }

You could use like this:
MyCustomObject.richText = addWhiteSpaceInUrlTooLOng(MyCustomObject.richText);
Hope it will be useful ;)