function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
venk1255venk1255 

HI Error

When CRD Record is created following fields should be update d on the order

Fields on CRD screen

Beginning CRD = formula field we discussed today morning

Ending CRD should be entered by User and stored in ORDER_Change_REQUESTS__C.Request_DATE__C

SFDC Request ID should be a auto number field which should generate new ID every time a new record Is generated.

Create a Status Picklist field (SFDC_REQUEST_STATUS__C ) in CRD change object with Value ‘Pending’ ,’Approved’ and ‘Rescheduled’ – New record should have status Pending.

 

hi i am gettng below error can anyone help me out on this .

ErrorError: crdchangebutton1 Compile Error: Constructor not defined: [crdchangebutton1.wrap].<Constructor>(SOBJECT:ORDER_Change_REQUESTS__c, Boolean, Integer) at line 52 column 49

 

 

 

<apex:page Controller="crdchangebutton1" sidebar="false">
<apex:form id="f1">
<apex:pageBlock >
<apex:pageBlockTable value="{!Orderchange}" var="r" id="lstupdt">
<apex:column headerValue="Change">
<apex:outputLabel value="{!r.sno}" />
</apex:column>

<apex:column headerValue="Beginning CRD">
<apex:outputText value="{0,date,M/dd/yyyy}">
<apex:param value="{!r.emp.Current_Requested_Date__c}" />
</apex:outputText>
</apex:column>

<apex:column headerValue="Enging CRD" id="c4">
<apex:outputLabel value="{!rec.propRequest Date}" rendered="{!NOT(rec.propEditable)}" id="opLbl4"/>
<apex:inputText value="{!rec.propREQUEST_DATE__c}" rendered="{!rec.propEditable}" style="background-color:#EBFFAE" id="inTxt4"/>
</apex:column>


<apex:column headerValue="Status">
<apex:outputText style="font-style:Regular" value=" {0}">
<apex:param value="{!r.emp.Status__c}"/>
</apex:outputText>
</apex:column>

<!-- <apex:inlineEditSupport showOnEdit="lstupdt"
hideOnEdit="editButton" event="ondblclick"
changedStyleClass="myBoldClass" resetFunction="resetInlineEdit"/> -->

</apex:pageBlockTable>
<apex:pageBlockButtons >
<apex:commandButton action="{!SaveLast}" value="Save" reRender="pB" rendered="{!rec.propEditable}" id="cBtn">
<apex:param name="prmId" value="javascript&colon;document.getElementById('{$Component.inTxt4}').value;" assignTo="{!propChange}"/>
</apex:commandButton>
</apex:pageBlockButtons>

</apex:pageBlock>


</apex:form>
</apex:page>

 

 

classs

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

 

public with sharing class crdchangebutton1
{
public String rec { get; set; }
public String propChange { get; set; }
public Boolean propEditable { get; private set; }
public date lastupdate { get; set; }

public String getEmp() {
return null;
}


public PageReference save()
{
return null;
}


List<Wrap> Orderchange {get;set;}
public Pagereference SaveLast()
{
System.Debug('---> ' + propChange);
return null;
}


public ApexPages.StandardSetController controller
{
get
{
if(controller==null)
{
controller = new ApexPages.StandardSetController([Select Id, Current_Requested_Date__c,Status__c FROM ORDER_Change_REQUESTS__c]);

}

return(controller);
}
set;
}


public list<wrap> getOrderchange()

{
Orderchange =new list<wrap>();

integer sno=1;

for(ORDER_Change_REQUESTS__c em:(list<ORDER_Change_REQUESTS__c>)controller.getRecords())
{
Orderchange.add(new wrap(em,sno++));
Orderchange.add(sno++);
sno++;

}
return Orderchange;
}

public class wrap
{
public integer sno{get;set;}
public Boolean propEditable { get; private set; }
public ORDER_Change_REQUESTS__c emp{get;set;}

public wrap( ORDER_Change_REQUESTS__c e,integer sn,Boolean xEdt)
{
emp=e;
sno=sn;
propEditable = xEdt;
}


}
}

 

rodrigoBFrodrigoBF

Hi,

 

take a look on this piece of code: 

for(ORDER_Change_REQUESTS__c em:(list<ORDER_Change_REQUESTS__c>)controller.getRecords())
{
Orderchange.add(new wrap(em,sno++));
Orderchange.add(sno++);
sno++;

}

 

Actually, based on the posted code, there's no a definition of wrap with two parameters, just three as you post:

public wrap( ORDER_Change_REQUESTS__c e,integer sn,Boolean xEdt)
{
emp=e;
sno=sn;
propEditable = xEdt;
}

 

 

just write a constructor with two parameters to fix it.

 

Regards

venk1255venk1255

 

Thanks for your reply

still i am getting this error .

Error

Error: crdchangebutton1 Compile Error: Constructor not defined: [crdchangebutton1.wrap].<Constructor>(SOBJECT:ORDER_Change_REQUESTS__c, Integer) at line 53 column 49

 

 

 

<apex:page Controller="crdrequest" id="pg">
<apex:form id="frm">
<apex:pageBlock id="pB">
<apex:pageBlockTable value="{!propRecs}" var="rec" id="pBT">
<apex:column headerValue="S.No" id="c1">
<apex:outputLabel value="{!rec.propNum}" id="opLbl1"/>
</apex:column>
<apex:column headerValue="Beginning CRD" id="c2">
<apex:outputLabel value="{!rec.propCurrent_Requested_Date__c}" id="opLbl2"/>
</apex:column>
<apex:column headerValue="Ending CRd" id="c3">
<apex:outputLabel value="{!rec.propRequest Date}" rendered="{!NOT(rec.propEditable)}" id="opLbl3"/>
<apex:inputText value="{!rec.REQUEST_DATE__c}" rendered="{!rec.propEditable}" style="background-color:#EBFFAE" id="inTxt3"/>
</apex:column>
<apex:column headerValue="Status" id="c4">
<apex:outputLabel value="{!rec.propStatus}" rendered="{!NOT(rec.propEditable)}" id="opLbl4"/>
<apex:inputText value="{!rec.propStatus__c}" rendered="{!rec.propEditable}" style="background-color:#EBFFAE" id="inTxt4"/>
</apex:column>



</apex:pageBlockTable>
<apex:pageblockbuttons>
<apex:commandButton action="{!SaveLast}" value="Save" reRender="pB" rendered="{!rec.propEditable}" id="cBtn">
<apex:param name="prmId" value="javascript&colon;document.getElementById('{$Component.inTxt4}').value;" assignTo="{!propChange}"/>
</apex:commandButton>
</apex:pageblockButtons>
</apex:pageBlock>
</apex:form>
</apex:page>

 

 

 

public class crdrequest {

public crdrequest() {

}


public crdrequest(ApexPages.StandardController controller) {

}

public String propChange { get; set; }
public List<MWrap> propRecs
{
get
{
if(propRecs != null && !propRecs.isEmpty())
propRecs.clear();

List<MWrap> lstMW = new List<MWrap>();
List<ORDER_Change_REQUESTS__c> lstAcc= [SELECT id, Current_Requested_Date__c,
REQUEST_DATE__c, Status__c
FROM ORDER_Change_REQUESTS__c
WHERE REQUEST_DATE__c <> null
ORDER BY LastModifieddate ASC
LIMIT 5];

if(lstAcc != null && !lstAcc.isEmpty())
{
for(Integer i=0; i<lstAcc.size(); i++)
{
if(i == (lstAcc.size()-1))
{
lstMW.add(new MWrap(lstAcc[i].Id,
i + 1,
lstAcc[i].Current_Requested_Date__c,
lstAcc[i].REQUEST_DATE__c,
lstAcc[i].Status__c,
true));
}
else{
lstMW.add(new MWrap(lstAcc[i].Id,
i + 1,
lstAcc[i].Current_Requested_Date__c,
lstAcc[i].REQUEST_DATE__c,
lstAcc[i].Status__c,
false));
}
}
}
return lstMW;
}
set;
}

public Pagereference SaveLast()
{
System.Debug('---> ' + propChange);
return null;
}

public class MWrap
{
public String propId { get; private set; }
public String propNum { get; private set; }
public date propCurrent_Requested_Date__c { get; private set; }
public date propREQUEST_DATE__c { get; set; }
public String propStatus__c { get; set; }
public Boolean propEditable { get; private set; }

public MWrap(String xId, Integer xnum, date xNme, date xph, String xfx, Boolean xEdt){
propId = xId;
propNum = String.valueOf(xnum);
propCurrent_Requested_Date__c = xNme;
propREQUEST_DATE__c= xph;
propStatus__c = xfx;
propEditable = xEdt;
}
}

}