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
Christopher PezzaChristopher Pezza 

Passing Variable of null when its not

It wont pass the Id to the Variable any reason why or that i am missing
 
public void AttachLoan() {
        System.debug('** in Add');
        System.debug('**' + AddLoanID);
        LLC_BI__Loan__c ul = [SELECT Id, Name, LLC_CDS__Deal_Facility__c FROM LLC_BI__Loan__c WHERE Id = :AddLoanID LIMIT 1];
        system.debug('** ' + ul);
        ul.LLC_CDS__Deal_Facility__c = ObjId;
        system.debug('**2 ' + ul);
        update(ul);
    }
 
<apex:repeat value="{!AddLoans}" var="fa">
                                        <tr>
                                            <td>
                                            <apex:form >
                                                <apex:commandButton value="Add" action="{!AttachLoan}" styleClass="btn btn-xs btn-success">
                                                    <apex:param value="{!fa.Id}" AssignTo="{!AddLoanID}"/>
                                                </apex:commandButton>
                                            </apex:form>
                                            </td>
                                            <td><a href="/{!fa.Id}" target="_Blank">{!fa.Name}</a></td>
                                            <td>{!fa.LLC_BI__lookupKey__c}</td>
                                            <td><a href="/{!fa.LLC_BI__Account__c}" target="_Blank">{!fa.LLC_BI__Account__r.Name}</a></td>
                                        </tr>
                                    </apex:repeat>



 
Vikash TiwaryVikash Tiwary
Hi Christopher,

Try adding rerender attribute to commandbutton. If you do not want to rerender any panels simply add rerender="dummy" on command button. That should resolve this issue.

Please let me know if this helps!

Thanks 
Christopher PezzaChristopher Pezza
Ok well it works it just wont send the Id as the value it passes null
Vikash TiwaryVikash Tiwary
The Id is passed null only when there is no rerender attribute to its parent. I faced it earlier and adding rerender attribute resolved the issue. Please share your answer when you get it.

Thanks