• ES
  • NEWBIE
  • 50 Points
  • Member since 2006

  • Chatter
    Feed
  • 2
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 80
    Replies
Hi,
 
I want 15 digit TagDefinationId from slaesforce database.Rightnow it is returning 18 digit.
 
I need to use this Id inside iterator loop with href.
 
Here is my function.
 
Code:
<apex:dataList value="{!accountTags}" var="accountTag" id="theList">
 <apex:outputLink value="/search/TagSearchResults—tIdList={!accountTag.TagDefinitionId}&tagsSearch={!accountTag.Name}&lsc=-10&" id="theLink" title="View records tagged {!accountTag.Name}" rendered="{!showPersonalTag2}" >{!accountTag.Name}</apex:outputLink>
 , 
</apex:dataList>

 

Using 18 digit Id is not giving me correct href link.

Can someone give me Idea to place directly 15 digit Id in visual force outputlink syntext with loop.

I don't want to go to controller nad come back with Id.

-any way to get 15 digit Id from query instead of 18 digit.

-Thanks


 
Oh come on! So I had to wait 6 months for visualforce to be available in my production org, and now that the day is finaly here, I can't create custom controllers?
 
You have got to be kidding me. Someone please tell me what is going on. Is there a work around? Something other than having to use eclipse or some other IDE, because that completely defeats the purpose of having the visualforce page editor in the first place.
 
There has to be another way, please help.:smileysad:

I have a table on a Visualforce page where the first two columns have buttons that can edit or delete the corresponding rows. Both buttons use essentially the same code and call very similar APEX code. However, one works, and the other does not:

 

 Works:

 

VISUALFORCE

 

<td>

<apex:commandbutton action="{!edit}" value="Edit" rerender="itemList">

<apex:param name="editid" value="{!rowitem.Id}"/>

</apex:commandbutton>

</td>

 

APEX CODE

 

public PageReference edit() {

String editid = getParam('editid');

editItem = [SELECT id, Name,Total_Price__c,Quantity__c, Description__c,Agreed_Carriage__c,Agreed_Price__c,Reference__c,Purchase_Order__c FROM SFDC_Purchase_Requisition__c WHERE Id=:editid];

return null;

}

  

 DOESN'T WORK

VISUALFORCE

 

<td>

<apex:commandbutton action="{!del}" value="Del">

<apex:param name="delid" value="{!rowitem.Id}"/>

</apex:commandbutton>

</td>

 

APEX CODE

 

public PageReference del() {

try {

String delid = getParam('delid');

SFDC_Purchase_Requisition__c item = [SELECT Id FROM SFDC_Purchase_Requisition__c WHERE Id=:delid];

delete item;

} catch (Exception e) {

ApexPages.addMessages(e);

}

return null;

}

 

 The error I get is a standard "List has no rows for assignment to SObject", due to the fact that it seems to think that "delid" is a null string.

 

I have added debug logs to each instance of Apex that output the current page. In the sample that works, the parameter "editid "can be seen and is correctly formed within the url of the current page.

 

Oddly, when debugging the code that doesn't work, it seems that the parameter isn't correctly passed into the url. I was able to find the {!rowitem.id} but it isn't linked to the name "delid". Instead it seems to be linked to what must be a Salesforce code name which looks something like:

 

 

j_id0%3Aj_id28%3Aj_id44%3Aj_id46%3A0%3Aj_id66=a0qR0000000JBkNIAW // a0qR0000000JBkNIAW is the rowitem id

 

I've also put in other test parameters and found a similar occurance. 

 

The table is formed from nested  <tr> and <td> tags and in all other ways performs as expected. I was just wondering if anybody knew of a reason behind this?

 

 

Message Edited by Big Ears on 07-14-2009 09:50 AM

We've got a list button that calls a VF pg which uses an extension to the standard controller for a custom object.

 

Unless I'm absolutely crazy, this worked fine very recently.  (Last week?)  Today it doesn't work.  I get the following error:

 

Invalid variant 'parent': value 'Opportunity'

 

Which I don't understand at all.  I've tried it in various instances and it seems to have stopped working everywhere.  SF, did you push a change that caused this to stop working?

 

Here's the code.  First the page:

 

 

<apex:page standardController="OppPayment__c" recordSetVar="installments" extensions="ONEN_EXT_MarkPaymentsPaid" action="{!markInstallmentsWrittenOff}">
<apex:param name="mark" value="writeoff"/>
</apex:page>

 

next the extension:

 

 

public class ONEN_EXT_MarkPaymentsPaid {

private List<OppPayment__c> selectedInstallments;
private String mark;

//have to instantiate with StandardSetController for list buttons
public ONEN_EXT_MarkPaymentsPaid(ApexPages.StandardSetController controller) {
//get the selected ids that were checked
this.selectedInstallments = (List<OppPayment__c>)controller.getSelected();
}

public pageReference markInstallmentsPaid() {
mark='paid';
PageReference p = markInstallments();
return p;
}

public pageReference markInstallmentsWrittenOff() {
mark='writeoff';
PageReference p = markInstallments();
return p;
}

pageReference markInstallments() {
//get all the installments that were selected
List<OppPayment__c> InstallmentsFromSelection = [select Id,paid__c from OppPayment__c where Id IN :selectedInstallments];
if (InstallmentsFromSelection.size()>0) {
for (OppPayment__c thisInstallment : InstallmentsFromSelection) {
//if we're passing in paid on the querystring, mark them paid
if(mark=='paid') {
thisInstallment.paid__c=true;
thisInstallment.Written_Off__c=false;
} else if(mark=='writeoff') {
thisInstallment.Written_Off__c=true;
thisInstallment.paid__c=false;
}
}

update InstallmentsFromSelection;
}
PageReference p = new PageReference(System.currentPageReference().getParameters().get('retURL'));
p.setRedirect(true);
return p;
}
}

 

 BTW, OppPayment__c is a custom object which is detail-master to Opportunity.  The button is being accessed from a related list on an Opportunity layout.

 

edit: I just discovered that this list button works fine when called from the Console or from an OppPayment__c list view.  So the error seems to only occur when it's called from a related list on the Opp layout.  (Hence the reference to Opportunity being the 'parent', I assume.)

 

BTW, we have unit tests, and they all still pass.  So whatever the issue here is, it seems to happen only in the SF UI.   Also, nothing shows up in the System Log.

 

Can anyone help here?  

 

Thanks much!

 

PS: here's another post that may be related that looks like it was never answered: http://community.salesforce.com/sforce/board/message?board.id=Visualforce&thread.id=12980

 

 

 

 

Message Edited by sparky on 07-06-2009 10:54 PM
Message Edited by sparky on 07-06-2009 11:06 PM

Hi,

     we are working on an application this application is working fine before summer in packaged installed application ,but right now am it is behaving differently.

 

 

The issue is with apex:commandlink action property.using command link action property am constructing an URL in this URLa m calling an VF page ,it is working fine in unmanaged code ,if i packaged the same code it not working (i.r for testing purpose we are using summer sandboxes and free developers account .it is not working I opened a free developer account after summer release that same package is working find if i installed the package application in old account.

 

 

Anybody know about this behavior .I added proper names space also but in this scenario am suspecting the action function ,when am invvoking the action function it is failing in new account.

 

 

It is very urgent anybody faced this type so issues help me. or some salesforce.com person can look in the issue.

 

  • June 22, 2009
  • Like
  • 0

Hi,

 

I receive the following error message...

 

Tag Library supports namespace: http://salesforce.com/standard/components/apex, but no tag was defined for name: form

 

Not sure why this error message pops up suddenly, i could'nt find anything in the debug log .I get this error when i click on a "Search" button, which runs a query in the class.

 

Any help would be great...

 

Thanks,

Hi,

I want to delete Tag when user click on tag name from visual force custom component while Edit tag.

Here is my code.

Code:
<script src="/soap/ajax/14.0/connection.js" type="text/javascript"></script> 
<script language="JavaScript1.2" src="/js/functions.js"></script> 
<script type="text/javascript" language="JavaScript1.2">
function foo(tag){
alert(tag);
var delResult = sforce.connection.deleteIds([tag]);
  if (delResult[0].getBoolean("success")) {
alert("Tag with id " + result[0].id + " deleted");
} else {
alert("failed to delete Tag " + result[0]);
}
}
</script>
<apex:repeat value="{!accountTags}" var="accountTag" id="theList1">
<span class="tag">
{!accountTag.Name}[
<FONT color="#FF0000" >
<span class="tagRemove" title="Remove tag {!accountTag.Name}" onclick="foo('{!accountTag.Id}');">X</span>
</FONT>]
</span>,
</apex:repeat>

Here I am getting faultCode:'sf:Invalid_session_Id' exception.

Can you point me how to work this script or how I can send this request to contrller and remove the Tag from Salesforce database.

My probllem is I don't know how to send accountTag.Id to controller when user click on that tag so in contrller I cna remove this Tag.

So I place ajax call in component it self so I don't need to call controller and send tag Id to controller.

-Any suggestion?

 

-Thanks,

Hi,
 
I want 15 digit TagDefinationId from slaesforce database.Rightnow it is returning 18 digit.
 
I need to use this Id inside iterator loop with href.
 
Here is my function.
 
Code:
<apex:dataList value="{!accountTags}" var="accountTag" id="theList">
 <apex:outputLink value="/search/TagSearchResults—tIdList={!accountTag.TagDefinitionId}&tagsSearch={!accountTag.Name}&lsc=-10&" id="theLink" title="View records tagged {!accountTag.Name}" rendered="{!showPersonalTag2}" >{!accountTag.Name}</apex:outputLink>
 , 
</apex:dataList>

 

Using 18 digit Id is not giving me correct href link.

Can someone give me Idea to place directly 15 digit Id in visual force outputlink syntext with loop.

I don't want to go to controller nad come back with Id.

-any way to get 15 digit Id from query instead of 18 digit.

-Thanks


 
Hi,
 
    When I executed Input File Sample Usage given in Reference Document,page is redirecting to Documents object--detail   page layout.How to return to some VF Page(Named XYZ) when this sample Usage Code is executed instead of redirecting document detail page.
 
Please suggest me.
 
Thanks
Raj
 
Hi,

When I hide the tab and sideabar using showHeader="false" the tab style is lost and everything is black. Is this a bug or normal behavior? If normal, how could I use the tab style from my custom object even if header is hidden?

Code:
<apex:page standardController="FL_Tender__c" showHeader="false" sidebar="false" tabStyle="FL_Tender__c">

<apex:detail ></apex:detail>

</apex:page>

 

  • September 22, 2008
  • Like
  • 0
Hello ... I am in the Dev 501 training class and we had an excercise which included using VisualForce controllers and deploying the code to our sandbox org, we created a controller and a Visual Force page but the Visual Force page fails stating

Save error: Expression Error: Named Object: core.apexpages.components.cdk.ApexComponentRefHandler not found.

Upong researching the issue on the web, one of the community discussion boards stated this is an error while using <PageMessages> in the Visual Force page. I tried commenting out the line and it compiles fine. However I did wanna bring this up and see if any one else is having issues as well or if anyone knows when can this be fixed? Or if there is another area to post such requests?

Thanks
Praf
  • September 12, 2008
  • Like
  • 0
Hello,

This is so frightening when something like this happens.

We had the following code
Code:
                  pageRef = new PageReference(url); 
                  pageRef.setRedirect(false);
                  return pageRef;

It was working just fine up until two days ago. Suddenly, it stops working and the Visual Force page sits in the intermediate page and nothing happens after the method executes in the controller. Is there any change recently that I am not aware of. Please respond.

Thanks,
Girish Suravajhula.

 



Message Edited by Girish989 on 09-11-2008 07:48 AM
hi all

             i want to create task visualforece page but get the bellow error
    Could not resolve the entity from <apex:inputField> value binding '{!task.subject}'. inputField can only be used with SObject fields.

my code is as bellow  please help me out.

thanks
Code:
//apex page code
<apex:page controller="myTask">
  <apex:form >
  <apex:pageBlock title="Task" mode="edit">
   <apex:pageBlockButtons >
  <apex:commandButton action="{!save}" value="save"/>
  </apex:pageBlockButtons>
  <apex:pageBlockSection title="Task Information">
  <apex:inputfield id = "subject" value = "{!task.subject}"/>
  </apex:pageBlockSection>
  </apex:pageBlock>
  </apex:form>
</apex:page>


//controller code
public class myTask {

    public PageReference save() {
        return null;
    }


    Task task;

    public Task getTask() {
        
        task = new Task();
        return task;

    }

}

 

I have a requirement to show large amount Account records to the user.
I want to develop a Visual Force Page with a PageBlockTable and ideally i want the page block table show maybe 20 records at time but through paging allow the users to browse more than 7000 records.

Is this possible?

I am writing a VF page that replaces the Edit/Page page of my custom object (A). Edit and New buttons are overrided to show my VF page.  (A) has mater-detail relationship with Custom object (B).

When i click on custom object (A) List Button "New" from Custom Object (B) detail page following Url is produced:

/a03/e?CF00N700000028JuA=Custom+Object+A+Name&CF00N700000028JuA_lkid=a007000000A7Rc1&scontrolCaching=1&retURL=%2Fa007000000A7Rc1

a007000000A7Rc1 = this the Custom Object A ID.

And my VF page is lunched properly but the inputField which is hooked to Custom Object (A) is empty!

Any idea how i can fix this?


Hi,
I am having a problem in making calls to webservice methods using the sforce.apex.execute method.
The exception i get is

Error {faultcode:'sf:INVALID_SESSION_ID', faultstring:'INVALID_SESSION_ID: Invalid Session ID found in SessionHeader: Illegal Session', line:'1019', sourceURL:'https://na5.salesforce.com/soap/ajax/13.0/connection.js', }

I wrote a javascript to call webservice method passing arguments to save it in my server.
/////////////////////////////////////////////////////////////////////////////////////
function call()
{
var mess= sforce.apex.execute('MyController','getSend',{cname:document.getElementById('cname').value,email:document.getElementById('cmail').value,phone:document.getElementById('cphone').value,product:products});
}
/////////////////////////////////////////////////////////////////////////////////////

The controller contains the webservice method defined.
/////////////////////////////////////////////////////////////////////////////////////
WebService static String getSend(String cname,String email,String phone,String product) {
System.debug('inside send '+cname );
Http h = new Http();
HttpRequest req = new HttpRequest();
req.setMethod('GET');
//req.setHeader('Cookie','sid='+UserInfo.getSessionId());
//+'&product='+product
req.setEndpoint('http://www.iclub.in/MRUserTrail/insert.html? userName='+UserInfo.getUserName()+'&cname='+cname+'&cemail='+email+'&cphone='+phone+'&product='+product);
HttpResponse res = h.send(req);
System.debug(res.getBody());
XmlStreamReader reader = res.getXmlStreamReader();

while(reader.hasNext()) {
if (reader.getEventType() == XmlTag.START_ELEMENT) {
if(reader.getLocalName()=='status')
{
reader.next();
if(reader.getText()=='FAILURE')
{
reader.next();reader.next();reader.next();

return 'f$'+reader.getText();
}
if(reader.getText()=='SUCCESS')
{
reader.next();reader.next();reader.next();
return 's$'+reader.getText();
}
}
}
reader.next();
}
return 'f$Please try again after some time';
}
/////////////////////////////////////////////////////////////////////////////////////
I used this sforce.apex.execute because there was not way to call an controller method by passing
an argument's to it.I tried various ways of callling the controller but i could not do so. If it is
just an normal method without parameters then we can call it using !${Accounts.name}.

Q.Please tell me is there a way to call controller methods by passing parameters to it?

Q2.Please help me on this exception i am getting when calling the javascript function.

Thaking You everyone.
I need to display text in a Textarea.Is it possible to save the text document in a static resource and call that using ($Resource.Resourcename) in <apex:inputTextarea> tag?

Please provide me the solution.
There is and object by name SPP_Account_Track__c which has a relatonship with Account. I've to display the Account track details of an Account in the form of a datatable with 3 fields Track, qualification status and enrollment status which are there in Account track object.
In the last column 'Action' of the datatable i need to conditionally the values in the form of a link.

If the qualification status is qualified and enrollment status is enrolled, the Action column should have 'View Entitlements' link.
If the qualification status is not qualified and enrollment status is not enrolled, the Action column should have 'View Requirements' link.
If the qualification status is qualified and enrollment status is not enrolled, the Action column should have 'Enroll Now' link.

Any suggestion on how to approach this will be of a great help.

Thanks
Arvind