SF user name not displaying in a different page

  • 1
  • Problem
  • Updated 4 years ago
  • In Progress
I have a created a formula field in SF in an object to display login user.
loginuser__c = $user.firstname & " , " & $user.lastname.

I have two skuid pages and added loginuser__c field in both pages.
One page has table component and another page field editor component.

Table component displaying login user name, but field editor component not displaying.
Really strange, what could be the error.
Photo of Arjun Arjun

Arjun Arjun

  • 230 Points 100 badge 2x thumb

Posted 4 years ago

  • 1
Photo of mB Pat Vachon

mB Pat Vachon, Champion

  • 42,704 Points 20k badge 2x thumb
Are you using the same model? Can you paste the XML here?
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,006 Points 20k badge 2x thumb
Is the data getting populated in your page for both models?  Use the browser console to explore the model object and see what data is present. 

The syntax for that is:   skuid.$M('ModelName').data
Photo of Arjun Arjun

Arjun Arjun

  • 230 Points 100 badge 2x thumb
Hi Pat,

Yes, i am using same model for both pages. The loginuser__c field value which is showing correctly is on Table component. 

The same loginuser__c field is on another page table component Drawer Area.
That Drawer Area has Field Editor component. I have placed loginuser__c field in the Field Editor component. The field value is not showing here. Is it because of Drawer Area?

Below is the xml for the page which is showing field value correctly.

<skuidpage unsavedchangeswarning="yes" showsidebar="true" showheader="true">   <models>
      <model id="NewModel" limit="20" query="true" createrowifnonefound="false" sobject="Alias__c">
         <fields>
            <field id="Last_Name__c"/>
            <field id="First_Name__c"/>
            <field id="Staff_Name__c"/>
         </fields>
         <conditions/>
         <actions/>
      </model>
   </models>
   <components>
      <skootable showconditions="true" showsavecancel="true" searchmethod="server" searchbox="true" showexportbuttons="false" pagesize="10" createrecords="true" buttonposition="" mode="read" model="NewModel">
         <fields>
            <field id="First_Name__c"/>
            <field id="Last_Name__c"/>
            <field id="Staff_Name__c" valuehalign="" type=""/>
         </fields>
         <rowactions>
            <action type="edit"/>
            <action type="delete"/>
         </rowactions>
         <massactions usefirstitemasdefault="true">
            <action type="massupdate"/>
            <action type="massdelete"/>
         </massactions>
         <views>
            <view type="standard"/>
         </views>
      </skootable>
   </components>
   <resources>
      <labels/>
      <javascript/>
      <css/>
   </resources>
</skuidpage>



The second page which is not displaying filed have,  does not have option of 'View/Edit in XML'.
How can i copy XML for this page.
Photo of mB Pat Vachon

mB Pat Vachon, Champion

  • 42,704 Points 20k badge 2x thumb
Second page needs to be saved. Once saved you can "View/Edit in XML".
Photo of Arjun Arjun

Arjun Arjun

  • 230 Points 100 badge 2x thumb
Second page has tab set, in one of the tab set i have placed table, in the table drawer area, in the drawer area it has a field editor. In the field editor i copied same field of the model which are showing in the first page. 

But in the second page all field values are displaying except the loginuser__c.
As you told i have saved the page, and it is showig 'View/Edit in XML' option.
But as second page has tabset, the total lines of code is more than 5000 lines.
Photo of Arjun Arjun

Arjun Arjun

  • 230 Points 100 badge 2x thumb
Hi Rob,

Yes, the data is populating in that model for all fields in both pages. I am using same fields in both pages. But in one page it is showing all the fields, in another page only loginuser__c field is not displaying. Is it because of Drawer area? Please see the reply to Pat.
Photo of Irvin Waldman

Irvin Waldman, Champion

  • 9,006 Points 5k badge 2x thumb
Hi,  How about providing some screenshots?   A .png is worth a 1K words :)  
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,006 Points 20k badge 2x thumb
Arjun.  

Would you mind giving us login rights to your org so we can take a look at what is going on?   Here is how: 1. Use this tutorial to give us login rights: http://help.skuidify.com/m/getting-started/l/182412-getting-help-how-to-grant-skuid-login-rights-to-...

2. Then send an email to support@skuidify.com  with your org Id and the name of the page where the problem is happening. 

We'll see what's going on...
Photo of Arjun Arjun

Arjun Arjun

  • 230 Points 100 badge 2x thumb
Hi Rob,

I just want to share what i noticed. The Drawer area screen is to create the record, 3 fields are input fields and loginuser__c field is read only. While creating the record loginuser__c is showing empty. After saving the record, loginuser__c field is showing login user name.

May be SF field with formula $User.FirstName & ',' & $User.LastName is not rendering while creation of the record. 

So what i did is, i have added Template component and used SKUID $User. 
 {{$User.lastName}}, {{$User.firstName}}

Now Loginuser firstname and lastname displaying in Template component while creation of the record. But SF field is not showing with SF $User global object.

Hope this helps to understand. 
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,006 Points 20k badge 2x thumb
Well that would explain things.  If you are creating a new record,  the formula field would not be populated.  Only on record save will the formula show. 

Your strategy to use the gloabal merge syntax to get user information is good.  If you want to save this information to a record you should use conditions on your new record model to inject those values  - even if they are not displayed on the page.