You need to sign in to do that
Don't have an account?
ZX Cheow
Inline edit on visualforce page unable to update Date field
Hi there,
Below is my VF page and the controller, the update on the Currency fields are working fine. However, the update on the Date field is not taking effect.
VF Page:
<apex:page standardController="Order" extensions="displayOrderSchedule">
<apex:form >
<apex:pageBlock mode="inlineEdit">
<apex:pageBlockTable value="{!schedule}" var="term">
<apex:column value="{!term.Date1__c}" />
<apex:column value="{!term.Amount1__c}" />
<apex:column value="{!term.Approved_Amount1__c}" />
<apex:column value="{!term.Comments1__c}" />
<apex:column value="{!term.Date2__c}" breakBefore="true"/>
<apex:column value="{!term.Amount2__c}" />
<apex:column value="{!term.Approved_Amount2__c}" />
<apex:column value="{!term.Comments2__c}" />
<apex:inlineEditSupport event="ondblclick" showOnEdit="update" changedStyleClass="myBoldClass" resetFunction="resetInlineEdit"/>
</apex:pageBlockTable>
<apex:commandButton id="update" action="{!quicksave}" value="Update Schedule" styleclass="updateButton"/>
</apex:pageBlock>
</apex:form>
</apex:page>
Controller:
public class displayOrderSchedule{
private final Order viewOrder;
public List<Order_Media_Offering_Schedule__c> schedule {get;set;}
public displayOrderSchedule(ApexPages.StandardController stdController){
this.viewOrder = (Order)stdController.getRecord();
List<Order> orderList = [Select Id, (Select Id From Order.Order_Product_Schedules_del__r)
From Order
Where Id =: viewOrder.Id];
For (Order ord:orderList) {
integer item_count = ord.Order_Product_Schedules_del__r.size();
system.debug('Item Size = '+ item_count);
For (integer i=0;i<item_count;i++) {
system.debug('ItemId[' + i +'] = ' + ord.Order_Product_Schedules_del__r[i].Id);
schedule = [select Amount1__c, Approved_Amount1__c, Comments1__c, Date1__c,
Amount2__c, Approved_Amount2__c, Comments2__c, Date2__c
from Order_Media_Offering_Schedule__c
where Id =: ord.Order_Product_Schedules_del__r[i].Id];
system.debug('Schedule is '+ Schedule);
}
}
}
public pagereference quicksave() {
try {
update Schedule;
}
catch(Exception e) {
System.debug('Exception occurred '+String.valueOf(e));
}
return NULL;
}
}
Anyone facing similar issue? I have tested with apex:outputfield and it is working fine, however as this functionality requires to display fields from other object instead of Order, apex:outputfield could not be used. Appreciate your assistance on this.
Thanks,
ZX
Below is my VF page and the controller, the update on the Currency fields are working fine. However, the update on the Date field is not taking effect.
VF Page:
<apex:page standardController="Order" extensions="displayOrderSchedule">
<apex:form >
<apex:pageBlock mode="inlineEdit">
<apex:pageBlockTable value="{!schedule}" var="term">
<apex:column value="{!term.Date1__c}" />
<apex:column value="{!term.Amount1__c}" />
<apex:column value="{!term.Approved_Amount1__c}" />
<apex:column value="{!term.Comments1__c}" />
<apex:column value="{!term.Date2__c}" breakBefore="true"/>
<apex:column value="{!term.Amount2__c}" />
<apex:column value="{!term.Approved_Amount2__c}" />
<apex:column value="{!term.Comments2__c}" />
<apex:inlineEditSupport event="ondblclick" showOnEdit="update" changedStyleClass="myBoldClass" resetFunction="resetInlineEdit"/>
</apex:pageBlockTable>
<apex:commandButton id="update" action="{!quicksave}" value="Update Schedule" styleclass="updateButton"/>
</apex:pageBlock>
</apex:form>
</apex:page>
Controller:
public class displayOrderSchedule{
private final Order viewOrder;
public List<Order_Media_Offering_Schedule__c> schedule {get;set;}
public displayOrderSchedule(ApexPages.StandardController stdController){
this.viewOrder = (Order)stdController.getRecord();
List<Order> orderList = [Select Id, (Select Id From Order.Order_Product_Schedules_del__r)
From Order
Where Id =: viewOrder.Id];
For (Order ord:orderList) {
integer item_count = ord.Order_Product_Schedules_del__r.size();
system.debug('Item Size = '+ item_count);
For (integer i=0;i<item_count;i++) {
system.debug('ItemId[' + i +'] = ' + ord.Order_Product_Schedules_del__r[i].Id);
schedule = [select Amount1__c, Approved_Amount1__c, Comments1__c, Date1__c,
Amount2__c, Approved_Amount2__c, Comments2__c, Date2__c
from Order_Media_Offering_Schedule__c
where Id =: ord.Order_Product_Schedules_del__r[i].Id];
system.debug('Schedule is '+ Schedule);
}
}
}
public pagereference quicksave() {
try {
update Schedule;
}
catch(Exception e) {
System.debug('Exception occurred '+String.valueOf(e));
}
return NULL;
}
}
Anyone facing similar issue? I have tested with apex:outputfield and it is working fine, however as this functionality requires to display fields from other object instead of Order, apex:outputfield could not be used. Appreciate your assistance on this.
Thanks,
ZX
Please check with below knowledge article and idea from salesforce and community boards.
- https://help.salesforce.com/HTViewSolution?id=000003647
- https://success.salesforce.com/issues_view?id=a1p300000008Y1dAAE
Please let us know if you are looking for something else.Mark this as solved if it's resolved.
Best Regards,
Nagendra.P
Hi Nagendra,
Thanks for your comment, however my issue is not solved from the article and idea above.
Thanks,
ZX