You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Right now it's not possible to create a sharing rule using the MetadataService.cls class and the MetadataServiceExamples.cls provided.
In first instance with that code we get an error suggesting that SharingTerritoryRule is missing, so trying to add this new parameter to the example of createSharingRule provided in MetadataServiceExamples.cls :
testSharingRule.sharingTerritoryRules = new List<MetadataService.SharingTerritoryRule>(); MetadataService.SharingTerritoryRule sharingTerritoryRule = new MetadataService.SharingTerritoryRule(); sharingTerritoryRule.fullName = 'TestTerritory'; sharingTerritoryRule.accessLevel = 'Read'; sharingTerritoryRule.label = 'Test'; sharingTerritoryRule.sharedTo = new MetadataService.SharedTo(); sharingTerritoryRule.sharedTo.allPartnerUsers = '';
We still get an error showing that SharingTerritoryRule must contain a sharedFrom field, that is where a mistake is made on MetadataService.cls because in the actual documentation it is said that SharingTerritoryRule extends SharingOwnerRule , and that is not the case.
The text was updated successfully, but these errors were encountered:
I thought that adding sharedFrom attribute to the SharingTerritoryRule could fix this, but this field is not present in that class: sharingTerritoryRule.sharedFrom = new MetadataService.SharedTo(); sharingTerritoryRule.sharedFrom.allInternalUsers = '';
Also tried to add the field in 2 different ways:
Trying to make SharingTerritoryRule to extend SharingOwnerRule and not SharingBaseRule, for that we have to make the SharingOwnerRule class virtual: public virtual class SharingOwnerRule extends SharingBaseRule {
But with this method we get an error:
sharedFrom not found in the field order.
Trying to manually add sharedFrom fields to SharingTerritoryRule, and also changing expected fields: public MetadataService.SharedTo sharedFrom; private String[] sharedFrom_type_info = new List<String>{ 'sharedFrom', SOAP_M_URI, null, '1', '1', 'false' }; private String[] field_order_type_info = new List<String>{'fullName', 'accessLevel', 'accountSettings', 'description', 'label', 'sharedTo', 'sharedFrom'
Right now it's not possible to create a sharing rule using the MetadataService.cls class and the MetadataServiceExamples.cls provided.
In first instance with that code we get an error suggesting that SharingTerritoryRule is missing, so trying to add this new parameter to the example of createSharingRule provided in MetadataServiceExamples.cls :
testSharingRule.sharingTerritoryRules = new List<MetadataService.SharingTerritoryRule>(); MetadataService.SharingTerritoryRule sharingTerritoryRule = new MetadataService.SharingTerritoryRule(); sharingTerritoryRule.fullName = 'TestTerritory'; sharingTerritoryRule.accessLevel = 'Read'; sharingTerritoryRule.label = 'Test'; sharingTerritoryRule.sharedTo = new MetadataService.SharedTo(); sharingTerritoryRule.sharedTo.allPartnerUsers = '';
We still get an error showing that SharingTerritoryRule must contain a sharedFrom field, that is where a mistake is made on MetadataService.cls because in the actual documentation it is said that SharingTerritoryRule extends SharingOwnerRule , and that is not the case.
The text was updated successfully, but these errors were encountered: