problem in populating a lookup field in an object called Application in layout

  • 1
  • Problem
  • Updated 9 months ago
  • In Progress
We have a object called Application and in this object we have lookup of another object called CR Matrix. From the layout we try to associate a record of CR Matrix with Application it vanishes. After refreshing the page i am trying to do the same it is working fine. It doesn't happen always. Please help me with this.
Photo of priya agarwal

priya agarwal

  • 160 Points 100 badge 2x thumb

Posted 1 year ago

  • 1
Photo of Bill McCullough

Bill McCullough, Champion

  • 12,436 Points 10k badge 2x thumb
priya,

Can you post your page XML and some screen shots of the steps that lead to a your layout going empty?

Thanks,

Bill
Photo of priya agarwal

priya agarwal

  • 160 Points 100 badge 2x thumb
Bill,

It is not happening every time. see the attach picture. the credit rating matrix is the field which i am
selecting. on clicking the search icon a page comes where various instances of credit rating matrix are seen. when i select one and then it is not saved. instead it return me an ID. And when i am trying to save it vanishes. showing the field has no value. its quite tough for me to replicate. Kindly help me.

Thanks 

Priya


Photo of Bill McCullough

Bill McCullough, Champion

  • 12,436 Points 10k badge 2x thumb
priya,

I would check the following:
  • Make sure you have access to all of the objects for the credit rating matrix objects.
  • Verify that no one is deleting the credit rating matrix objects while you are testing the page.  If you select a  credit rating matrix object and someone removes it after you select it, you will see the id, but not the name.  I am not sure that you will see the id saved.
  • Check that your model as the lookup field and the 'name' field related to the lookup.  if you lookup field is 'CreditRatingLookup__c', then your name field would be 'CreditRatingLookup__r.Name'.
Thanks,

Bill
Photo of priya agarwal

priya agarwal

  • 160 Points 100 badge 2x thumb
Hi Bill,

Yeah I have checked  the following which you have asked.
  • I have access to all the objects
  • No one is deleting the object
  • lookup filed and name is correct

Thanks 
Priya
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb
priya,

can you show us the setup of your CR Matrix field on the builder side?
Photo of priya agarwal

priya agarwal

  • 160 Points 100 badge 2x thumb
Hi Matt,

below is the image of the setup from builder side.




Thanks Priya
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb
And do you have any lookup filters set?
Photo of priya agarwal

priya agarwal

  • 160 Points 100 badge 2x thumb
no. 
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb
Hmm, nothing is sticking out to me as wrong. Do you have any model actions or javascript running that could interfere with the save process?
Photo of priya agarwal

priya agarwal

  • 160 Points 100 badge 2x thumb
No Matt. please note that it is not happening every time. other time it is really working fine. 
Photo of priya agarwal

priya agarwal

  • 160 Points 100 badge 2x thumb
Hi Matt,

below is the image of the problem i am facing. 



Thanks Priya
Photo of Bill McCullough

Bill McCullough, Champion

  • 12,436 Points 10k badge 2x thumb
priya,

What version of Skuid are you using?  Also, are you comfortable posting the XML from your page?  If you are OK with this, please copy the XML from your model for the field editor (please copy the entire model) and the field editor component where the Credit Rating Matrix field appears.

Thanks,

Bill
Photo of priya agarwal

priya agarwal

  • 160 Points 100 badge 2x thumb
Hi Bill,

skuid version is 9.5.5

This is the xml code 

<skuidpage unsavedchangeswarning="yes" showsidebar="true" showheader="true" personalizationmode="server">
  <models>
    <model id="Application" limit="20" query="true" createrowifnonefound="false" sobject="genesis__Applications__c" type="" datasource="salesforce">
      <fields>
        <field id="genesis__Account__c"/>
        <field id="genesis__Account__r.Name"/>
        <field id="genesis__Action__c"/>
        <field id="genesis__Action__r.Name"/>
        <field id="Name"/>
        <field id="genesis__Auto_Decisioning__c"/>
        <field id="genesis__CL_Product__c"/>
        <field id="genesis__CL_Product__r.Name"/>
        <field id="genesis__CL_Purpose__c"/>
        <field id="genesis__CL_Purpose__r.Name"/>
        <field id="genesis__Company__c"/>
        <field id="genesis__Company__r.Name"/>
        <field id="genesis__Contact__c"/>
        <field id="genesis__Contact__r.Name"/>
        <field id="genesis__Credit_Rating__c"/>
        <field id="genesis__Credit_Rating__r.Name"/>
        <field id="genesis__Days_Convention__c"/>
        <field id="genesis__Interest_Calculation_Method__c"/>
        <field id="genesis__Interest_Rate__c"/>
        <field id="genesis__Lending_Product__c"/>
        <field id="genesis__Lending_Product__r.Name"/>
        <field id="genesis__Loan_Amount__c"/>
        <field id="OwnerId"/>
        <field id="Owner.Name"/>
        <field id="genesis__Payment_Frequency__c"/>
        <field id="genesis__Collateral_Type__c"/>
        <field id="genesis__Collateral_Type__r.Name"/>
        <field id="genesis__Product_Type__c"/>
        <field id="Id"/>
        <field id="genesis__Status__c"/>
        <field id="genesis__Term__c"/>
        <field id="genesis__CL_Product__r.clcommon__Product_Name__c"/>
      <field id="genesis__Maturity_Date__c"/>
<field id="genesis__Expected_Close_Date__c"/>
<field id="genesis__Expected_Start_Date__c"/>
<field id="genesis__Expected_First_Payment_Date__c"/>
<field id="Loan_Application__c"/>
<field id="Loan_Application__r.Name"/>
<field id="Type_of_Investor__c"/>
<field id="Status__c"/>
<field id="Type_of_Applicant__c"/>
<field id="genesis__Account__r.Id"/>
<field id="Credit_Rating_Matrix__c"/>
<field id="Credit_Rating_Matrix__r.Name"/>
<field id="Loan_title__c"/>
<field id="Agent__c"/>
<field id="Pay_through_Autogiro__c"/>
<field id="Use_existing_Mandate__c"/>
<field id="Choose_Loan__c"/>
<field id="Choose_Loan__r.Name"/>
<field id="Borrower_threshold_c__c"/>
<field id="Needed_Modifications__c"/>
<field id="genesis__Discount_Rate__c"/>
<field id="Discount_Code__c"/>
<field id="Loan_Declined_Reason__c"/>
</fields>
      <conditions>
        <condition type="param" value="id" field="Id" operator="=" enclosevalueinquotes="true" novaluebehavior="noquery"/>
      </conditions>
      <actions/>
    </model>
    <model id="Scorecard" limit="20" query="true" createrowifnonefound="false" sobject="genesis__Application_Scorecard__c">
      <fields>
        <field id="Name"/>
        <field id="genesis__Scorecard__c"/>
        <field id="genesis__Scorecard__r.Name"/>
      </fields>
      <conditions>
        <condition type="param" value="id" field="genesis__Application__c" operator="=" enclosevalueinquotes="true" novaluebehavior="noquery"/>
      </conditions>
      <actions/>
    </model>
    <model id="AppTransactionRoom" limit="1" query="true" createrowifnonefound="false" adapter="" type="" sobject="genesis__Transaction_Room__c" doclone="">
      <fields>
        <field id="genesis__Application__c"/>
        <field id="genesis__Application__r.Name"/>
        <field id="genesis__Status__c"/>
      </fields>
      <conditions>
        <condition type="modelmerge" value="" field="genesis__Application__c" operator="=" model="Application" enclosevalueinquotes="true" mergefield="Id" novaluebehavior="noquery"/>
      </conditions>
      <actions/>
    </model>
  </models>
  <components>
    <pagetitle model="Application" uniqueid="sk-vZeaX-102">
      <maintitle>
        <template>{{Name}}</template>
      </maintitle>
      <actions>
        
        
      <action type="custom" label="List In MarketPlace" snippet="ListInMarketPlace"/>
</actions>
    </pagetitle>
    <basicfieldeditor showheader="true" showsavecancel="true" model="Application" buttonposition="" mode="read" layout="" uniqueid="sk-vZeaX-103">
      <columns>
        <column width="100%">
          <sections>
            <section title="" collapsible="no" showheader="false">
              <fields>
                <columns>
                  <column width="50%">
                    <sections>
                      <section title="New Section" collapsible="no" showheader="false">
                        <fields>
                          
                          <field id="genesis__Account__c" valuehalign="" type=""/>
                        </fields>
                      </section>
                    </sections>
                  </column>
                  <column width="50%">
                    <sections>
                      <section title="New Section" collapsible="no" showheader="false">
                        <fields>
                          <field id="genesis__Status__c" valuehalign="" type="">
<renderconditions logictype="and" onhidedatabehavior="keep">
    <rendercondition type="fieldvalue" operator="=" enclosevalueinquotes="true" fieldmodel="Application" sourcetype="fieldvalue" field="Type_of_Applicant__c" value="Borrower"/>
</renderconditions>
<enableconditions/>
</field>
<field id="Status__c" valuehalign="" type="">
    <renderconditions logictype="and" onhidedatabehavior="keep">
        <rendercondition type="fieldvalue" operator="=" enclosevalueinquotes="true" fieldmodel="Application" sourcetype="fieldvalue" field="Type_of_Applicant__c" value="Investor"/>
    </renderconditions>
    <enableconditions/>
</field>
<field id="Needed_Modifications__c" valuehalign="" type="">
    <renderconditions logictype="and" onhidedatabehavior="keep">
        <rendercondition type="fieldvalue" operator="=" enclosevalueinquotes="true" fieldmodel="Application" sourcetype="fieldvalue" field="genesis__Status__c" value="Approved if modifications"/>
    </renderconditions>
    <enableconditions/>
</field>
<field id="Loan_Declined_Reason__c" valuehalign="" type="">
    <renderconditions logictype="and" onhidedatabehavior="keep">
        <rendercondition type="fieldvalue" operator="=" enclosevalueinquotes="true" fieldmodel="Application" sourcetype="fieldvalue" field="genesis__Status__c" value="Declined"/>
    </renderconditions>
    <enableconditions/>
</field>
                        </fields>
                      <renderconditions logictype="and"/>
</section>
                    </sections>
                  </column>
                </columns>
              </fields>
            </section>
          <section title="Payment Options" collapsible="no">
<fields>
    <columns layoutmode="fixed">
        <column width="50%">
            <sections>
                <section title="New Section" collapsible="no" showheader="false">
                    <fields>
                        <field id="Pay_through_Autogiro__c" valuehalign="" type=""/>
                        <field id="Use_existing_Mandate__c" valuehalign="" type="">
                            <renderconditions logictype="and" onhidedatabehavior="keep">
                                <rendercondition type="fieldvalue" operator="=" enclosevalueinquotes="false" fieldmodel="Application" sourcetype="fieldvalue" field="Pay_through_Autogiro__c" value="true"/>
                            </renderconditions>
                            <enableconditions/>
                        </field>
                        <field id="Choose_Loan__c" valuehalign="" type="">
                            <renderconditions logictype="and" onhidedatabehavior="keep">
                                <rendercondition type="fieldvalue" operator="=" enclosevalueinquotes="false" fieldmodel="Application" sourcetype="fieldvalue" field="Use_existing_Mandate__c" value="true"/>
                            </renderconditions>
                            <enableconditions/>
                            <filters>
                                <filter type="modelmerge" operator="=" field="loan__Account__c" value="" model="Application" enclosevalueinquotes="true" mergefield="genesis__Account__c" novaluebehavior="deactivate"/>
                                <filter type="fieldvalue" operator="=" enclosevalueinquotes="false" field="Mandate_Rejected__c" value="false"/>
                                <filter type="fieldvalue" operator="=" enclosevalueinquotes="false" field="Mandate_Succesful__c" value="true"/>
                            </filters>
                        </field>
                    </fields>
                </section>
            </sections>
        </column>
        <column width="50%">
            <sections>
                <section title="New Section" collapsible="no" showheader="false">
                    <fields/>
                </section>
            </sections>
        </column>
    </columns>
</fields>
</section>
</sections>
        </column>
        <column width="100%">
          <sections>
            <section title="Application Details" collapsible="no" showheader="true">
              <fields>
                <columns layoutmode="fixed">
                  <column width="50%">
                    <sections>
                      
                    <section title="New Section" collapsible="no" showheader="false">
                        <fields>
<field id="Borrower_threshold_c__c"/>
<field id="Discount_Code__c"/>
<field id="Agent__c" valuehalign="" type=""/>
<field id="Loan_title__c"/>
                          <field id="genesis__CL_Product__c" valuehalign="" type="" optionsource="" pagesize="5" displaytemplate="{{clcommon__Product_Name__c}}" searchtemplate="{{clcommon__Product_Name__c}}" tokenizesearch="true">
                            <searchfields>
                              <searchfield query="true" return="true" show="true" field="clcommon__Product_Name__c" operator="contains"/>
                            </searchfields>
                            <filters/>
                            <renderconditions logictype="and" onhidedatabehavior="keep"/>
                          </field>
                          
                          <field id="genesis__Loan_Amount__c"/>
                          <field id="genesis__Term__c"/>
                          <field id="genesis__Interest_Calculation_Method__c"/>
                          <field id="genesis__Company__c" valuehalign="" type=""/>
                          <field id="Loan_Application__c" valuehalign="" type=""/>
                        </fields>
                      </section>
</sections>
                  </column>
                  <column width="50%">
                    <sections>
                      <section title="New Section" collapsible="no" showheader="false">
                        <fields>
                          <field id="genesis__Product_Type__c" valuehalign="" type=""/>
                          
                          <field id="genesis__Payment_Frequency__c" valuehalign="" type=""/>
                          <field id="genesis__Interest_Rate__c" decimalplaces="" valuehalign="" type=""/>
<field id="genesis__Expected_First_Payment_Date__c"/>
<field id="genesis__Expected_Start_Date__c"/>
<field id="genesis__Expected_Close_Date__c"/>
<field id="genesis__Maturity_Date__c" valuehalign="" type=""/>
<field id="Credit_Rating_Matrix__c" valuehalign="" type="" optionsource="" pagesize="5">
    <searchfields usesosl="false" soslfields="Name Fields">
        <searchfield query="true" return="true" show="true" field="Name" operator="contains">
            <label>Name</label>
        </searchfield>
        <searchfield query="true" return="true" show="true" field="peer__Rating__c" operator="contains">
            <label>Rating</label>
        </searchfield>
    </searchfields>
    <filters>
        <filter type="fieldvalue" operator="=" enclosevalueinquotes="true"/>
    </filters>
</field>
<field id="genesis__Days_Convention__c" valuehalign="" type=""/>
<field id="OwnerId" valuehalign="" type=""/>
                          
                          
                          
                        </fields>
                      </section>
                    </sections>
                  </column>
                </columns>
              </fields>
            </section>
          </sections>
        </column>
      </columns>
    </basicfieldeditor>
    <skootable showconditions="true" showsavecancel="true" searchmethod="server" searchbox="true" showexportbuttons="false" pagesize="10" createrecords="true" model="Scorecard" buttonposition="" mode="read" uniqueid="sk-vZeaX-104">
      <fields>
        <field id="genesis__Scorecard__c" uniqueid="fi-14o_jO-211"/>
        <field id="Name" uniqueid="fi-14o_jO-212"/>
      </fields>
      <rowactions>
        <action type="edit"/>
        <action type="delete"/>
      </rowactions>
      <massactions usefirstitemasdefault="true">
        <action type="massupdate"/>
        <action type="massdelete"/>
      </massactions>
      <views>
        <view type="standard"/>
      </views>
    <renderconditions logictype="and">
<rendercondition type="fieldvalue" operator="=" enclosevalueinquotes="true" fieldmodel="Application" sourcetype="fieldvalue" nosourcerowbehavior="deactivate" field="genesis__Account__c" value="1"/>
</renderconditions>
</skootable>
  </components>
  <resources>
    <labels/>
    <javascript>
      <jsitem location="inlinesnippet" name="createTransactionRoom" cachelocation="false">
var appModel = skuid.model.getModel('Application');
var appRow = appModel.data[0];

try {
sforce.apex.execute('genesis.SkuidTransactionRoomCtrl','createTransactionRoom',
    {   
        applicationId : appRow.Id
    });
} catch(err) {
    alert(err);
}
window.location.reload();
 
</jsitem>
      <jsitem location="external" name="ApexAjax" cachelocation="false" url=" /soap/ajax/29.0/apex.js">var params = arguments[0],
  $ = skuid.$;
</jsitem>
      <jsitem location="inlinesnippet" name="convert" cachelocation="false">var appModel = skuid.model.getModel('Application');
var appRow = appModel.data[0];

try {
    var ret = sforce.apex.execute('genesis.ConvertApplicationCtrl','convertApplicationToContract',
    {   
        appId : appRow.Id
    });
    alert(ret);
} catch(err) {
    alert(err);
}
window.location.reload();</jsitem>
    <jsitem location="inlinesnippet" name="ListInMarketPlace" cachelocation="false">var appModel = skuid.model.getModel('Application');
var appRow = appModel.data[0];

var stat=appRow.genesis__Status__c;
var agree = confirm("Are you sure ?");
if (agree){
    if (stat.toUpperCase() == "APPROVED"){
        try {
            var ret = sforce.apex.execute('LoanApplicationConvert2','convertLoanApplicationCtrl',
            {   
                appId : appRow.Id
            });
            alert(ret);
        } catch(err) {
            alert(err);
        }
        window.location.reload();
        
    }
    else{
        alert("Invalid Status");
    }
}</jsitem>
</javascript>
    <css/>
  </resources>
  <styles>
    <styleitem type="background" bgtype="none"/>
  </styles>
</skuidpage>


 Thanks Priya
Photo of Bill McCullough

Bill McCullough, Champion

  • 12,436 Points 10k badge 2x thumb
Priya,

I don't see any problems with your model.  Your field editor component looks OK as well.  One thing you can try is to add the Credit_Rating_Matrix__c field to your field editor a second time.  Just leave it with default settings from when you selected it or drag and drop it to field editor component.  Then try viewing your page to see if you see inconsistencies in how the field is displayed.

Thanks,

Bill
Photo of Stephen Sells

Stephen Sells, Official Rep

  • 16,856 Points 10k badge 2x thumb
When does it work and when does it fail? Are there any consistencies among seeing the problem?
Photo of Ashton Roberts

Ashton Roberts

  • 310 Points 250 badge 2x thumb
Hello! 

I am having the same issue as Priya where a User lookup renders fine on page load, then when clicking to edit the ID replaces the name. When a new user is searched and selected, the field is blank, but upon page refresh everything saves correctly.

Was this ever resolved?