function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
saariko.ax241saariko.ax241 

Limiting NEW to API only - How I solved this

Hi,
Just want to share with you a problem and a solution that I had.

Description:
- I have a complicated structure of objects and child objects that my API creates them.
- I can not allow my users to create the same objects using the regular web interface, because the process is too complicated.
- The same user has access to both the API application and the web (regular SF)

Problem:
- How to limit the creation of new objects from the web, and not the API? 
- Currently, the solution was to make a special profile to enable API usage only, but than that user would not have access to the web, and another license would need to be purchased.

Workaround:
1. I created a field in the objects. The field is viewable to the users.
2. I removed that field from the Page Layouts of the users.
3. Added a validation rule on the field so when new objects are created the validation rule checks them for a specific value.
4. Added the field with the correct value in my API.

Solved.


RickyGRickyG
Thanks, saariko.  Cool solution!

SteveBowerSteveBower

Might you have just overridden the "New" button for that/those objects?  (Or am I missing something?)

Best, Steve

saariko.ax241saariko.ax241
Since I would like to have the ability for the "New" option for me to test it in the future as an adminitstrator. I wouldn't like to loose this button original functinality.