You need to sign in to do that
Don't have an account?
Save functionality using multiple extensions
Hi,
I am having two tabs in my Visualforce page. Each tab is referring to a component.
I have visual force page using standard controller with multiple extensions.Am using custom save functionality for saving the records.
Am unable to get the syntax for how to call save methods of multiple extensions on single click.
I tried in the following way.
<apex:page standardController="Order_Line_Item__c" action="{!init}" extensions="picklistvalues,Backup1"> <apex:form > <apex:pageBlock > <apex:pageBlockButtons > <apex:commandButton value="Custom Save" action="{!cmdsave}"/> </apex:pageBlockButtons> <apex:tabPanel > <apex:tab label="Access & Port"> <c:AccessPort ControllingPicklist="{!ControllingPicklist}" ControllingPicklistOptions="{!AccTypeOptions}" CustInt="{!CustInt}" CustIntOptions="{!CustIntOptions}"/> </apex:tab> <apex:tab label="Backup"> <c:Backuptest Backup="{!bkp}"/> </apex:tab> </apex:tabPanel> </apex:pageBlock> </apex:form> </apex:page>
cmdsave function exists in the picklistvalues controller. I am trying to call the save function of Backup1 from this method.
But it is saving only the records which belong to the cmdsave method. When we check in debug logs the records in the save method
of backup1 controller is null.
Backup1 BackupClass=new Backup1(); public void cmdsave(){ system.debug('ssssssssssss'+AccportRecords.size()); for(Integer i=0;i<AccportRecords.size();i++){ if(AccportRecords[i].Order_Line_Item__c==null) AccportRecords[i].Order_Line_Item__c=OrderLineId; if(i==0){ AccportRecords[i].Access_Type__c=ControllingPicklist; system.debug('ssssssssssss'+AccportRecords[i].Access_Type__c); AccportRecords[i].Customer_Interface__c=CustInt; } } Upsert AccportRecords; system.debug('ssssssssssss'+AccportRecords); BackupClass.BackupSave(); }
public void save(){ for(integer i=0;i<objAccportlist.size();i++) { if(objAccportlist[i].Order_Line_Item__c==null) objAccportlist[i].Order_Line_Item__c='a0gR0000000YmIzIAK'; } upsert objAccportlist; system.debug('backupinserted'+objAccportlist); //picklistclass.cmdSave(); }
Any help is appreciated.
Thanks
Swaran
Hi,
Why don't use containment here rather than trying to update multiple extensions.
Please let me know if you need any help. I belive there is case for this with SF support team(02759794).