I have a visualforce page where I insert 7 records at once. Each record has 14 fields.
When I only seize some of the fields, the query works, the 7 records are created. But when I seize more, the query doesn't work. There is no redirection. no exeption.
edit: here is the code
public PageReference saveImmo() {
Date debutDate = Date.parse('1/1/'+Year);
Map<String,Map<String,Decimal>> listMap = new Map<String,Map<String,Decimal>>();
listMap.put('MONTANT BRUT DEBUT EXERCICE',m1);
listMap.put('AUGMENTATION Acquisition',m2);
listMap.put('AUGMENTATION Production',m3);
listMap.put('AUGMENTATION Virement',m4);
listMap.put('DIMINUTION Cession',m5);
listMap.put('DIMINUTION Retrait',m6);
listMap.put('DIMINUTION Virement',m7);
for (String key : listMap.keySet()) {
T4_IMMO__c immo1 = new T4_IMMO__c();
immo1.IF__c = IdFisc;
immo1.Exercice_debut__c = debutDate;
immo1.Colonne__c = key;
Map<String,Decimal> m1 = listMap.get(key);
immo1.Frais_pr_liminaires__c=m1.get('Frais_pr_liminaires__c');
immo1.Charges_repartir_plusieurs_exercices__c = m1.get('Charges_repartir_plusieurs_exercices__c');
immo1.Primes_de_remboursement_des_obligations__c = m1.get('Primes_de_remboursement_des_obligations__c');
immo1.Immobilisation_recherche_d_veloppement__c = m1.get('Immobilisation_recherche_d_veloppement__c');
immo1.Brevets_marques_droits_et_similaires__c = m1.get('Brevets_marques_droits_et_similaires__c');
immo1.Fonds_commercial__c = m1.get('Fonds_commercial__c');
immo1.Autres_immobilisations_incorporelles__c = m1.get('Autres_immobilisations_incorporelles__c');
immo1.Terrains__c = m1.get('Terrains__c');
immo1.Constructions__c = m1.get('Constructions__c');
immo1.Installat_tech_mat_riel_et_outillage__c = m1.get('Installat_tech_mat_riel_et_outillage__c');
immo1.Mat_riel_de_transport__c = m1.get('Mat_riel_de_transport__c');
immo1.Mobilier_mat_riel_bureau_et_am_nagement__c = m1.get('Mobilier_mat_riel_bureau_et_am_nagement__c');
immo1.Autres_immobilisations_corporelles__c = m1.get('Mobilier_mat_riel_bureau_et_am_nagement__c');
immo1.Immobilisations_corporelles_en_cours__c = m1.get('Immobilisations_corporelles_en_cours__c');
insert immo1;
}
return Page.Allimmossaved;
}
}
page:
<apex:pageBlockTable value="{!listLabels}" var="dirKey" width="100%" columnsWidth="20%,10%,10%,10%,10%,10%,10%,10%">
<apex:column >
<apex:facet name="header">
<center> Nature </center> </apex:facet>
{!$ObjectType.T4_IMMO__c.fields[dirKey].label}
</apex:column>
<apex:column >
<apex:facet name="header">
<center> Montant Brut <br/>
Début de l'exercice </center>
</apex:facet>
<apex:inputText value="{!m1[dirKey]}" styleClass="myClass"/>
</apex:column>
<apex:column >
<apex:facet name="header">
<center> Augmentation <br/>
Acquisition </center>
</apex:facet>
<apex:inputText value="{!m2[dirKey]}" styleClass="myClass"/>
</apex:column>
<apex:column >
<apex:facet name="header" >
<center>Augmentation <br/>
Production <br/>
de l'entreprise<br/>
pour elle-même</center>
</apex:facet>
<apex:inputText value="{!m3[dirKey]}" styleClass="myClass"/>
</apex:column>
<apex:column >
<apex:facet name="header" >
<center>Augmentation <br/>
Virement
</center>
</apex:facet>
<apex:inputText value="{!m4[dirKey]}" styleClass="myClass"/>
</apex:column>
<apex:column >
<apex:facet name="header" >
<center>Diminution <br/>
Cession
</center>
</apex:facet>
<apex:inputText value="{!m5[dirKey]}" styleClass="myClass"/>
</apex:column>
<apex:column >
<apex:facet name="header" >
<center>Diminution <br/>
Retrait
</center>
</apex:facet>
<apex:inputText value="{!m6[dirKey]}" styleClass="myClass"/>
</apex:column>
<apex:column >
<apex:facet name="header" >
<center>Diminution <br/>
Virement
</center>
</apex:facet>
<apex:inputText value="{!m7[dirKey]}" styleClass="myClass"/>
</apex:column>
</apex:pageBlockTable>
<apex:pageBlockButtons >
<apex:commandButton value="Sauvegarder" action="{!saveImmo}"/>
</apex:pageBlockButtons>
</apex:pageBlock>
</apex:form>
</apex:page>
EDIT: Fixed the problem! Turns out I was putting numbers with 10005,24 instead of 10005.24. and this is why I couldn't insert the records