Questions tagged [global-methods]
The global-methods tag has no usage guidance.
42
questions
4
votes
2
answers
240
views
Evolve global classes in 1GP Managed packages (e.g. add method)
I have a 1GP Managed Packaged with Released Versions (but no customers only Dev orgs) and it contains a global class with various abstract methods that subscribers could override.
global with sharing ...
2
votes
2
answers
92
views
Ramifications of deleting (not uninstalling) a first-generation Managed Package
Got a first-generation managed package distributed to a small number of Orgs (<10). In the early design, several classes were setup with the global instead of public attribute thinking we might ...
-4
votes
1
answer
59
views
Error: illegal assignment list to list [closed]
@RestResource(urlMapping='/Contact')
global class WSgetcontact {
@HttpGet
global static list<contact> doGet() {
WSgetcontact.contactproductwrapper result = new WSgetcontact....
-1
votes
2
answers
187
views
Not able to extend class in already defined Global class
I have a Global class that is part of a managed package of my developer org. In that class, I'm trying to extend another managed package Global class but getting an error as
Type is not visible: ...
0
votes
0
answers
63
views
Can we add global method or rest endpoint in locked package patch version?
We can't add new components to the package while creating the patch version of locked package.
We have a requirement, where we need to add the global method or rest endpoint. Is it possible through ...
2
votes
2
answers
476
views
Is it possible to use public classes/methods in global class?
I have a public class to get the response like this:
public without sharing class PhoneAndAddress {
public String id;
public String address;
public String phoneNumber;
}
And a global class for ...
4
votes
1
answer
76
views
Simulate trusted relationship (kinda @NamespaceAccessible behaviour) for base 1gp package and 2gp extension
We have our huge monolithic 1gp legacy package as well as 2gp extension package. And there are some secret configs (e.g. s3 keys, twillio account creds etc. in protected custom settings) in 1gp ...
1
vote
1
answer
28
views
Global access modifier used for cross-application access
Often when we read about global access modifiers we come across that it "should be used for any method that needs to be referenced outside of the application".
Now I understand that in case ...
7
votes
2
answers
240
views
Expose Package code via Flow instead of global methods
I am thinking about an alternative way to expose Manage Package code to the outside world. Not using the problematic global class scope. And I thought why not package a Flow that calls the code and ...
0
votes
1
answer
119
views
Forgot Username LWC controller throws error outside community
I'm trying to implement this forgot username component. And the Apex Controller code works when I test in the builder. But if I test it without logging in it errors out.
global with sharing class ...
0
votes
1
answer
74
views
Is it ok to delete a managed package?
I have developed an app in salesforce and created a managed package for the app, so that I can generate a installation url and send it to my client. But, the problem i have now is that, when I edit ...
0
votes
1
answer
639
views
How to call an Apex method with Wrappers parameters from managed package?
I know, how to access to such a method: packageName.MyGlobalClass.doWork();
But what if our method gets a Wrapers parameters? Like this:
global with sharing class MyGlobalClass{
global ...
2
votes
1
answer
324
views
Managed Package - Global interface and global/public class
Let's say we have global ProductFactory class like this:
global class ProductFactory {
global static ProductService getProductService() {
return new ProductServiceBasic();
}
}
...
1
vote
1
answer
358
views
Change/remove global method signatures or variables
I want to remove an unused custom sobject in my managed package, but it's part of a global method signature. Is it possible to remove the global method from the managed package or change the method ...
0
votes
1
answer
3k
views
How to cover global class and method in test class [closed]
how to cover global method and class in test class,here is my code
global with sharing class Migration_Asset2PatentBatch implements Database.Batchable<sObject>, Database.AllowsCallouts
{
public ...
-2
votes
2
answers
3k
views
Global variable must be contained inside of a global class
I'm building a visualforce page to be embedded in a record detail page that uses javascript remoting with a controller, and because of that I need to make the controller global for the embedded ...
34
votes
1
answer
942
views
Best practices for designing and maintaining Global classes?
We've always been conservative when it comes to exposing Globals for use by extension packages or subscriber extensions, and perhaps too conservative. We're considering being more proactive wth our ...
1
vote
0
answers
49
views
Error: Managed interface that is released can't implement new interfaces (bug?)
I have a managed package with the following class already in it:
global class MyInterfaceClass
{
global interface InnerInterface {}
global interface DeepInterface extends InnerInterface {}
}
...
1
vote
2
answers
882
views
Global class Manage Package Issue
We have a Global class with Global Static method in our Manage package
e.g:
(@Remote Action)
global static String doSomething(String quoteId, Boolean reconfig){}
Everytime, we have to add another ...
1
vote
1
answer
1k
views
Chargent AppFrontier - Unexpected character ('S' (code 83))
I am trying to integrate salesforce with Chargent with Stripe gateway and custome Chargent Order Object. I have a requirement to make changes in the VF Page so i have created the VF page and according ...
4
votes
1
answer
57
views
Can global members be added/removed from Beta packages freely?
Global things can't be un-global-ed once they hit production.
However, I need to debug something in a sandbox and want to generate a temporary beta build with some methods made global. Can I switch ...
0
votes
1
answer
158
views
how to extract and show signature in vf detail page?
this code is working and view all the data on my vf detail page but i want to extract signature like this is my mail
hello salesforce
--
Thanks and regards
Vipin Indora
mob no- 1234567890
i want ...
1
vote
1
answer
749
views
The installed managed class zqu.ProductSelectorController is not visible
I am getting this error trying to use a custom visual force page in place of a managed package visual force page. I made my custom controller global, thinking that it was mine that needed to be ...
0
votes
1
answer
2k
views
Apex utility class for email send
I have below method to send email. Now I need to do the same from a separate utility class where I will have to pass toAddress , ccaddress , parameter string which has a map with Email template , ...
1
vote
2
answers
100
views
Can we insert any records in overloaded methods?
I have got a requirement which I have mentioned here
I have been asked to create some overloaded methods to achieve this. Something like below.
Public Class OverloadedClass
{
Public Static Void ...
1
vote
1
answer
3k
views
Get Data from batch iterable
Good day everyone,
Maybe this question is basic for everyone but I'm having a problem with it, so I'm asking for help. I have created a BATCH ITERABLE .
global with sharing class batchProcessor ...
3
votes
1
answer
2k
views
Change Class access modifier in Managed Package
I have created a sample app in developer org and set the class modifier as global and then released its final version as managed package. Now it was caught in security review , now I have to make it ...
0
votes
1
answer
1k
views
Type casting error
I am getting runtime type casting error with below code. Can someone please help?
Code:
global class batchCallUpdate implements Database.Batchable<sObject> {
global Database.QueryLocator ...
2
votes
1
answer
2k
views
Global Modifier Accessing Public Elements in a Managed Package
Feel like I am missing something here...I have a Global class in my Managed Package that I want to use to act as a simple wrapper to enable someone to have access to certain objects in my package.
...
8
votes
1
answer
4k
views
Batchable class variable shows as NULL in finish() method
Sorry if the format is not good, first post ever and I don't know what all the options are.
totalRecords list size is printing as NULL in the email message body, I cannot figure out why.
global ...
3
votes
2
answers
121
views
Is it required for Security Scanner - global with sharing myBatch implement Database.Batachable<sObject>
I am about send my package for Security Scanner, So Is there any requirement to add "with Sharing" for all of my Batch Classes.
global with sharing myBatch implement Database.Batachable<sObject>...
4
votes
2
answers
387
views
Is the @IsTest annotation compatible with the global access modifier?
Has anyone wanted to provide a 'Test tool' with a managed package? Something like:
@IsTest global class SomeTestHelper {
global String findSomething() {
return '...';
}
}
that you ...
2
votes
1
answer
1k
views
Execute global batch job from installed package
How to execute global batch job from installed package:
NS__BirthdayBatch bb = new NS__BirthdayBatch();
Database.executeBatch(vb);
When I try ti run this code in dev console or workbench I am ...
7
votes
1
answer
1k
views
How to search through global methods of managed packages?
You can see global methods in the managed package classes via Web UI. I have hundreds of managed package API classes that I need to search through by a keyword, to find a method that does what I need ...
4
votes
1
answer
249
views
Can't create apex page which uses controller extension via apex-mdapi
I have a class in my managed package: global class myExtensionClass - which is extenison controller.
I installed this package in test salesforce developer account.
When user click one of the button ...
2
votes
2
answers
5k
views
What is Interface method in salesforce
I have a very simple doubt regarding this Interfaces in sales force, Actually what it says is "This class will have a method but the body will be empty. And body for this method will be provided in ...
2
votes
2
answers
4k
views
Get the caller class name in apex without passing parameter
I have three class namely A,B,C and each calls other class methods. Now my problem is getting the caller class name in called method without passing parameters to the called method. Is there any way ...
0
votes
1
answer
245
views
Can we keep @Readonly in the global class after releasing package for next version
After adding @ReadOnly annotation before the global method throws the following error.
Error: Compile Error: Managed identifier can not change its ReadOnly setting at line xx column xx
1
vote
1
answer
455
views
Create a OwnerId method
I want to create a OwnerId method which takes in an opportunity as input , stores all OwnerId's from that Opportunity in a list and returns that list. Here is what I have so far:
public static ...
1
vote
0
answers
161
views
InstallHandler not working
I have created a product and have it as a package and try to install into new env. I have a custom setting i am trying to create records into custom setting after the package get installed but i am ...
6
votes
2
answers
1k
views
How to develop global interface
I'm working on a project that is extended by another package. The base package contains a global interface that will be implemented in the extension package. I'm having some problems with the ...
7
votes
2
answers
2k
views
How do you deprecate a global method in a managed package?
This is semi-related to another question of mine: Is there any way to clean up redundant tabs/settings/pages/etc from managed packages? However, it is a bit different.
Once you've added a global ...