The CreatorCon Call for Content is officially open! Get started here.

How to restrict a form custom view only on existing records not on new form

Ramu8
Tera Expert

Hi Team,

 

How to restrict a newly created custom view only on existing records not on new Record( form view) on resource form 

1 ACCEPTED SOLUTION

Siddhesh Gawade
Mega Sage
Mega Sage

Hello @Ramu8 ,

 

try below code in your view rule script to check if the current record is new or existing based on that you can hide the view.

 

var uri = gs.action.getGlideURI();
        var sysId = uri.get('sys_id');

		if(sysId != '-1'){                 // if the sys_id is not "-1" then the record is existing record.
answer = 'view_name';
		}

 

 

Kindly mark the answer ✔️Correct or Helpful ✔️If it addresses your concern.


Regards,

Siddhesh

View solution in original post

6 REPLIES 6

Hi @Damini Sheth 

 

Thanks for response but it is working only when we use conditions and here i am using advance script in which based on group we are configuring view rules

 

current object is not supporting and also operation==insert is not supporting so please suggest if any other possible way

Siddhesh Gawade
Mega Sage
Mega Sage

Hello @Ramu8 ,

 

try below code in your view rule script to check if the current record is new or existing based on that you can hide the view.

 

var uri = gs.action.getGlideURI();
        var sysId = uri.get('sys_id');

		if(sysId != '-1'){                 // if the sys_id is not "-1" then the record is existing record.
answer = 'view_name';
		}

 

 

Kindly mark the answer ✔️Correct or Helpful ✔️If it addresses your concern.


Regards,

Siddhesh