You need to sign in to do that
Don't have an account?
Ben Merton 15
Add a button to delete a related list if you press yes
I am trying to incorporate a button that does the following:
1. Press Button
2. Check if there are existing records
3. If there aren't existing records, run the controller to execute the clone
4. If there are existing records, give a choice "Yes" or "No"
5. If Yes, run the controller to execute the clone]
6. If no, close the box and don't do anything
I need to incorporate it on this code:
Any help
1. Press Button
2. Check if there are existing records
3. If there aren't existing records, run the controller to execute the clone
4. If there are existing records, give a choice "Yes" or "No"
5. If Yes, run the controller to execute the clone]
6. If no, close the box and don't do anything
I need to incorporate it on this code:
//////Class before List<Material_Request__c> womaterialrequest = [select Indent_Quantity__c, Good_Service__c from Material_Request__c where Work_Order__c = :workorderid]; if(womaterialrequest.size() != 0) { ApexPages.addMessage(new ApexPages.message(ApexPages.Severity.ERROR, 'Indents already on the Work Order. Please delete before Adding Indent Again')); return null; } ///////Class after
Any help
[1] http://blog.deadlypenguin.com/blog/2016/01/03/salesforce1-actions-with-visualforce/
All Answers
[1] https://appexchange.salesforce.com/developers
If that's the case absolutely no worries on that front - we are a helping community, not a doing community. =)
There are two ways to connect code to a button:
1) A VF page using the target object's standardController button. You can either immediate fire a method via the ACTION attribute of the apex:page tag, or have a UI on the VF page that the users interact with
2) API activation via Javascript. I wouldn't recommend this approach as with the coming of LEX all bets are off on exact forward compatibility.
CORRECTION on #1 - "A VF page using the target object's controller in the "standardController" attribute of the apex:page tag. You can add a controller extension via the "extensions" attribute.
Example:
[1] http://blog.deadlypenguin.com/blog/2016/01/03/salesforce1-actions-with-visualforce/
Would really appreciate it if you could also explain how the hell I connect a trigger to a class:
https://developer.salesforce.com/forums/ForumsMain?id=906F0000000MJtNIAW
You will probably notice a pattern - once I have been able to figure out the method for solving a problem, I can extend it out, remember it, modify it and UNDERSTAND it. Until then, I look like an idiot and will keep posting. I am possibly unusual for most people on these Boards as I run my own manufacturing business and am building a product out of an instance I have evolved over the past five years on my own.
The issue is that there isn't a whole lot on that on these boards that explains the methodology for solving problems to new developers. The assumption is that you can launch straight into the code, but that isn't the case for us mere mortals. Am really just looking for guidance, not a shortcut.
However, I have noticed some of my developer co-workers spend HOURS trying to solve a problem that just needs a little explanation, where my reaction is just to post to the admin boards. Maybe this doesn't work for developers, or maybe I am just coming at development from a different perspective......
Ben