Controller:
public void geterp(string nicpn){
// local variables
String Accountcode;
Quote__c quoteWithAccountCode;
Quote__c langaugetranslation;
string PartNic;
string PartDescription ;
string PartStock;
string PartDescriptionUK;
string PartClientPNREF;
//Capturing Quote id
getRes1.GetInfoResult= soap.GetInfo(nicpn,'6f50456b91ef8ec5123e9c9600380ed5');
}catch(Exception e){
}
}
String XMLString;
if(Test.isRunningTest()==True){
XMLString='<RESULT><PARTNUMBER>0F12</PARTNUMBER><DESCRIPTION>Boîtier série\'s 0F 12 pts</DESCRIPTION><DESCRIPTIONUK>housing serie\'s OF 12pts</DESCRIPTIONUK><STOCK>43382</STOCK><CLIENTPNS></CLIENTPNS></RESULT>';
}else{
XMLString = getRes1.GetInfoResult;
}
//Getting the values from xml String
if(XMLString!=null){
Dom.Document doc = new Dom.Document();
doc.load(XMLString);
dom.XmlNode node=doc.getRootElement();
//Condition to check the responce without error
if(node.getChildElements()[0].getName() != 'ERROR'){
PartNicomatic=node.getChildElement('PARTNUMBER',null).getText();
PartDescription= node.getChildElement('DESCRIPTION',null).getText();
PartDescriptionUK=node.getChildElement('DESCRIPTIONUK',null).getText();
PartStock= node.getChildElement('STOCK',null).getText();
//Iterating the child elements
for(dom.XmlNode child:node.getChildElements()){
if(child.getName() =='CLIENTPNS'){
//iterating the grand child elements
for(dom.XmlNode gchild:child.getChildElements()){
if(gchild .getName() == 'CLIENTPN'){
//Iterating the grand grand child elements
for(dom.XmlNode ggchild:gchild.getChildElements()){
if(ggchild .getName() == 'CLIENTPNREF'){
PartClientPNREF=ggchild.getText();
}
}//End of for loop
}//End of if
}//End of for loop
}//End of if
}//End of for loop
}//End of if condition
}//End of if
}//End of method
public quoteController(){
Quote_line_item__c acc= new Quote_line_item__c();
acc.Client_P_N__c=geterp(acc.Name).PartClientPNREF;
acc.desc__c=geterp(acc.Name).PartDescription;
acc.stock__c=geterp(acc.Name).Partstock;
acclist.add(acc);
}
Visualforce page :
<apex:column headerValue="Nic P/N"><apex:inputField value="{!a.Name}" id="Name" style="width:110px" StyleClass="AutoPin" /><br/>
<apex:commandlink Value="Fetch details" action="{!geterp}" rerender="wtable">
<apex:param assignTo="{!nicpn}" value="{!a.Name}" Name="parentname777"/>
</apex:commandlink>
</apex:column>
I am passing the input value nicpn to get the details from ERP. I am retrieving partclient, partdescription and partstock.
I want to pass the values to the controller. How can I pass the values to controller.
I want to equate nicpn
to acc.Name
and I want to equate the value related value to related field
acc.Client_P_N__c=geterp(acc.Name).PartClientPNREF;
acc.desc__c=geterp(acc.Name).PartDescription;
acc.stock__c=geterp(acc.Name).Partstock;
quoteController Compile Error: Initial term of field expression must be a concrete SObject: void