• anup ram
  • NEWBIE
  • 30 Points
  • Member since 2013

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 13
    Questions
  • 9
    Replies
HI all, I have a requirement to create records in salesforce from flex. But how do I connect to salesforce from flex?  flex is embedded on site page. How to do a post request in salesforce . I was planning to insert record into salesforce from Rest call

Hi All,

 I am facing a problem in assigning the total to wrapperclass property.

 

I have a pageblocktable with displays a pist of product with price. The quantity is entered. The total amount is calculated by calling a method in controller. But I am not bale to assign the total to that perticular row so that I am not able to display proper total on the pageblocktable.

 

please tell how to associate the total to wrapper class ..

 

Apex:

 

public class pricefromproduct

{

// where name like '%searchkey%'    select Id from product2 where name like '%searchkey%'

public pricefromproduct()

{

 

}

public integer total{get;set;}

public string searchkey {get;set;}

public list<pricewrapper> prwrp {get;set;} {prwrp = new list<pricewrapper>();}

// public list<productlist> prod{get;set;} {prod = new list<productlist>();}

public pagereference priceproduct()

{

 list<product2> prod = [select id from product2 where name like :'%'+searchkey+'%'];

 system.debug('prod size' + prod.size());

// prolist = [select id,name from product__c where name like : '%'+searchkey+'%'];

 

list<pricebookentry> pricebk = [Select Id, Name, ProductCode, Pricebook2Id, UnitPrice From PricebookEntry where Product2Id in :prod and usestandardprice = false and isactive = true];

  /*  best way to remove duplicates from list

  list<string> pr = new list<string>{'james','smith','james'};

  set<string> myset = new Set<string>();

List<string> result = new List<string>();

myset.addAll(pr);

result.addAll(myset);

system.debug(' pr size before filter ' + pr.size() + '   after ' + result.size());

*/

system.debug('pricebook size' + pricebk.size());

for (pricebookentry pb : pricebk)

{

pricewrapper p = new pricewrapper();

p.prc = pb;

p.prodprice = integer.valueof(pb.unitprice);

p.prodname = pb.name;

 

prwrp.add(p);

}

return null;

}

 

public integer f{get;set;}

public integer q{get;set;}

public pagereference totalcount()

{

f = integer.valueof(Apexpages.currentPage().getParameters().get('f'));

q = integer.valueof(Apexpages.currentPage().getParameters().get('q'));

total = f * q;

system.debug(' total ' + total);

 

 

return null;

}

 

 

 

public class pricewrapper

{

public pricebookentry prc{get;set;}

public integer prodprice{get;set;}

public string prodname{get;set;}

public boolean issel {get;set;}

public integer quantity{get;set;}

public integer totalamount{get;}

     

  public pricewrapper()

{

 

}

}

 

}

 

 

 

 

 

 

Hi I have a urgent requirement to edit specific rows on pageblocktable.

I am able to delete the specific row but not getting how to edit specific row.

 

can somebody share me a working code snippet so that i can refer and implement the logic.

 

Please help me

 

 

Hi ,

actionfunction not called. whats the mistake. please correct me where i am doing mistake.

 

I dont know if i am in right approach. I am pulling out price from LIST of products user enters tjhe quantity and total amount to be displayed. I am using param and actionfunction to do it.

I dont know if it will work onchange for a row in the list.

  please guide me.

 

 

VF :

<apex:form > 

<apex:actionFunction id="paramcall" name="paramcall" action="{!totalcount}" rerender="my">

<apex:param name="f" value="" assignTo="{!a.prodprice}"/>

<apex:param name="q" value="" assignTo="{!a.quantity}"/>

</apex:actionfunction>

</apex:form>

 

  <apex:form id="my">

 

<apex:pageBlock > Enter Search Value :

<apex:inputText value="{!searchkey}"/> 

<apex:commandButton value="Search" action="{!priceproduct}"/>

 

<apex:pageblockTable value="{!prwrp}" var="a">

<apex:column headervalue="Selected"><apex:inputcheckbox value="{!a.issel}"/>

</apex:column>

<apex:column headervalue="Name" >{!a.prodname}

</apex:column>

<apex:column headerValue="unitprice">

          <apex:outputText id="unitPrice" value="{!a.prodprice}"/>

        </apex:column>

 

<apex:column headerValue="Quantity" >

<apex:inputtext id="quantity" value="{!a.quantity}" onchange="paramcall(yes!)"  />

 

</apex:column>

 

 

<apex:column headerValue="total">

          <apex:outputText id="total"/>{!a.totalamount}

        </apex:column>

</apex:pageblockTable>

 

Apex: 

public integer total{get;set;}

public integer f{get;set;}
public integer q{get;set;}
public pagereference totalcount()
{
total = f * q;
system.debug(' total ' + total);
return null;
}

Hi All,

I have a lookup field on a object. I have written a soql to return name and other fields from the object with the looku field in the where clause. But this is not returning me values.

\please help.

 

list<contact> con = [select id,name from contact where name like 'a%'];
integer consize = con.size();     // returning 1, ( correct )
system.debug(' con size filter ' + consize);
for (contact conn : con)
{
system.debug(' contact name ' + conn.name ); // returning correct name

list<class__c> cls = [select name__c,Fee__c from class__c where classteacher__c =:conn.name];

integer classsize = cls.size();   // showing 0 , but one class is available with class teacher of conn.name
system.debug(' class size ' + classsize);

 

here classteacher__c is the lookup field to contact.

there is one class with classteacher name which is retuerned by conn.name but it is not being fetched.

Please help.

 

 

Hi,

 

My requirement is that I want a field(column) in pageBlockTable to be calculated dynamically based on 2 other fields.

I have 3 columns - Order quantity, Unit Price & Total Extended Price.

 

 

What I want to do is :

Whenever the value under Order quantity is changed in a row, the corresponding Total Extended Price should be calculated and refreshed (Total Extended Price = Order quantity * Unit Price ).

 

How can I achieve the same in Visualforce ?

 

Thanks in advance.

 

 

 

Regards,

Lakshmi.