Showing results for 
Search instead for 
Do you mean 
Community Home Request Access Read Blogs Share Your Ideas Search Community View My Settings
Reply
Tuned Listener
Posts: 30
Registered: ‎04-15-2009

ReadOnly field in edit view

[ Edited ]

Hi,

 

This is for SLX Mobile v.1.2.

Can somebody share with me what is the best way to make some fields of the edit view to be read only?

For example in Account Edit screen if we want to make the Status to be a read only field.

 

Thank you,

~Kayono

Silver Super Contributor
Posts: 801
Registered: ‎03-24-2009

Re: ReadOnly field in edit view

You can set the ReadOnly property (and readonlyeditor) to true. Or, if you want to do this by profile then you might want to put people into profiles and the profile will be applied per user (such that it may be enabled for certain users and read-only for others). Look in the Admin help for Field Level Security.

Gold Super Contributor
Posts: 3,087
Registered: ‎03-19-2009

Re: ReadOnly field in edit view

You might want to take a look at the postings on teh partner side of the community under mobile.

--
RJ Ledger - rjledger@rjlSystems.net +1 603.369.3047 x101

".. Innovators in Mobility - Experts in Workflow Automation..."
http://www.rjlSystems.net - blog: www.rjlSystems.net/blog.html
Tuned Listener
Posts: 30
Registered: ‎04-15-2009

Re: ReadOnly field in edit view

Thank you Mike and RJ for the responses.

The client wants to make it readOnly for the Mobile only. So I don't think I can use the profile.

 

RJ, I did search in the partner area and could not find any sample of making a field "ReadOnly" for the SlxMobile.

I saw something similar (for multiple pick list) but not sure if that would apply in my situation.

 

Thanks,

~Kayono

Bronze Contributor
Posts: 95
Registered: ‎07-11-2011

Re: ReadOnly field in edit view

Edit View controls are handled by the Field "classes" (argos-sdk/src/Controls) and only several fields support `readonly: true` (lowercase), namely TextField and its deritatives. However, all fields do have a `.disable()` function.

 

Disabling (or setting readonly) for a field does not guarantee that the user cannot change it, so if it is critical they don't I'd suggest re-enforcing any mobile client side rules on the backend.

 

Another thing to consider is that when Save is pressed it will gather all values - except for HiddenFields and fields where `exclude: true` or `include: false` are set.

 

You can see an example of readonly/exclude at the latest development on github: https://github.com/SageSalesLogix/argos-saleslogix/blob/master/src/Views/OpportunityContact/Edit.js#...

 

That link is dojo based, but the layout/fields are the same.

Tuned Listener
Posts: 30
Registered: ‎04-15-2009

Re: ReadOnly field in edit view

Thank you for the example.

Do you know where I can find example to disable a picklist or lookup?

 

Thanks,

~Kayono

Highlighted
Bronze Super Contributor
Posts: 152
Registered: ‎02-01-2011

Re: ReadOnly field in edit view

To make a lookup read-only (this disables the lookup but the icon is still there):

 

this.registerCustomization('edit', 'opportunity_edit', {
	at: function(row) { return row.name == 'Owner'; },
	type: 'modify',
	value: { view: 'false' }
});

 

For a picklist, replace it with a read-only text field (I guess this will only work for text values):

this.registerCustomization('edit', 'account_edit', {
	at: function(row) { return row.name === 'Industry' },
	type: 'modify',
	value: {
		type: 'text',
		readonly: true,
		exclude: true,
		enableClearButton: false
	}
});

 

Andy Freeman
TrellisPoint, LLC