You need to sign in to do that
Don't have an account?
vanessa veron
Modify Method Apex
Hello
I have an apex page that lists the jobs created.
I would like to MODIFY and DELETE a job.
I did a method to delete and it works.
I'm not getting to do the MODIFY method that will catch the values of the job (CronTrigger + MAIL informed the creation of this job) save and submit a second Visualforce page into inputText and selectOption.
The code:
Thank you
I have an apex page that lists the jobs created.
I would like to MODIFY and DELETE a job.
I did a method to delete and it works.
I'm not getting to do the MODIFY method that will catch the values of the job (CronTrigger + MAIL informed the creation of this job) save and submit a second Visualforce page into inputText and selectOption.
The code:
APEX: .... //CREATE JOB SCHEDULABLE global void schedulejob(){ String email = getMail(); String heu = getHour(); String min = getMinute(); String jMois = getDayMonth(); String leMois = getMonth(); String jSemaine = getDayWeek(); String NomJobSchedulable = nomJob; CLASS p = new CLASS (email , heu, min, jMois, leMois,jSemaine); String expression = '00'+' '+min+' '+heu+' '+jMois+' '+leMois+' '+jSemaine ; system.schedule(NomJobSchedulable , expression, p); } //DELETE JOB public void deleteJob() { if(!String.isBlank(strJobName)) { idJobDel= new List<CronTrigger>(); idJobDel= [SELECT Id FROM CronTrigger where CronJobDetail.Name =: strJobName]; System.abortJob(idJobDel[0].id); } else { system.debug('NOT Job Name'); } } //MOTIFY JOB -- like as ..... public void modifier (){ testeInfos = getInfos.split('/'); String mailMod = testeInfos.get(0); setMail(mailMod); deleteJob(); PageModify(); } VISUALFORCE <apex:column > <apex:commandButton value="M" oncomplete="refreshPage();" action="{!modifier}"/> </apex:column>Help me plese!
Thank you
You can return page reference to the standard edit page. Just copy the URL from brouser while editing a job, and then return the page reference to this page inside your edit method.
What do you do???
and then in the end return pageReference object to the page you need.
google pageReference class, it is quite simple to understand.
https://www.salesforce.com/us/developer/docs/apexcode/Content/apex_system_pagereference.htm
can you give me an example?
I used pageReference class in a method:
'partialURL' to '/' + 'recordID'
new PageReference('/apex/yourpagename'+recID);
something like this
The 2nd page is based on the same controller...
1 - 1st page has a table with informations of the jobs schedulables...
2 - I would like to get the values into my custom object (according to the row of the selected table) :
==> I create a job, the informations are saved on my object.
3 - I would like to display this values (into my custom object) into the inputsText and selctList of the 2nd page.
Help me please!!!
Thank you
<apex:pageBlock >
<apex:pageBlockTable value="{!cases}" var="c" >
<apex:column headerValue="Action">
<apex:commandLink value="View" action="/apex/PartnerCaseDetail?id={!c.Id}" />
</apex:column>
<apex:column value="{!c.CaseNumber}" headerValue="Case Number"/>
<apex:column value="{!c.Contact.Name}" headerValue="Contact"/>
<apex:column value="{!c.Subject}" headerValue="Subject"/>
<apex:column value="{!c.Status}" headerValue="Status"/>
<apex:column value="{!c.CreatedDate}" headerValue="Created Date"/>
</apex:pageBlockTable>
</apex:pageBlock>
WHERE /apex/PartnerCaseDetail shuld be changed to your custom Page name. in this case you will get the record you need.
I would put the value of a variable APEX appearing in inputText and selectOption.
So if your controller uses a variable(in this case account) than referring to account.Name etc will fill these fields in.
<apex:page standardController="Account">
<apex:form >
<apex:pageBlock >
<apex:pageBlockSection title="My Content Section" columns="2">
<apex:inputField value="{!account.name}"/>
<apex:inputField value="{!account.site}"/>
<apex:inputField value="{!account.type}"/>
<apex:inputField value="{!account.accountNumber}"/>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>
sorry if I got you wrong, but you pass to little information :)
I have a page 1 and page 2 . The page 1 call page 2 and passes the value of a variable to page 2.
When I click the button (within a table) I would like the page 2 to be called and contained the MAIL value given already.
How I do it ....
APEX:
VISUALFORCE:
Thank you!!
If your pages are based on the same controller that there should be no problems with it. Is it blank on your page?
http://salesforce.stackexchange.com/questions/4189/how-to-display-values-from-one-vf-page-into-another-vf-pge
I have a page 1 with a table...
I have a page 2 with the inputs and selectOption to create a new job.
The page 1 should call the page 2
The page 2 should display the values (according the row selected) in Page 1
https://developer.salesforce.com/page/Wrapper_Class
last two links should be enough to create this functionallity :) Good Luck!
I have a page 1 with a table...
I have a page 2 with the inputs and selectOption to create a new job.
The page 1 should call the page 2
The page 2 should display the values (according the row selected) in Page 1
2 pages and one controller.
1st page:
2nd page:
and a controller:
Thank you!!!!!
it's exactly what I want to do ... but my values are within a String ...
How do I tell the Apex page it will display the contents of a String?
to reference the contents of a wrapper class use {!AccWrapper.str}
if we look on pages than it will look as follows:
-Name
-Id
-AccountNumber and so on
in our case Wrapper has properties:
-str (string)
-check (boolean)
And you can create any properties you want :) Very powerfull approach.
I have a shcedulable class: global class AAAAA implements System.Schedulable {....}
I would like to get the String value into class Apex and prepulate this value into input Text (Visualforce Page)
Just try to use the pattern I showed inside your code :)
Gone home, good luck with your feature.