• Regina94
  • NEWBIE
  • 15 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 1
    Replies
Hi, we are in the following situation:

We have a custom object (from an installed package): On this object we can configure a product - there are many custom picklists (we created) which contains certain options for a product. Adding of a product is done via Visualforce Page (managed, not editable for us). We add this picklists to the Visualforce Page via field set. It means that it is not possible to have seperate page layouts for different record types because changes in the page layout are not reflected in the visualforce page. The only way is working with Field Visibility. This we did.

Now the following problem:

We have two Record Types: A and B. The record type is based on the Sales Country of a product. (=One record type for Country A and one for Country B). For users of Country A we can make only Country A fields visible and hide Country B fields in the profile. But for users who have access to Country A and Country B we can't hide fields based on the profile. They are not allowed to select an option of an Country A field if the Product belongs to Country B. That's why we have removed all available picklist Values of the specific Country A field in the Record Type B. But at least one option should be available, so we have a custom "None" Value. This should be the only option for a Country A field on Record Type B. But it is not working, the Salesforce --None-- can't be removed, see below:

User-added image

Is there any approach how to have only one None Value without other options for a record type?
(Or is it possible to create a process which sets the field visibility for a profile based on conditions, e.g. if Record Type A is selected Field Visibility for Country B fields is false)

Please help.
I created a custom button which executes javascript (Mass Delete). For me as system administrator it’s working perfectly but my user receives “insufficient privileges” when clicking on this button. The user can delete one record, this is working. But not multiple records with this button.
 
The button is on a view list of my custom object Requested_Agencies__c. It is a junction object between Accounts and Campaigns. So my user has full access (CRUD, view all, modify all) on my custom object, Accounts, Campaigns, Contacts and Leads. Enable API is also checked.
 
I think there must be a permission for users to execute javascript buttons? Please help.
 
Here is the code:
{!REQUIRESCRIPT("/soap/ajax/38.0/connection.js")}
{!REQUIRESCRIPT("/soap/ajax/38.0/apex.js")}
 
var records = {!GETRECORDIDS($ObjectType.Requested_Agency__c)};
var strIDs='';
if (records[0] == null)
{
alert('Please select a record');
}
else
{
for (var n=0; n<records.length; n++)
{
if(strIDs == '')
strIDs = records[n];
else
strIDs = strIDs + "," + records[n] ;
}
window.location.href = '/apex/MassManager__MassDelete?deleteIds='+strIDs + '&selectedObject=Requested_Agency__c&retURL='+ window.location.href;
}
 
I created a custom button which executes javascript (Mass Delete). For me as system administrator it’s working perfectly but my user receives “insufficient privileges” when clicking on this button. The user can delete one record, this is working. But not multiple records with this button.
 
The button is on a view list of my custom object Requested_Agencies__c. It is a junction object between Accounts and Campaigns. So my user has full access (CRUD, view all, modify all) on my custom object, Accounts, Campaigns, Contacts and Leads. Enable API is also checked.
 
I think there must be a permission for users to execute javascript buttons? Please help.
 
Here is the code:
{!REQUIRESCRIPT("/soap/ajax/38.0/connection.js")}
{!REQUIRESCRIPT("/soap/ajax/38.0/apex.js")}
 
var records = {!GETRECORDIDS($ObjectType.Requested_Agency__c)};
var strIDs='';
if (records[0] == null)
{
alert('Please select a record');
}
else
{
for (var n=0; n<records.length; n++)
{
if(strIDs == '')
strIDs = records[n];
else
strIDs = strIDs + "," + records[n] ;
}
window.location.href = '/apex/MassManager__MassDelete?deleteIds='+strIDs + '&selectedObject=Requested_Agency__c&retURL='+ window.location.href;
}