Skip to main content
Nintex Community Menu Bar
Question

Need help with the Skuid UI Only field


Forum|alt.badge.img+2

HI,

I have created a UI-Field in skuid ‘Sample’ and linked it with the salesforce field ‘Sample__C’
its a checkbox field. I am trying to save the data using below JS and it is working.


var params = arguments[0],
$ = skuid.$;
console.log(params.model);
var mymodel=params.model;
var row=mymodel.getFirstRow();
var fieldMap = {};
mymodel.updateRow(row,‘Sample__C’,row.Sample);


But on the UI, when I check the ‘Sample’ field, save and refresh the page the field is Unchecked. can anyone suggest me how to resolve this issue.

Thanks in advance.


Translate
Did this topic help you find an answer to your question?
This topic has been closed for comments

10 replies

Forum|alt.badge.img+4

At first glance, I notice that you’ve got a capital ‘C’ in ‘Sample__C’. Custom fields are suffixed with a lowercase ‘__c’.

Translate

Forum|alt.badge.img+9
  • Nintex Employee
  • 889 replies
  • July 10, 2024

Hi Linga,

If you’re working with a UI-Only field, it would by definition not be linked to any Salesforce fields. That means its value can’t be saved to Salesforce, and is going to start out unset every time your Skuid page loads. If you’ve also created a custom checkbox field in Salesforce though, you should be able to use that as you’re hoping, if I’m understanding correctly. In case you haven’t run across it already, here’s our documentation on UI-only fields and models. That should help give some context on what the UI-only fields can be used for. 

-Mark

Translate

Forum|alt.badge.img+2
  • Author
  • 9 replies
  • July 10, 2024

Thank you for the immediate response.

Mark, 

I have already gone through the documentation, but couldn’t find what I was expecting for. So what you are saying is that there is no way that the I can make the value to set whenever I reload the page, just like normal checkbox?

Translate

Forum|alt.badge.img+18

Linga,

If you always want the box to be checked on pageload, you can do that with javascript (see below). If you want to save the value that was last entered before reload, you’ll need to create a field in salesforce, not a ui-only field.


To make the field checked on pageload:

(function(skuid){<br>var $ = skuid.$;<br>$(document.body).one('pageload',function(){<br>var myModel = skuid.model.getModel('MyModelId'),<br>&nbsp; &nbsp; row = myModel.getFirstRow();<br>myModel.updateRow(row,{'Sample' : true});<br>});<br>})(skuid);
Translate

Forum|alt.badge.img+18

Another thought: if you want the ui-only field (‘Sample’) to always reflect the value of a database field (‘Sample__c’), you could do that… but I’m not sure why you wouldn’t just use the database field directly instead of trying to sync a ui-only field with the database field?

Translate

Forum|alt.badge.img+9
  • Nintex Employee
  • 889 replies
  • July 10, 2024

To build on Matt’s thought, if there was a need to keep the data in your database field Sample__c protected, Skuid gives you a way to set it to read-only when you first pull it into your Skuid Model, by checking the box to “override metadata.”

Translate

Forum|alt.badge.img+2
  • Author
  • 9 replies
  • July 10, 2024

Matt,

Thanks for the workaround.

I had to create a UI field due to Inline Help Text feature. In salesforce I can use only upto 255 characters for Inline help text, where as in skuid there is no limit for the UI field’s help text, hence I had to follow this approach.

Can you help me with how to reflect the value of a database field on ui-only field, that would be helpful. Thanks.

Translate

Forum|alt.badge.img+2
  • Author
  • 9 replies
  • July 10, 2024

Hi Matt,

Thanks for the script, it works perfectly fine when the field is checked, saved and refreshed it works fine. But when I uncheck and save it, it still stays checked. Am I doing something wrong. Sorry if I sound dumb, I’m new to Skuid 😦

Translate

Forum|alt.badge.img+18

Linga,

Perhaps you can just use the ‘override metadata’ feature on the existing database field? Will that allow you to edit the help text?

Translate

Forum|alt.badge.img+2
  • Author
  • 9 replies
  • July 10, 2024

YESSS!!!

That worked perfect! That was such a simple solution…
Thank u so much

Translate

Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie Settings