-
ChatterFeed
-
0Best Answers
-
0Likes Received
-
0Likes Given
-
22Questions
-
22Replies
External website login through IFrames?
Hi All,
I'm trying to login third party external website from Salesforce IFrames.
For that I have developed a page with two buttons
> Button 1: Accesstoken
> Button 2 : Login
By clicking the "button 1" it generates a access token in browser like below response :
<results>
<status code="ok"/>
<OWASP_CSRF_TOKEN>
<token>0fb92008378bae5ff518192da6111695806d3f111468df6aa3d5c0879beba72b</token>
</OWASP_CSRF_TOKEN>
</results>
After that I click the "button 2" Then only it taken login to external website through iframe.
Problem: How can I login external website instead of generating access token visually?.
VF Page :
-----------
<apex:page standardController="Test__c" extensions="CreateAdobeWebinar">
<apex:form >
<center>
<apex:commandButton value="Accesstoken" action="{!processButtonClick}"/>
<apex:commandButton value="Login" action="{!doLogin}"/>
</center>
</apex:form>
</apex:page>
Apex Class :
------------
public class CreateAdobeWebinar {
Public String password;
Public String url;
Public String accesstoken;
public PageReference pageref2{get;set;}
public Test__c login;
public CreateAdobeWebinar(ApexPages.StandardSetController controller){
this.login= (Test__c)controller.getRecord();
}
public CreateAdobeWebinar(ApexPages.StandardController controller){}
public PageReference processButtonClick(){
PageReference pageref = new PageReference('https://xxxxxxxxxx/api/xml?action=login&login=xxxxxx@gmail.com&password=xxxxxx&domain=xxxxxxx.com&session='+cookie);
//PageReference pageref2 = new PageReference('/apex/AdobeIframe');
return pageref;
}
public PageReference doLogin(){
PageReference pageref2 = new PageReference('/apex/AdobeIframe');
return pageref2;
}
}
AdobeIframe Page:
-----------------
<apex:page standardController="Test__c">
<apex:iframe height="800" width="1230" src="https://xxxxxx.adobeconnect.com" scrolling="true"/>
</apex:page>
Thanks,
Basha
I'm trying to login third party external website from Salesforce IFrames.
For that I have developed a page with two buttons
> Button 1: Accesstoken
> Button 2 : Login
By clicking the "button 1" it generates a access token in browser like below response :
<results>
<status code="ok"/>
<OWASP_CSRF_TOKEN>
<token>0fb92008378bae5ff518192da6111695806d3f111468df6aa3d5c0879beba72b</token>
</OWASP_CSRF_TOKEN>
</results>
After that I click the "button 2" Then only it taken login to external website through iframe.
Problem: How can I login external website instead of generating access token visually?.
VF Page :
-----------
<apex:page standardController="Test__c" extensions="CreateAdobeWebinar">
<apex:form >
<center>
<apex:commandButton value="Accesstoken" action="{!processButtonClick}"/>
<apex:commandButton value="Login" action="{!doLogin}"/>
</center>
</apex:form>
</apex:page>
Apex Class :
------------
public class CreateAdobeWebinar {
Public String password;
Public String url;
Public String accesstoken;
public PageReference pageref2{get;set;}
public Test__c login;
public CreateAdobeWebinar(ApexPages.StandardSetController controller){
this.login= (Test__c)controller.getRecord();
}
public CreateAdobeWebinar(ApexPages.StandardController controller){}
public PageReference processButtonClick(){
PageReference pageref = new PageReference('https://xxxxxxxxxx/api/xml?action=login&login=xxxxxx@gmail.com&password=xxxxxx&domain=xxxxxxx.com&session='+cookie);
//PageReference pageref2 = new PageReference('/apex/AdobeIframe');
return pageref;
}
public PageReference doLogin(){
PageReference pageref2 = new PageReference('/apex/AdobeIframe');
return pageref2;
}
}
AdobeIframe Page:
-----------------
<apex:page standardController="Test__c">
<apex:iframe height="800" width="1230" src="https://xxxxxx.adobeconnect.com" scrolling="true"/>
</apex:page>
Thanks,
Basha
- basha sk
- March 16, 2018
- Like
- 0
Keeping the Refresh page untill callout complete?
Hi All,
I'm trying to use the Continuation process in my apex for keeping the calls untill callout complete.But Here endpoint doesn't executed
This line prints all details : System.debug('UserName:::'+username1+ ':' + 'Password::::' + password1+ ':' + 'URL::::' +url1+ ':' + 'AccessToken:::' +accesstoken+ ':' + 'EventId:::' +eventid);
This line doesn't executed : req1.setEndpoint(url1+'/api/xml?action=report-event-participants-complete-information&account-id=1319228412&session='+accesstoken+'&sco-id='+eventid);
I checked in debug logs.
public Object startRequest(String username1,String password1,String url1,String accesstoken,String eventid) {
Continuation con = new Continuation(30);
con.continuationMethod='processResponse';
Http http = new Http();
HttpRequest req1 = new HttpRequest();
Blob headerValue = Blob.valueOf(username1 + ':' + password1);
System.debug('UserName:::'+username1+ ':' + 'Password::::' + password1+ ':' + 'URL::::' +url1+ ':' + 'AccessToken:::' +accesstoken+ ':' + 'EventId:::' +eventid);
String authorizationHeader = 'BASIC ' + EncodingUtil.base64Encode(headerValue);
req1.setHeader('Authorization', authorizationHeader);
req1.setMethod('GET');
req1.setEndpoint(url1+'/api/xml?action=report-event-participants-complete-information&account-id=1319228412&session='+accesstoken+'&sco-id='+eventid);
res = http.send(req1);
System.debug('Test Endpoint Request');
this.requestLabel_1 = con.addHttpRequest(req1);
return con;
}
public Object processResponse(){
HttpResponse response1 = Continuation.getResponse(this.requestLabel_1);
System.debug('Test1::'+response1);
if(response1.getBody() != null && response1.getStatusCode() == 200)
XMLparserUpdate s = new XMLparserUpdate(response1.getBody(),eventid,EventName);
return null;
}
Thanks
- basha sk
- February 21, 2018
- Like
- 0
Refresh the page untill callout complete?
Hi Guys,
I'm getting the values from third party and inserting data into salesforce custom object from visualforce page
by clicking a button.I'm successfully getting the values and inserting the data from external system
but here my
Requirement:
------------
Once I click the button in visualforce page the page just refreshes and ends before callout complete.
I want to show the refreshing the page untill callout complete.Once the callout complete I want to display updated values
Please help anybody having idea
This is my code :
------------------
<apex:actionStatus id="actStatusId">
<apex:facet name="start">
<div class="waitingSearchDiv" id="el_loading" style="background-color: black; height: 100%;opacity:0.65;width:100%;">
<div class="waitingHolder" style="top: 74.2px; width: 91px;">
<img class="waitingImage" src="/img/loading.gif" title="Please Wait..." />
<span class="waitingDescription">Updating list...</span>
</div>
</div>
</apex:facet>
<apex:facet name="stop">
<apex:commandButton action="{!getWebinarAttendees}" value="Update All" status="actStatusId" reRender="responseBlock" style="margin-left:50%" />
</apex:facet>
</apex:actionStatus>
<br/><br/>
<apex:outputPanel>
<apex:pageBlock id="pgblock">
<apex:pageblockSection id="responseBlock" title="Webinar Attendee Details" >
<apex:pageBlockTable value="{!wrapperAccountList}" var="w" id="table" title="All Accounts">
<apex:column >
<apex:facet name="header">
<apex:inputCheckbox onclick="selectAllCheckboxes(this,'inputId')"/>
</apex:facet>
<apex:inputCheckbox value="{!w.selected}" id="inputId"/>
</apex:column>
<apex:column >
<apex:outputLink value="{!$Page.WebinarAttendeeDetails}?id={!w.acc.id}">{!w.acc.name}</apex:outputLink>
</apex:column>
<apex:column value="{!w.acc.Login__c}"></apex:column>
<apex:inlineEditSupport event="ondblClick" />
</apex:pageBlockTable>
</apex:pageblockSection>
</apex:pageBlock>
</apex:outputPanel>
Thanks In Advance
Basha
I'm getting the values from third party and inserting data into salesforce custom object from visualforce page
by clicking a button.I'm successfully getting the values and inserting the data from external system
but here my
Requirement:
------------
Once I click the button in visualforce page the page just refreshes and ends before callout complete.
I want to show the refreshing the page untill callout complete.Once the callout complete I want to display updated values
Please help anybody having idea
This is my code :
------------------
<apex:actionStatus id="actStatusId">
<apex:facet name="start">
<div class="waitingSearchDiv" id="el_loading" style="background-color: black; height: 100%;opacity:0.65;width:100%;">
<div class="waitingHolder" style="top: 74.2px; width: 91px;">
<img class="waitingImage" src="/img/loading.gif" title="Please Wait..." />
<span class="waitingDescription">Updating list...</span>
</div>
</div>
</apex:facet>
<apex:facet name="stop">
<apex:commandButton action="{!getWebinarAttendees}" value="Update All" status="actStatusId" reRender="responseBlock" style="margin-left:50%" />
</apex:facet>
</apex:actionStatus>
<br/><br/>
<apex:outputPanel>
<apex:pageBlock id="pgblock">
<apex:pageblockSection id="responseBlock" title="Webinar Attendee Details" >
<apex:pageBlockTable value="{!wrapperAccountList}" var="w" id="table" title="All Accounts">
<apex:column >
<apex:facet name="header">
<apex:inputCheckbox onclick="selectAllCheckboxes(this,'inputId')"/>
</apex:facet>
<apex:inputCheckbox value="{!w.selected}" id="inputId"/>
</apex:column>
<apex:column >
<apex:outputLink value="{!$Page.WebinarAttendeeDetails}?id={!w.acc.id}">{!w.acc.name}</apex:outputLink>
</apex:column>
<apex:column value="{!w.acc.Login__c}"></apex:column>
<apex:inlineEditSupport event="ondblClick" />
</apex:pageBlockTable>
</apex:pageblockSection>
</apex:pageBlock>
</apex:outputPanel>
Thanks In Advance
Basha
- basha sk
- February 19, 2018
- Like
- 0
How to filter previous values from next response values ?
Hi All,
I'm trying to filter the below mentioned response like below please check it once
Map<String,String> customsettingValues = new Map<String,String>();
Map<String,String> SelectedValues = new Map<String,String>();
Set<String> orderList1 = new Set<String>();
for(String firstKey : customsettingValues.keySet()){
String firstValue = customsettingValues.get(firstKey);
for(String secondKey : SelectedValues.keySet()){
String secondValue = SelectedValues.get(secondKey);
if(firstValue.equals(secondKey)){
orderList1.add(secondValue);
System.debug('orderList1:::---------'+orderList1);
}
}
}
I got the Response Like below for the above code
orderList1:::---------{chandra}
orderList1:::---------{chandraiii@gmail.com,chandra}
orderList1:::---------{Not Attended,chandraiii@gmail.com,chandra}
orderList1:::---------{vizag,Not Attended,chandraiii@gmail.com,chandra}
orderList1:::---------{ap,vizag,Not Attended,chandraiii@gmail.com,chandra}
orderList1:::---------{Ind,ap,vizag,Not Attended,chandraiii@gmail.com,chandra}
orderList1:::---------{88888888888,Ind,ap,vizag,Not Attended,chandraiii@gmail.com,chandra}
How to change above response like below
orderList1:::---------{chandra}
orderList1:::---------{chandraiii@gmail.com}
orderList1:::---------{Not Attended}
orderList1:::---------{vizag}
orderList1:::---------{ap}
orderList1:::---------{Ind}
orderList1:::---------{88888888888}
If anybody having idea please let me know
Thanks In Advance
Basha
I'm trying to filter the below mentioned response like below please check it once
Map<String,String> customsettingValues = new Map<String,String>();
Map<String,String> SelectedValues = new Map<String,String>();
Set<String> orderList1 = new Set<String>();
for(String firstKey : customsettingValues.keySet()){
String firstValue = customsettingValues.get(firstKey);
for(String secondKey : SelectedValues.keySet()){
String secondValue = SelectedValues.get(secondKey);
if(firstValue.equals(secondKey)){
orderList1.add(secondValue);
System.debug('orderList1:::---------'+orderList1);
}
}
}
I got the Response Like below for the above code
orderList1:::---------{chandra}
orderList1:::---------{chandraiii@gmail.com,chandra}
orderList1:::---------{Not Attended,chandraiii@gmail.com,chandra}
orderList1:::---------{vizag,Not Attended,chandraiii@gmail.com,chandra}
orderList1:::---------{ap,vizag,Not Attended,chandraiii@gmail.com,chandra}
orderList1:::---------{Ind,ap,vizag,Not Attended,chandraiii@gmail.com,chandra}
orderList1:::---------{88888888888,Ind,ap,vizag,Not Attended,chandraiii@gmail.com,chandra}
How to change above response like below
orderList1:::---------{chandra}
orderList1:::---------{chandraiii@gmail.com}
orderList1:::---------{Not Attended}
orderList1:::---------{vizag}
orderList1:::---------{ap}
orderList1:::---------{Ind}
orderList1:::---------{88888888888}
If anybody having idea please let me know
Thanks In Advance
Basha
- basha sk
- February 19, 2018
- Like
- 0
External website doesn't login ondemand through salesforce iframes?
Hi Everyone,
I'm trying to login external website from salesforce iframes.
For testing I check the URL in browser like below i get the response
URL : https://xxxxxxxx.adobeconnect.com/api/xml?action=login&login=xxxxxxx.com&password=xxxxxxx
Response :
----------
<results>
<status code="ok"/>
<OWASP_CSRF_TOKEN>
<token>
442adc814ed114ac272552be35684e1253444f5d7d5e05b2ee73d72adf287320
</token>
</OWASP_CSRF_TOKEN>
</results>
now i' testing the login in same window with url : https://xxxxxxxx.adobeconnect.com/
now thios it directly opens the home page of my instance.
Now I'm doing the same process through REST api but the browser ignores the token doesn't take the login access
it just opens the login page of my instance.
This is my REST API please check it once
Apex class:
--------------
public class CreateEvent{
public Test__c login;
public CreateEvent(ApexPages.StandardSetController controller){
this.login= (Test__c)controller.getRecord();
}
public CreateEvent(ApexPages.StandardController controller){}
public Pagereference processCheck(){
CreateWebinar.postfieldsFuture(username,password,url,cookie);
PageReference pageref2 = new PageReference('/apex/AdobeIframe');
return pageref;
REST API
---------
global class CreateWebinar{
@future (callout=true)
global static void postfieldsFuture(String username, String password,String url,String cookie){
getParticipants(username, password, url,cookie);
}
global static HttpResponse getParticipants(String username, String password,String url,String cookie){
Http http = new Http();
HttpRequest req = new HttpRequest();
HttpResponse res = new HttpResponse();
Blob headerValue = Blob.valueOf(username + ':' + password);
String authorizationHeader = 'BASIC ' +
EncodingUtil.base64Encode(headerValue);
req.setHeader('Authorization', authorizationHeader);
req.setEndpoint(url+'/api/xml?action=login&login='+username+'&password='+password+'&domain=acme.adobe.com&session='+cookie);
req.setMethod('GET');
req.setHeader('Content-Type', 'application/json');
req.setHeader('Accept','application/json');
res = http.send(req);
String[] headerkeys = res.getHeaderKeys();
Map<string, string> headers = new map<string, string>();
for(string s : headerkeys){
headers.put(s,res.getHeader(s));
system.debug('header: ' + s + ' value: ' + res.getHeader(s));
}
//HeaderValues:======(Server, Cache-Control, Connection, Set-Cookie, Expires, Content-Length, Date, Content-Type)
System.debug('HeaderValues:======'+headerkeys);
System.debug('MyResult == :'+res.getBody());
}
}
Adobe Iframe
----------------
<apex:page>
<apex:iframe height="800" width="1230" src="https://meet30705009.adobeconnect.com?domain=acme.adobeconnect.com&Set-Cookie=apac1breeztxw8g5cx2g4x8wh6" scrolling="true"/>
</apex:page>
how to login to my instance ondemand through iframes please check it once
if anyone having idea please let me know
Thanks
Basha
- basha sk
- February 16, 2018
- Like
- 0
How to execute command button twice by one click ?
HI,
Actually I'm trying to ceate a record in external system for that I have developed
a REST api and it works perfectly for creating a record.
Problem:
---------
Step1 : By clicking the command button once in visualforce page first it sends request to external
system and returns the response as status ok.But no record creates in external system this time.
Step2 : Now this time by clicking the command button twice from visualforce page it sends request to third party
and creates a record in external system.
How can I avoid double clicking a command button in visualforce for creating a record.
This is my page :
-----------------
<apex:page standardController="Test__c" extensions="UserExport" sidebar="false">
<apex:form >
<apex:panelGrid columns="2">
<apex:pageBlock Title=" Registration Form">
<apex:pagemessages />
<apex:pageBlockSection >
<apex:inputField value="{!Test__c.First_Name__c}" /> <br/>
<apex:inputField value="{!Test__c.Last_Name__c}" /><br/>
<apex:inputField value="{!Test__c.Login__c}" /><br/>
<apex:inputField value="{!Test__c.Registration_Password__c}" /><br/>
<apex:inputField value="{!Test__c.Conform_Password__c}" /><br/>
<apex:inputField value="{!Test__c.Company_Name__c}" /><br/>
<apex:inputField value="{!Test__c.City__c}"/> <br/>
<apex:inputField value="{!Test__c.State__c}"/><br/>
<apex:inputField value="{!Test__c.Country__c}"/><br/>
<apex:inputField value="{!Test__c.Mobile_Phone__c}"/> <br/>
</apex:pageBlockSection>
<apex:commandButton value="Register" action="{!processButtonClick}"/>
</apex:pageBlock>
Thanks,
Actually I'm trying to ceate a record in external system for that I have developed
a REST api and it works perfectly for creating a record.
Problem:
---------
Step1 : By clicking the command button once in visualforce page first it sends request to external
system and returns the response as status ok.But no record creates in external system this time.
Step2 : Now this time by clicking the command button twice from visualforce page it sends request to third party
and creates a record in external system.
How can I avoid double clicking a command button in visualforce for creating a record.
This is my page :
-----------------
<apex:page standardController="Test__c" extensions="UserExport" sidebar="false">
<apex:form >
<apex:panelGrid columns="2">
<apex:pageBlock Title=" Registration Form">
<apex:pagemessages />
<apex:pageBlockSection >
<apex:inputField value="{!Test__c.First_Name__c}" /> <br/>
<apex:inputField value="{!Test__c.Last_Name__c}" /><br/>
<apex:inputField value="{!Test__c.Login__c}" /><br/>
<apex:inputField value="{!Test__c.Registration_Password__c}" /><br/>
<apex:inputField value="{!Test__c.Conform_Password__c}" /><br/>
<apex:inputField value="{!Test__c.Company_Name__c}" /><br/>
<apex:inputField value="{!Test__c.City__c}"/> <br/>
<apex:inputField value="{!Test__c.State__c}"/><br/>
<apex:inputField value="{!Test__c.Country__c}"/><br/>
<apex:inputField value="{!Test__c.Mobile_Phone__c}"/> <br/>
</apex:pageBlockSection>
<apex:commandButton value="Register" action="{!processButtonClick}"/>
</apex:pageBlock>
Thanks,
- basha sk
- February 15, 2018
- Like
- 0
Adobe connect login doesn't work ondemand through iframes in salesforce?
Adobe connect login doesn't work ondemand through iframes in salesforce?
Hi Everyone,
I'm trying to login adobeconnect through iframes ondemand but it doesn't work for me.
I tried the below two ways please but two ways doesn't work I don't know where I made mistake
please check it once If anybody having idea please let me know I 'm trying this from last three days
.
Process 1:
--------------
Apex class:
------------
public pageReference processButtonClick(){
Login_Access__c lst1 = [select id,Name,username__c,password__c,url__c,Cookie__c from Login_Access__c limit 1];
PageReference pageref = new PageReference('https://xxxxxxxx.adobeconnect.com/api/xml?action=login&login=xxxxxx.com&password=xxxxxxxxx&domain=acme.adobe.com&session='+cookie);
return pageref;
}
public PageReference doLogin(){
PageReference pageref2 = new PageReference('/apex/AdobeIframe');
return pageref2;
}
vf page 1 :
----------
<apex:form >
<center>
<apex:commandButton value="Login to Adobe" action="{!processButtonClick}"/>
<apex:commandButton value="Create Webinar" action="{!doLogin}"/>
</center>
</apex:form>
vf page 2 :
-------------
<apex:page>
<apex:iframe height="800" width="1230" src="https://xxxxxx.adobeconnect.com" scrolling="true"/>
</apex:page>
here by clicking the "Login to Adobe" button I get the response in browser like below
Response :
----------
<results>
<status code="ok"/>
<OWASP_CSRF_TOKEN>
<token>5c7b280238eb9c73da734acb5988082d87dfa9125c697e0e6bff7049d6ca8479</token>
</OWASP_CSRF_TOKEN>
</results>
after that I'm clicking the button called "Create Webinar" then only it taken to login and directly opend adobe connect home page.
Note : If i click the "logout" button.after that I'm trying to login through directly from "Create Webinar" button.at this time it won't taken to login access.
instead of login it redirects to login page.For login I want to do the same process above explained.
how can I avoid for every time generate the response in browser.
**And also I tried the second process**
Process 2 :
-----------
VF Page 1:
----------
<apex:form >
<center>
<apex:commandButton value="Login to Adobe" action="{!processButtonClick}"/>
</center>
</apex:form>
VF Page 2:
-----------
<apex:page>
<apex:iframe height="800" width="1230" src="https://meet30705009.adobeconnect.com" scrolling="true"/>
</apex:page>
apex class:
-----------
public pageReference processButtonClick(){
Login_Access__c lst1 = [select id,Name,username__c,password__c,url__c,Cookie__c from Login_Access__c limit 1];
String username = lst1.username__c;
String password = lst1.password__c;
String url = lst1.url__c;
String cookie = lst1.Cookie__c;
//REST api calling
CreateWebinar.postfieldsFuture(username,password,url,cookie);
PageReference pageref2 = new PageReference('/apex/AdobeIframe');
return pageref2;
}
REST api :
----------
global class CreateWebinar{
@future (callout=true)
global static void postfieldsFuture(String username, String password,String url,String cookie){
getParticipants(username, password, url,cookie);
}
global static HttpResponse getParticipants(String username, String password,String url,String cookie){
Http http = new Http();
HttpRequest req = new HttpRequest();
HttpResponse res = new HttpResponse();
Blob headerValue = Blob.valueOf(username + ':' + password);
String authorizationHeader = 'BASIC ' +
EncodingUtil.base64Encode(headerValue);
req.setHeader('Authorization', authorizationHeader);
req.setEndpoint(url+'/api/xml?action=login&login='+username+'&password='+password+'&domain=acme.adobe.com&session='+cookie);
req.setMethod('GET');
req.setHeader('Content-Type', 'application/json');
req.setHeader('Accept','application/json');
res = http.send(req);
System.debug('MyResult == :'+res.getBody());
Dom.Document doc = res.getBodyDocument();
Dom.XMLNode results = doc.getRootElement();
Dom.XMLNode OWASP_CSRF_TOKEN = results.getChildElement('OWASP_CSRF_TOKEN', null);
String accesstokenvalue = OWASP_CSRF_TOKEN.getChildElement('token', null).getText();
System.debug('AccessToken:::----'+accesstokenvalue );
}
}
After the clicking the "Login to Adobe" button it redirects to adobe connect login page,but doesn't taken login directly.
I don't know where should i made mistake.Please help me I tried this from last three days.
Thanks
Basha
Hi Everyone,
I'm trying to login adobeconnect through iframes ondemand but it doesn't work for me.
I tried the below two ways please but two ways doesn't work I don't know where I made mistake
please check it once If anybody having idea please let me know I 'm trying this from last three days
.
Process 1:
--------------
Apex class:
------------
public pageReference processButtonClick(){
Login_Access__c lst1 = [select id,Name,username__c,password__c,url__c,Cookie__c from Login_Access__c limit 1];
PageReference pageref = new PageReference('https://xxxxxxxx.adobeconnect.com/api/xml?action=login&login=xxxxxx.com&password=xxxxxxxxx&domain=acme.adobe.com&session='+cookie);
return pageref;
}
public PageReference doLogin(){
PageReference pageref2 = new PageReference('/apex/AdobeIframe');
return pageref2;
}
vf page 1 :
----------
<apex:form >
<center>
<apex:commandButton value="Login to Adobe" action="{!processButtonClick}"/>
<apex:commandButton value="Create Webinar" action="{!doLogin}"/>
</center>
</apex:form>
vf page 2 :
-------------
<apex:page>
<apex:iframe height="800" width="1230" src="https://xxxxxx.adobeconnect.com" scrolling="true"/>
</apex:page>
here by clicking the "Login to Adobe" button I get the response in browser like below
Response :
----------
<results>
<status code="ok"/>
<OWASP_CSRF_TOKEN>
<token>5c7b280238eb9c73da734acb5988082d87dfa9125c697e0e6bff7049d6ca8479</token>
</OWASP_CSRF_TOKEN>
</results>
after that I'm clicking the button called "Create Webinar" then only it taken to login and directly opend adobe connect home page.
Note : If i click the "logout" button.after that I'm trying to login through directly from "Create Webinar" button.at this time it won't taken to login access.
instead of login it redirects to login page.For login I want to do the same process above explained.
how can I avoid for every time generate the response in browser.
**And also I tried the second process**
Process 2 :
-----------
VF Page 1:
----------
<apex:form >
<center>
<apex:commandButton value="Login to Adobe" action="{!processButtonClick}"/>
</center>
</apex:form>
VF Page 2:
-----------
<apex:page>
<apex:iframe height="800" width="1230" src="https://meet30705009.adobeconnect.com" scrolling="true"/>
</apex:page>
apex class:
-----------
public pageReference processButtonClick(){
Login_Access__c lst1 = [select id,Name,username__c,password__c,url__c,Cookie__c from Login_Access__c limit 1];
String username = lst1.username__c;
String password = lst1.password__c;
String url = lst1.url__c;
String cookie = lst1.Cookie__c;
//REST api calling
CreateWebinar.postfieldsFuture(username,password,url,cookie);
PageReference pageref2 = new PageReference('/apex/AdobeIframe');
return pageref2;
}
REST api :
----------
global class CreateWebinar{
@future (callout=true)
global static void postfieldsFuture(String username, String password,String url,String cookie){
getParticipants(username, password, url,cookie);
}
global static HttpResponse getParticipants(String username, String password,String url,String cookie){
Http http = new Http();
HttpRequest req = new HttpRequest();
HttpResponse res = new HttpResponse();
Blob headerValue = Blob.valueOf(username + ':' + password);
String authorizationHeader = 'BASIC ' +
EncodingUtil.base64Encode(headerValue);
req.setHeader('Authorization', authorizationHeader);
req.setEndpoint(url+'/api/xml?action=login&login='+username+'&password='+password+'&domain=acme.adobe.com&session='+cookie);
req.setMethod('GET');
req.setHeader('Content-Type', 'application/json');
req.setHeader('Accept','application/json');
res = http.send(req);
System.debug('MyResult == :'+res.getBody());
Dom.Document doc = res.getBodyDocument();
Dom.XMLNode results = doc.getRootElement();
Dom.XMLNode OWASP_CSRF_TOKEN = results.getChildElement('OWASP_CSRF_TOKEN', null);
String accesstokenvalue = OWASP_CSRF_TOKEN.getChildElement('token', null).getText();
System.debug('AccessToken:::----'+accesstokenvalue );
}
}
After the clicking the "Login to Adobe" button it redirects to adobe connect login page,but doesn't taken login directly.
I don't know where should i made mistake.Please help me I tried this from last three days.
Thanks
Basha
- basha sk
- February 15, 2018
- Like
- 0
How to filter only selected contact from Account.Contacts dropdownlist?
Hi Everyone,
Please check the below requirement once If anybody having idea please let me know.
vf page :
----------
<apex:pageBlock title="Registration Form">
Account Names
<apex:selectList value="{!selectedAccId}" size="1">
<apex:selectOptions value="{!AccountNames}"/>// All Salesforce Accounts
<apex:actionSupport event="onchange" reRender="a"/>
</apex:selectList> <br/>
Related Contacts
<apex:selectList value="{!selectedConId}" size="1" id="a">
<apex:selectOptions value="{!ContactNames}" /> //All contacts related to Account
</apex:selectList><br/>
<apex:commandButton value="Register" action="{!createUser}" reRender="msgs" style="margin-left:40%"/>
</apex:pageBlock>
step 1: Here I selected one account from the list of all accounts then automatically populating related contacts.
step2 : From the list of contacts for suppose If I select a single contact how can I get that only one contact.
Here I completed the "step1" but I'm little confusing at "step 2" how to filter the selected contact only from
contacts list.
This is my apex class please check it once
apex class:
-------------
public with sharing class Picklist{
public String selectedAccId{get;set;}
public String selectedConId{get;set;}
List<System.SelectOption> conOptions{get;set;}
List<System.SelectOption> options{get;set;}
public Picklist(ApexPages.StandardController controller){
this.login1= (LightiningEd__Webinar__c)controller.getRecord();
}
public List<System.SelectOption> accOptions{get;set;}
public List<System.SelectOption> getAccountNames(){
List<System.SelectOption> accOptions= new List<System.SelectOption>();
accOptions.add( new System.SelectOption('','--Select--'));
for( Account acc : [select Id,name from Account] ){
accOptions.add( new System.SelectOption(String.valueOf(acc.Id),acc.name));
}
return accOptions;
}
public List<System.SelectOption> getContactNames(){
System.debug('Selected account id...........'+selectedAccId );
List<System.SelectOption> conOptions= new List<System.SelectOption>();
if(selectedAccId != null){
for(contact con : [select Id,name,Account.Name,accountid,FirstName,LastName,email,MobilePhone,MailingCity,MailingState,MailingCountry
from contact where accountid=:selectedAccId ]){
conOptions.add(new System.SelectOption(String.valueOf(con.Id),con.name));
System.debug('conOptions:::'+conOptions);System.debug('Entered Selected contact id...........'+selectedConId);
}
}return conOptions;
}
}
Thanks In Advance
Basha
Please check the below requirement once If anybody having idea please let me know.
vf page :
----------
<apex:pageBlock title="Registration Form">
Account Names
<apex:selectList value="{!selectedAccId}" size="1">
<apex:selectOptions value="{!AccountNames}"/>// All Salesforce Accounts
<apex:actionSupport event="onchange" reRender="a"/>
</apex:selectList> <br/>
Related Contacts
<apex:selectList value="{!selectedConId}" size="1" id="a">
<apex:selectOptions value="{!ContactNames}" /> //All contacts related to Account
</apex:selectList><br/>
<apex:commandButton value="Register" action="{!createUser}" reRender="msgs" style="margin-left:40%"/>
</apex:pageBlock>
step 1: Here I selected one account from the list of all accounts then automatically populating related contacts.
step2 : From the list of contacts for suppose If I select a single contact how can I get that only one contact.
Here I completed the "step1" but I'm little confusing at "step 2" how to filter the selected contact only from
contacts list.
This is my apex class please check it once
apex class:
-------------
public with sharing class Picklist{
public String selectedAccId{get;set;}
public String selectedConId{get;set;}
List<System.SelectOption> conOptions{get;set;}
List<System.SelectOption> options{get;set;}
public Picklist(ApexPages.StandardController controller){
this.login1= (LightiningEd__Webinar__c)controller.getRecord();
}
public List<System.SelectOption> accOptions{get;set;}
public List<System.SelectOption> getAccountNames(){
List<System.SelectOption> accOptions= new List<System.SelectOption>();
accOptions.add( new System.SelectOption('','--Select--'));
for( Account acc : [select Id,name from Account] ){
accOptions.add( new System.SelectOption(String.valueOf(acc.Id),acc.name));
}
return accOptions;
}
public List<System.SelectOption> getContactNames(){
System.debug('Selected account id...........'+selectedAccId );
List<System.SelectOption> conOptions= new List<System.SelectOption>();
if(selectedAccId != null){
for(contact con : [select Id,name,Account.Name,accountid,FirstName,LastName,email,MobilePhone,MailingCity,MailingState,MailingCountry
from contact where accountid=:selectedAccId ]){
conOptions.add(new System.SelectOption(String.valueOf(con.Id),con.name));
System.debug('conOptions:::'+conOptions);System.debug('Entered Selected contact id...........'+selectedConId);
}
}return conOptions;
}
}
Thanks In Advance
Basha
- basha sk
- February 12, 2018
- Like
- 0
how to display standard object records into two sections based on field sepeartion?
Hi Everyone,
I have a custon object called Test__c.I'm trying to display Test__c object records into two sections
in a visualforce based on a field sepeartion.but how to read the fields from cotroller extension.
vf page
-------
<apex:page standardController="Test__c" extensions="DivedeRecordsList" recordSetVar="test" >
<apex:sectionHeader title="Test Records List" />
<apex:form >
<apex:pageBlock Title="Test Records completed">
<apex:pageBlockTable value="{!test}" var="w" >
<apex:column value="{!w.first}" />
<apex:column value="{!w.Second}" />
<apex:column value="{!w.third}" />
<apex:column value="{!w.Expired__c}" />
</apex:pageBlockTable>
</apex:pageBlock>
<apex:pageBlock Title="New Test Records">
<apex:pageBlockTable value="{!test}" var="w" >
<apex:column value="{!w.first}" />
<apex:column value="{!w.Second}" />
<apex:column value="{!w.third}" />
<apex:column value="{!w.Expired__c}" />
</apex:pageBlock>
</apex:form>
</apex:page>
Apex class
-----------
public class DivedeRecordsList {
public Test__c testrecords{get;set;}
List<Test__c> lst{get;set;}
List<Test__c> lst1{get;set;}
public DivedeWebinarsList(ApexPages.StandardController controller){
testrecords = (Test__c)controller.getRecord();
}
public List<Test__c> upcomingRecords(){
List<Test__c> lst = [select id,Name,first,second,third from Test__c where Expired__c = 'false'];
return lst;
}
public List<Test__c> completedRecords(){
List<Test__c> lst = [select id,Name,first,second,third from Test__c where Expired__c = 'true'];
return lst;
}
}
Thanks In advance
Sekhar
I have a custon object called Test__c.I'm trying to display Test__c object records into two sections
in a visualforce based on a field sepeartion.but how to read the fields from cotroller extension.
vf page
-------
<apex:page standardController="Test__c" extensions="DivedeRecordsList" recordSetVar="test" >
<apex:sectionHeader title="Test Records List" />
<apex:form >
<apex:pageBlock Title="Test Records completed">
<apex:pageBlockTable value="{!test}" var="w" >
<apex:column value="{!w.first}" />
<apex:column value="{!w.Second}" />
<apex:column value="{!w.third}" />
<apex:column value="{!w.Expired__c}" />
</apex:pageBlockTable>
</apex:pageBlock>
<apex:pageBlock Title="New Test Records">
<apex:pageBlockTable value="{!test}" var="w" >
<apex:column value="{!w.first}" />
<apex:column value="{!w.Second}" />
<apex:column value="{!w.third}" />
<apex:column value="{!w.Expired__c}" />
</apex:pageBlock>
</apex:form>
</apex:page>
Apex class
-----------
public class DivedeRecordsList {
public Test__c testrecords{get;set;}
List<Test__c> lst{get;set;}
List<Test__c> lst1{get;set;}
public DivedeWebinarsList(ApexPages.StandardController controller){
testrecords = (Test__c)controller.getRecord();
}
public List<Test__c> upcomingRecords(){
List<Test__c> lst = [select id,Name,first,second,third from Test__c where Expired__c = 'false'];
return lst;
}
public List<Test__c> completedRecords(){
List<Test__c> lst = [select id,Name,first,second,third from Test__c where Expired__c = 'true'];
return lst;
}
}
Thanks In advance
Sekhar
- basha sk
- February 12, 2018
- Like
- 0
How to login to adobeconnect through Iframes in Salesforce
Hi Everyone,
I'm trying to open the adobe connect home page from salesforce.For that I have developed REST api.
when I click the button from visualforce page it sends call to adobeconnect.I checked in debug logs
I got the status code 200.Call is working successfully but here after clicking the button I wanted to
direct home page of adobe connect but it displays adobe connect login page.
Button page
-----------
<apex:page standardController="Webinar__c" extensions="CreateAdobeWebinar" sidebar="false" >
<apex:pageBlock title="Adobe Connect Webinars List" >
<apex:form >
<center>
<apex:commandButton value="Create a Webinar" action="{!processButtonClick}"/>
</center>
</apex:form >
</apex:pageBlock>
<apex:page>
Apex class :
-------------
public class CreateAdobeWebinar {
public PageReference processButtonClick() {
LightiningEd__Login_Access__c lst1 = [select id,Name,LightiningEd__username__c,LightiningEd__password__c,LightiningEd__url__c
,LightiningEd__Cookie__c from LightiningEd__Login_Access__c limit 1];
CreateWebinar.postfieldsFuture(username,password,url,accesstoken);
PageReference pageref = new PageReference('/apex/AdobeIframe');
return pageref;
}
REST API
---------
global class CreateWebinar{
global static void postfieldsFuture(String username, String password,String url,String accesstoken) {
getParticipants(username, password, url,accesstoken);
}
@future (callout=true)
global static void getParticipants(String username, String password,String url,String accesstoken){
Http http = new Http();
HttpRequest req = new HttpRequest();
HttpResponse res = new HttpResponse();
Blob headerValue = Blob.valueOf(username + ':' + password);
String authorizationHeader = 'BASIC ' +
EncodingUtil.base64Encode(headerValue);
req.setHeader('Authorization', authorizationHeader);
req.setEndpoint(url+'/api/xml?action=login&login='+username+'&password='+password+'&session='+accesstoken);
req.setMethod('GET');
req.setHeader('Content-Type', 'application/json');
req.setHeader('Accept','application/json');
try {
res = http.send(req);
System.debug('MyResult == :'+res.getBody());
}catch(System.CalloutException e){
System.debug('Callout error: '+ e);
}
}
}
Redirect page :
----------------
Here in this I want to display the direct home page of adobe connect.but here it displays adobe connect login page .
<apex:page standardController="Webinar__c" tabstyle="Webinar_Room__tab" sidebar="false" extensions="CreateAdobeWebinar,RedirectPage">
<apex:form >
<center>
<apex:commandButton value="Goback" action="{!goBackPage3}"/>
</center><br/><br/>
<apex:pageBlock title="Create Adobe Webinar within Salesforce">
</apex:pageBlock>
</apex:form>
<apex:iframe height="800" width="1230" src="https://meet30705009.adobeconnect.com/" scrolling="true"/>
</apex:page>
Please check it once if anybody having idea let me know
Thanks in advance,
Basha
I'm trying to open the adobe connect home page from salesforce.For that I have developed REST api.
when I click the button from visualforce page it sends call to adobeconnect.I checked in debug logs
I got the status code 200.Call is working successfully but here after clicking the button I wanted to
direct home page of adobe connect but it displays adobe connect login page.
Button page
-----------
<apex:page standardController="Webinar__c" extensions="CreateAdobeWebinar" sidebar="false" >
<apex:pageBlock title="Adobe Connect Webinars List" >
<apex:form >
<center>
<apex:commandButton value="Create a Webinar" action="{!processButtonClick}"/>
</center>
</apex:form >
</apex:pageBlock>
<apex:page>
Apex class :
-------------
public class CreateAdobeWebinar {
public PageReference processButtonClick() {
LightiningEd__Login_Access__c lst1 = [select id,Name,LightiningEd__username__c,LightiningEd__password__c,LightiningEd__url__c
,LightiningEd__Cookie__c from LightiningEd__Login_Access__c limit 1];
CreateWebinar.postfieldsFuture(username,password,url,accesstoken);
PageReference pageref = new PageReference('/apex/AdobeIframe');
return pageref;
}
REST API
---------
global class CreateWebinar{
global static void postfieldsFuture(String username, String password,String url,String accesstoken) {
getParticipants(username, password, url,accesstoken);
}
@future (callout=true)
global static void getParticipants(String username, String password,String url,String accesstoken){
Http http = new Http();
HttpRequest req = new HttpRequest();
HttpResponse res = new HttpResponse();
Blob headerValue = Blob.valueOf(username + ':' + password);
String authorizationHeader = 'BASIC ' +
EncodingUtil.base64Encode(headerValue);
req.setHeader('Authorization', authorizationHeader);
req.setEndpoint(url+'/api/xml?action=login&login='+username+'&password='+password+'&session='+accesstoken);
req.setMethod('GET');
req.setHeader('Content-Type', 'application/json');
req.setHeader('Accept','application/json');
try {
res = http.send(req);
System.debug('MyResult == :'+res.getBody());
}catch(System.CalloutException e){
System.debug('Callout error: '+ e);
}
}
}
Redirect page :
----------------
Here in this I want to display the direct home page of adobe connect.but here it displays adobe connect login page .
<apex:page standardController="Webinar__c" tabstyle="Webinar_Room__tab" sidebar="false" extensions="CreateAdobeWebinar,RedirectPage">
<apex:form >
<center>
<apex:commandButton value="Goback" action="{!goBackPage3}"/>
</center><br/><br/>
<apex:pageBlock title="Create Adobe Webinar within Salesforce">
</apex:pageBlock>
</apex:form>
<apex:iframe height="800" width="1230" src="https://meet30705009.adobeconnect.com/" scrolling="true"/>
</apex:page>
Please check it once if anybody having idea let me know
Thanks in advance,
Basha
- basha sk
- February 08, 2018
- Like
- 0
How to read the fields from extension into visualforce page like input fields ?
Hi Everyone,
I'm trying to read the fields from extension method called " getPTs() " into visualforce page
but i'm confusing here.I know by using the datatable to access the fields but in that fields are in columns.
i don't want like that.I need to display the fields as input fields for enterig the input.
Note : read the fields like input fields because for entering the input value.
vf page :
----------
<apex:page standardController="Webinar__c" tabstyle="Adobe_Webinars__tab" extensions="AdobeLatestRegistrationForm" sidebar="false">
<apex:form>
<apex:pageBlock Title="Adobe Registration Form">
<apex:pageBlockSection>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>
apex class
-------------
global class AdobeLatestRegistrationForm{
private LightiningEd__Webinar__c MI;
private List<LightiningEd__Webinar_Attendees_Status__c> PTs;
public List<LightiningEd__Webinar__c> we{get;set;}
public AdobeLatestRegistrationForm(ApexPages.StandardController controller){
this.MI= (LightiningEd__Webinar__c)controller.getRecord();
}
public List<LightiningEd__Webinar_Attendees_Status__c> getPTs(){
PTs = [SELECT id,Name, LightiningEd__First_Name__c,LightiningEd__Last_Name__c,LightiningEd__Login__c,
LightiningEd__Register_Password__c,LightiningEd__Conform_Password__c,LightiningEd__Company_Name__c,LightiningEd__City__c,
LightiningEd__State__c,LightiningEd__Country__c,LightiningEd__Mobile_Phone__c
FROM LightiningEd__Webinar_Attendees_Status__c where LightiningEd__Webinar__c = :ApexPages.currentPage().getParameters().get('id')];
return PTs;
}
}
- basha sk
- February 07, 2018
- Like
- 0
How to redirect to the previous visualforce page from current visualforce page (like back button)?
How to redirect previous visualforce page from current visualforce page?
Hi Everyone,
First of all here i'm having two visualforce pages
1.Webinar_Details Page
2.MappingLeadPage
webinar_details page is a record details page it displays all the details of one particular record.
In this page i'm having a button calles "Mapping Lead" by clicking the button it redirects to the
"MappingLeadPage" visualforce page.after mapping the fields i'm saving the mapping and redirects to the previous record
details page.
here for redirecting i need the previous record id.how can i get the previous record id for redirecting
Webinar_Details Page
--------------------
<apex:page standardController="Webinar__c" tabstyle="Adobe_Webinars__tab" sidebar="false" extensions="RedirectPage">
<apex:form >
<apex:pageBlock title="Adobe Connect Integration with Salesforce">
<center>
<apex:commandButton value="Register" action="{!doRegistrationForm}"/>
</center><br/><br/>
<apex:pageBlockSection title="{!Webinar__c.Name} Details">
<apex:outputField value="{!Webinar__c.Name}"/>
<apex:inlineEditSupport event="ondblClick" /><br/>
</apex:pageBlockSection><br/>
</apex:pageBlock>
<apex:pageBlock >
<apex:pageBlockTable value="{!wrapperAccountList}" var="w" id="table" title="All Accounts">
<apex:column value="{!w.acc.Login__c}"></apex:column>
<apex:inlineEditSupport event="ondblClick" />
<apex:column value="{!w.acc.isLead__c}"></apex:column>
</apex:pageBlockTable>
</apex:pageBlock>
<center>
<apex:commandButton id="leadcreate1" value="Lead Mapping" action="{!doMappingPage}"/>
</center><br/>
</apex:pageBlock>
</apex:form>
</apex:page>
extension:
-----------
public class RedirectPage{
public PageReference doMappingPage(){
PageReference parentPage = new PageReference('/apex/MappingLeadPage');
parentPage.setRedirect(true);
return parentPage;
}
}
MappingLeadPage
----------------
<apex:page standardController="Lead" extensions="MappingLead1">
<apex:form >
<apex:pageBlock title="Lead Mapping" >
<apex:pageBlockSection >
<apex:pageBlock >
<apex:pageBlockSection >
Webinar Attendee Name <apex:inputField value="{!Lead.LeadFields__c}"/><br/>
Webinar Attendee Email <apex:inputField value="{!Lead.Lead_Fields1__c}"/><br/>
Webinar Attendee Company <apex:inputField value="{!Lead.Lead_Fields2__c}"/><br/>
Webinar Attende Mobile Number <apex:inputField value="{!Lead.Lead_Fields7__c}"/><br/><br/>
<!-- <apex:outputLink value="{!URLFOR($Page.Webinar_Details,w.acc.Id,[id=w.acc.Id])}">{!w.acc.name}</apex:outputLink> -->
</apex:pageBlockSection>
<apex:commandButton id="saveBtn" value="Save Mapping" action="{!processButtonClick}" style="margin-left:-2%"/>
<apex:commandButton id="saveBtn1" value="Previous Page" action="{!goBack}" style="margin-left:30%"/>
<apex:pageBlockButtons >
</apex:pageBlockButtons>
</apex:pageBlock>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>
extension
------------
public with sharing class MappingLead1 {
public Lead login;
private final ApexPages.StandardController controller;
public MappingLead1(ApexPages.StandardController controller){
this.login= (Lead)controller.getRecord();
}
public PageReference goBack(){
PageReference pg = new PageReference('/apex/Webinar_Details');
pg.setRedirect(true);
return pg;
}
}
from the MappingLeadPage page by clicking the "Previous Page" button how i redirected to the Webinar_Details Page vf page.
Please anybody help i'm trying this logic from yesterday
Thanks In Advance
Hi Everyone,
First of all here i'm having two visualforce pages
1.Webinar_Details Page
2.MappingLeadPage
webinar_details page is a record details page it displays all the details of one particular record.
In this page i'm having a button calles "Mapping Lead" by clicking the button it redirects to the
"MappingLeadPage" visualforce page.after mapping the fields i'm saving the mapping and redirects to the previous record
details page.
here for redirecting i need the previous record id.how can i get the previous record id for redirecting
Webinar_Details Page
--------------------
<apex:page standardController="Webinar__c" tabstyle="Adobe_Webinars__tab" sidebar="false" extensions="RedirectPage">
<apex:form >
<apex:pageBlock title="Adobe Connect Integration with Salesforce">
<center>
<apex:commandButton value="Register" action="{!doRegistrationForm}"/>
</center><br/><br/>
<apex:pageBlockSection title="{!Webinar__c.Name} Details">
<apex:outputField value="{!Webinar__c.Name}"/>
<apex:inlineEditSupport event="ondblClick" /><br/>
</apex:pageBlockSection><br/>
</apex:pageBlock>
<apex:pageBlock >
<apex:pageBlockTable value="{!wrapperAccountList}" var="w" id="table" title="All Accounts">
<apex:column value="{!w.acc.Login__c}"></apex:column>
<apex:inlineEditSupport event="ondblClick" />
<apex:column value="{!w.acc.isLead__c}"></apex:column>
</apex:pageBlockTable>
</apex:pageBlock>
<center>
<apex:commandButton id="leadcreate1" value="Lead Mapping" action="{!doMappingPage}"/>
</center><br/>
</apex:pageBlock>
</apex:form>
</apex:page>
extension:
-----------
public class RedirectPage{
public PageReference doMappingPage(){
PageReference parentPage = new PageReference('/apex/MappingLeadPage');
parentPage.setRedirect(true);
return parentPage;
}
}
MappingLeadPage
----------------
<apex:page standardController="Lead" extensions="MappingLead1">
<apex:form >
<apex:pageBlock title="Lead Mapping" >
<apex:pageBlockSection >
<apex:pageBlock >
<apex:pageBlockSection >
Webinar Attendee Name <apex:inputField value="{!Lead.LeadFields__c}"/><br/>
Webinar Attendee Email <apex:inputField value="{!Lead.Lead_Fields1__c}"/><br/>
Webinar Attendee Company <apex:inputField value="{!Lead.Lead_Fields2__c}"/><br/>
Webinar Attende Mobile Number <apex:inputField value="{!Lead.Lead_Fields7__c}"/><br/><br/>
<!-- <apex:outputLink value="{!URLFOR($Page.Webinar_Details,w.acc.Id,[id=w.acc.Id])}">{!w.acc.name}</apex:outputLink> -->
</apex:pageBlockSection>
<apex:commandButton id="saveBtn" value="Save Mapping" action="{!processButtonClick}" style="margin-left:-2%"/>
<apex:commandButton id="saveBtn1" value="Previous Page" action="{!goBack}" style="margin-left:30%"/>
<apex:pageBlockButtons >
</apex:pageBlockButtons>
</apex:pageBlock>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>
extension
------------
public with sharing class MappingLead1 {
public Lead login;
private final ApexPages.StandardController controller;
public MappingLead1(ApexPages.StandardController controller){
this.login= (Lead)controller.getRecord();
}
public PageReference goBack(){
PageReference pg = new PageReference('/apex/Webinar_Details');
pg.setRedirect(true);
return pg;
}
}
from the MappingLeadPage page by clicking the "Previous Page" button how i redirected to the Webinar_Details Page vf page.
Please anybody help i'm trying this logic from yesterday
Thanks In Advance
- basha sk
- February 06, 2018
- Like
- 0
parse the xml data and insert the data in to salesfofce?
Hi All,
I'm trying to parse the xml response and insert the data into sObject but the data doesn't inserting to salesforce .
//Actual REsponse response :
XML Response:::<?xml version="1.0" encoding="utf-8"?><results><status code="ok"/><OWASP_CSRF_TOKEN><token>2c488c4b05a987fe174d54a12b6cd8bf3705802bfafd0beb2feded0b68b8e8c8</token></OWASP_CSRF_TOKEN><common locale="en" time-zone-id="85" time-zone-java-id="UTC"><cookie>apac1breezx8x68fmfzh3dczk7</cookie><date>2018-02-06T06:18:32.003+00:00</date><host>https://meet30705009.adobeconnect.com</host><local-host>pacapac1app05</local-host><admin-host>apac1cps.adobeconnect.com</admin-host><url>/api/xml?action=common-info</url><version>9.7.0</version><tos-version>9.5</tos-version><product-notification>true</product-notification><account account-id="1309160790"/><user-agent>SFDC-Callout/41.0</user-agent><mobile-app-package>air.com.adobe.connectpro</mobile-app-package></common><reg-user><is-reg-user>false</is-reg-user></reg-user></results>
customized response :
------------------------------
XML Response:::<?xml version="1.0" encoding="utf-8"?><common locale="en" time-zone-id="85" time-zone-java-id="UTC"><cookie>apac1breezx8x68fmfzh3dczk7</cookie><date>2018-02-06T06:18:32.003+00:00</date><host>https://meet30705009.adobeconnect.com</host><local-host>pacapac1app05</local-host><admin-host>apac1cps.adobeconnect.com</admin-host><url>/api/xml?action=common-info</url><version>9.7.0</version><tos-version>9.5</tos-version><product-notification>true</product-notification><account account-id="1309160790"/><user-agent>SFDC-Callout/41.0</user-agent><mobile-app-package>air.com.adobe.connectpro</mobile-app-package></common>
In the below apex class if i'm passing the customized response the data inserts in to salesforce but if i'm using actual response the data doesn't inserting into salesforce please check the below apex class once
apex class:
---------------------
global class XMLLoginAccess {
public string XMLString1 {get;set;}
private List<LightiningEd__Login_Access__c> logindetails{get;set;}
LightiningEd__Login_Access__c adobelogin;
List<String> id1 = new List<String>();
public XMLLoginAccess(){
System.debug('XML Response:::'+XMLString1);
DOM.Document doc =new DOM.Document();
try{
doc.load(XMLString1);
DOM.XmlNode rootNode = doc.getRootElement();
parseXML(rootNode);
logindetails.add(adobelogin);
upsert logindetails;
System.debug('List of Events'+logindetails);
}catch(exception e){
system.debug(e.getMessage());
}
}
private List<LightiningEd__Login_Access__c> parseXML(DOM.XMLNode node){
if (node.getNodeType() == DOM.XMLNodeType.ELEMENT){
if(node.getName()=='common'){
logindetails.add(adobelogin);
adobelogin = new LightiningEd__Login_Access__c();
}
adobelogin.name='Test';
if(node.getName()=='cookie')
adobelogin.LightiningEd__Cookie__c = node.getText().trim();
System.debug('Cookie Value:::'+adobelogin.LightiningEd__Cookie__c);
if(node.getName()=='host')
adobelogin.LightiningEd__Host__c = node.getText().trim();
System.debug('Host Value:::'+adobelogin.LightiningEd__Host__c);
if(node.getName()=='version')
adobelogin.LightiningEd__Version__c = node.getText().trim();
System.debug('Version Value:::'+adobelogin.LightiningEd__Version__c);
}
for(Dom.XMLNode child: node.getChildElements()){
parseXML(child);
}
return logindetails;
}
public List<LightiningEd__Login_Access__c> getEventsList(){
return logindetails;
}
}
Thanks In advance
I'm trying to parse the xml response and insert the data into sObject but the data doesn't inserting to salesforce .
//Actual REsponse response :
XML Response:::<?xml version="1.0" encoding="utf-8"?><results><status code="ok"/><OWASP_CSRF_TOKEN><token>2c488c4b05a987fe174d54a12b6cd8bf3705802bfafd0beb2feded0b68b8e8c8</token></OWASP_CSRF_TOKEN><common locale="en" time-zone-id="85" time-zone-java-id="UTC"><cookie>apac1breezx8x68fmfzh3dczk7</cookie><date>2018-02-06T06:18:32.003+00:00</date><host>https://meet30705009.adobeconnect.com</host><local-host>pacapac1app05</local-host><admin-host>apac1cps.adobeconnect.com</admin-host><url>/api/xml?action=common-info</url><version>9.7.0</version><tos-version>9.5</tos-version><product-notification>true</product-notification><account account-id="1309160790"/><user-agent>SFDC-Callout/41.0</user-agent><mobile-app-package>air.com.adobe.connectpro</mobile-app-package></common><reg-user><is-reg-user>false</is-reg-user></reg-user></results>
customized response :
------------------------------
XML Response:::<?xml version="1.0" encoding="utf-8"?><common locale="en" time-zone-id="85" time-zone-java-id="UTC"><cookie>apac1breezx8x68fmfzh3dczk7</cookie><date>2018-02-06T06:18:32.003+00:00</date><host>https://meet30705009.adobeconnect.com</host><local-host>pacapac1app05</local-host><admin-host>apac1cps.adobeconnect.com</admin-host><url>/api/xml?action=common-info</url><version>9.7.0</version><tos-version>9.5</tos-version><product-notification>true</product-notification><account account-id="1309160790"/><user-agent>SFDC-Callout/41.0</user-agent><mobile-app-package>air.com.adobe.connectpro</mobile-app-package></common>
In the below apex class if i'm passing the customized response the data inserts in to salesforce but if i'm using actual response the data doesn't inserting into salesforce please check the below apex class once
apex class:
---------------------
global class XMLLoginAccess {
public string XMLString1 {get;set;}
private List<LightiningEd__Login_Access__c> logindetails{get;set;}
LightiningEd__Login_Access__c adobelogin;
List<String> id1 = new List<String>();
public XMLLoginAccess(){
System.debug('XML Response:::'+XMLString1);
DOM.Document doc =new DOM.Document();
try{
doc.load(XMLString1);
DOM.XmlNode rootNode = doc.getRootElement();
parseXML(rootNode);
logindetails.add(adobelogin);
upsert logindetails;
System.debug('List of Events'+logindetails);
}catch(exception e){
system.debug(e.getMessage());
}
}
private List<LightiningEd__Login_Access__c> parseXML(DOM.XMLNode node){
if (node.getNodeType() == DOM.XMLNodeType.ELEMENT){
if(node.getName()=='common'){
logindetails.add(adobelogin);
adobelogin = new LightiningEd__Login_Access__c();
}
adobelogin.name='Test';
if(node.getName()=='cookie')
adobelogin.LightiningEd__Cookie__c = node.getText().trim();
System.debug('Cookie Value:::'+adobelogin.LightiningEd__Cookie__c);
if(node.getName()=='host')
adobelogin.LightiningEd__Host__c = node.getText().trim();
System.debug('Host Value:::'+adobelogin.LightiningEd__Host__c);
if(node.getName()=='version')
adobelogin.LightiningEd__Version__c = node.getText().trim();
System.debug('Version Value:::'+adobelogin.LightiningEd__Version__c);
}
for(Dom.XMLNode child: node.getChildElements()){
parseXML(child);
}
return logindetails;
}
public List<LightiningEd__Login_Access__c> getEventsList(){
return logindetails;
}
}
Thanks In advance
- basha sk
- February 06, 2018
- Like
- 0
Contact picklist doesn't updated based on particular account selection?
Hi All,
I'm trying to display all contacts related to a particular account.
for that i have developed below apex class.It displays all salesforce accounts but if i select any account related contacts doesn't display please check my visualforce page and apex class.
VF Page :
-------------
apex:page standardController="Webinar_Attendees_Status__c" extensions="Picklist" action="{!getAccountsWithContacts}">
<apex:form >
<apex:pageBlock title="Registration Form">
Account Names
<apex:selectList value="{!selectedAccId}" size="1">
<apex:selectOptions value="{!accOptions}"/>
<apex:actionSupport event="onchange" reRender="a"/>
</apex:selectList>
<br/><br/> Related Contacts
<apex:actionFunction name="DoFilter" action="{!ContactsByAccountId}" rerender="out" status="loading">
<apex:param assignTo="{!pAccountId}" value="" name="letterowner"/>
</apex:actionFunction>
<apex:pageBlockSection >
<apex:commandButton value="Register" action="{!populateContactDetails}" reRender="msgs" style="margin-left:50%"/>
<apex:pageMessages id="msgs"/> </center> </apex:pageBlockSection> </apex:pageBlock> </apex:form> </apex:page>
Apex class:
----------------
public with sharing class Picklist{
public Map<Id, Account> accountIdRecordMap {get; set;}
public LightiningEd__Webinar_Attendees_Status__c login1 {get; set;}
public List<System.SelectOption> accOptions{get;set;}
public Id selectedAccId {get; set;}
public Id pAccountId{get;set;}
public List<System.SelectOption> conOptions{get;set;}
public Id selectedContactId {get; set;}
public Contact selectedContact {get; set;}
public Lead customObjInstance {get; set;}
//Constructor
public Picklist(ApexPages.StandardController controller){
this.login1 = (LightiningEd__Webinar_Attendees_Status__c)controller.getRecord();
init();
}
//Retrieve most recent 500 Accounts and associated Contacts
public void getAccountsWithContacts(){
if(this.accountIdRecordMap == null){
this.accountIdRecordMap = new Map<Id, Account>([Select Id, Name,(Select Id,name,accountid,LastName,email,MobilePhone,MailingCity,MailingState,MailingCountry From Account.Contacts )From Account]);
}
this.getAccountNames();
//this.getContactsByAccountId();
}
//Populate account picklist options
public void getAccountNames(){
if(this.accOptions.size() == 0){
this.accOptions.add(new System.SelectOption('' , '--Select--'));
for(Id accRecId :accountIdRecordMap.keySet()){
this.accOptions.add(
new System.SelectOption(
accRecId,
accountIdRecordMap.get(accRecId).Name
)
);
}//for
}
}
//Populate related Contact picklist options
public void getContactsByAccountId(Id pAccountId){
this.conOptions.add(new System.SelectOption('' , '--Select--'));
if(accountIdRecordMap.containsKey(pAccountId)){
for(Contact contactRec :((Account)accountIdRecordMap.get(pAccountId)).Contacts){
this.conOptions.add(
new System.SelectOption(
contactRec.Id,
contactRec.Name
)
);
}//for
}
}
//Retrieves the selectedContact Record information based on the selected Account Id
public void getSelectedContact(){
if(accountIdRecordMap.containsKey(pAccountId)){
for(Contact contactRec :((Account)accountIdRecordMap.get(pAccountId)).Contacts){
if(contactRec.Id == selectedContactId){
this.selectedContact = contactRec;
}
}
}//if
}
//Assumes selectedContact is populated with the Contact record information
public void populateContactDetails(){
if(this.selectedContact <> null){
firstname = this.selectedContact.FirstName;
lastname = this.selectedContact.LastName;
email = this.selectedContact.Email;
mobileno = this.selectedContact.MobilePhone;
mailingcity = this.selectedContact.MailingCity;
LeadExportToAdobe.exportLead(firstname,lastname,email,login1.LightiningEd__Register_Password__c,login1.LightiningEd__Conform_Password__c,company,mailingcity,mailingstate,mailingcountry,mobileno);
}
}
//Private Methods
private void init(){
accOptions = new List<System.SelectOption>();
conOptions = new List<System.SelectOption>();
}
}
Thanks,
I'm trying to display all contacts related to a particular account.
for that i have developed below apex class.It displays all salesforce accounts but if i select any account related contacts doesn't display please check my visualforce page and apex class.
VF Page :
-------------
apex:page standardController="Webinar_Attendees_Status__c" extensions="Picklist" action="{!getAccountsWithContacts}">
<apex:form >
<apex:pageBlock title="Registration Form">
Account Names
<apex:selectList value="{!selectedAccId}" size="1">
<apex:selectOptions value="{!accOptions}"/>
<apex:actionSupport event="onchange" reRender="a"/>
</apex:selectList>
<br/><br/> Related Contacts
<apex:actionFunction name="DoFilter" action="{!ContactsByAccountId}" rerender="out" status="loading">
<apex:param assignTo="{!pAccountId}" value="" name="letterowner"/>
</apex:actionFunction>
<apex:pageBlockSection >
<apex:commandButton value="Register" action="{!populateContactDetails}" reRender="msgs" style="margin-left:50%"/>
<apex:pageMessages id="msgs"/> </center> </apex:pageBlockSection> </apex:pageBlock> </apex:form> </apex:page>
Apex class:
----------------
public with sharing class Picklist{
public Map<Id, Account> accountIdRecordMap {get; set;}
public LightiningEd__Webinar_Attendees_Status__c login1 {get; set;}
public List<System.SelectOption> accOptions{get;set;}
public Id selectedAccId {get; set;}
public Id pAccountId{get;set;}
public List<System.SelectOption> conOptions{get;set;}
public Id selectedContactId {get; set;}
public Contact selectedContact {get; set;}
public Lead customObjInstance {get; set;}
//Constructor
public Picklist(ApexPages.StandardController controller){
this.login1 = (LightiningEd__Webinar_Attendees_Status__c)controller.getRecord();
init();
}
//Retrieve most recent 500 Accounts and associated Contacts
public void getAccountsWithContacts(){
if(this.accountIdRecordMap == null){
this.accountIdRecordMap = new Map<Id, Account>([Select Id, Name,(Select Id,name,accountid,LastName,email,MobilePhone,MailingCity,MailingState,MailingCountry From Account.Contacts )From Account]);
}
this.getAccountNames();
//this.getContactsByAccountId();
}
//Populate account picklist options
public void getAccountNames(){
if(this.accOptions.size() == 0){
this.accOptions.add(new System.SelectOption('' , '--Select--'));
for(Id accRecId :accountIdRecordMap.keySet()){
this.accOptions.add(
new System.SelectOption(
accRecId,
accountIdRecordMap.get(accRecId).Name
)
);
}//for
}
}
//Populate related Contact picklist options
public void getContactsByAccountId(Id pAccountId){
this.conOptions.add(new System.SelectOption('' , '--Select--'));
if(accountIdRecordMap.containsKey(pAccountId)){
for(Contact contactRec :((Account)accountIdRecordMap.get(pAccountId)).Contacts){
this.conOptions.add(
new System.SelectOption(
contactRec.Id,
contactRec.Name
)
);
}//for
}
}
//Retrieves the selectedContact Record information based on the selected Account Id
public void getSelectedContact(){
if(accountIdRecordMap.containsKey(pAccountId)){
for(Contact contactRec :((Account)accountIdRecordMap.get(pAccountId)).Contacts){
if(contactRec.Id == selectedContactId){
this.selectedContact = contactRec;
}
}
}//if
}
//Assumes selectedContact is populated with the Contact record information
public void populateContactDetails(){
if(this.selectedContact <> null){
firstname = this.selectedContact.FirstName;
lastname = this.selectedContact.LastName;
email = this.selectedContact.Email;
mobileno = this.selectedContact.MobilePhone;
mailingcity = this.selectedContact.MailingCity;
LeadExportToAdobe.exportLead(firstname,lastname,email,login1.LightiningEd__Register_Password__c,login1.LightiningEd__Conform_Password__c,company,mailingcity,mailingstate,mailingcountry,mobileno);
}
}
//Private Methods
private void init(){
accOptions = new List<System.SelectOption>();
conOptions = new List<System.SelectOption>();
}
}
Thanks,
- basha sk
- February 06, 2018
- Like
- 0
How to get selected value from selectOption values dropdown list
Here in visualforce page i have two selectoption dropdownlists.
Account list
Contacts list
In accounts list i'm displaing all salesforce accounts and based on the selected account I'm displaying the related contacts in Contacts list.
After getting the selected contact i'm mapping that contact details to the other custom object.
Req: How to filter the selected contact record from selectedOption list?
This is my apex class:
public with sharing class Picklist{
public String selectedAccId{get;set;}
public String selectedConId{get;set;}
public String selectedContactId{get;set;}
public String firstname;
public String lastname;
public String email;
public String company;
public String mailingcity;
public String mailingstate;
public String mailingcountry;
public String mobileno;
public Status__c login1;
List<System.SelectOption> conOptions{get;set;}
List<System.SelectOption> options{get;set;}
public Picklist(ApexPages.StandardController controller){
this.login1= (Status__c)controller.getRecord();
}
public List<System.SelectOption> accOptions{get;set;}
//getting all salesforce accounts
public List<System.SelectOption> getAccountNames(){
List<System.SelectOption> accOptions= new List<System.SelectOption>();
accOptions.add( new System.SelectOption('','--Select--'));
for( Account acc : [select Id,name from Account] ){
accOptions.add( new System.SelectOption(String.valueOf(acc.Id),acc.name));
} return accOptions;
} //displaying all related contacts based the selectd account record. public List<System.SelectOption> getContactNames(){
List<System.SelectOption> conOptions= new List<System.SelectOption>();
if(selectedAccId != null){
for(contact con : [select Id,name,accountid,FirstName,LastName,email,MobilePhone,MailingCity,MailingState,MailingCountry from contact where accountid=:selectedAccId ]){
conOptions.add(new System.SelectOption(String.valueOf(con.Id),con.name));
System.debug('conOptions:::'+conOptions);
}
}
return conOptions;
}
//how to get the contact record from conatcs list.
public Pagereference getSelectedContact(){
System.debug('Entered Selected contact id...........'+selectedConId );
List<System.SelectOption> options = new List<System.SelectOption>();
if(conOptions.size() > 0){
System.debug('SelectId::::'+selectedConId);
for(Contact con1 : [select Id, name, Account.Name, accountid, FirstName, LastName, email, MobilePhone, MailingCity, MailingState, MailingCountry from contact where id=:selectedConId]){
firstname = con1.FirstName;
System.debug('Entered ContactNames contact id...........'+firstname);
lastname= con1.LastName; System.debug('lastname:::'+lastname);
email = con1.Email;
System.debug('email:::'+email );
}
}
else{ conOptions.add( new System.SelectOption('--None--','--None--')); } return null; } }
Thanks in advancce if anybody having idea please let me know
- basha sk
- February 05, 2018
- Like
- 0
How to avoid duplicate Insertions ?
Map<String,String> Selected = new Map<String,String>();
Map<String,String> customvalues = new Map<String,String>();
List<String> lst = new List<String>();
for(String t: customvalues.keySet()){
String test= customvalues.get(t);
for(String s: Selected.keySet()){
String Sample= Selected.get(s);
//how to restrict duplicates here intering into this loop
if(test.equals(s)){ lst.add(Sample);
}
}
}
if(lst!=null){
for(Integer i=0;i<=lst.size();i++){
Lead le = new Lead();
le.LastName=lst[0];
le.Company = lst[1];
le.Status = lst[2];
le.LightiningEd__City__c = lst[3];
le.LightiningEd__State__c = lst[4];
le.LightiningEd__Country__c = lst[5];
LeadList.add(le);
} if(!LeadList.isEmpty()){
upsert LeadList;
}
Thanks I adavance,If anybody having idea please let me know.
Map<String,String> customvalues = new Map<String,String>();
List<String> lst = new List<String>();
for(String t: customvalues.keySet()){
String test= customvalues.get(t);
for(String s: Selected.keySet()){
String Sample= Selected.get(s);
//how to restrict duplicates here intering into this loop
if(test.equals(s)){ lst.add(Sample);
}
}
}
if(lst!=null){
for(Integer i=0;i<=lst.size();i++){
Lead le = new Lead();
le.LastName=lst[0];
le.Company = lst[1];
le.Status = lst[2];
le.LightiningEd__City__c = lst[3];
le.LightiningEd__State__c = lst[4];
le.LightiningEd__Country__c = lst[5];
LeadList.add(le);
} if(!LeadList.isEmpty()){
upsert LeadList;
}
Thanks I adavance,If anybody having idea please let me know.
- basha sk
- February 05, 2018
- Like
- 0
filter selected contact from contact dropdownlist?
Hi All,
First I'm reading the all the salesforce Accounts in a selectoption dropdownlist.
based on the account selection i'm displaying the related contacts in other dropdownlist.
From the multiple contacts i'm selecting one contact how can i read that particular contact from
all contacts.
problem : how to filter selected contact from contact dropdownlist.
This is apex class:
public with sharing class Account_Contact_Picklist{
public String selectedAccId{get;set;}
public String selectedConId{get;set;}
public String firstname;
public String lastname;
public String email;
public String company;
public String mailingcity;
public String mailingstate;
public String mailingcountry;
public String mobileno;
public LightiningEd__Webinar_Attendees_Status__c login1;
public Account_Contact_Picklist(ApexPages.StandardController controller){
this.login1= (LightiningEd__Webinar_Attendees_Status__c)controller.getRecord();
}
public List<System.SelectOption> accOptions{get;set;}
public List<System.SelectOption> getAccountNames() {
List<System.SelectOption> accOptions= new List<System.SelectOption>();
accOptions.add( new System.SelectOption('','--Select--'));
for( Account acc : [select Id,name from Account] ){
accOptions.add( new System.SelectOption(String.valueOf(acc.Id),acc.name));
}
return accOptions;
}
public List<System.SelectOption> getContactNames(){
System.debug('Entered ContactNames account id...........'+selectedAccId );
List<System.SelectOption> conOptions= new List<System.SelectOption>();
List<System.SelectOption> options = new List<System.SelectOption>();
if(selectedConId != null){
System.debug('Entered ContactNames contact id1...........'+selectedConId );
for(contact con : [select Id,name,accountid,FirstName,LastName,email,MobilePhone,MailingCity,MailingState,MailingCountry
from contact where accountid=:selectedAccId ]){
conOptions.add(new System.SelectOption(String.valueOf(con.Id),con.name));
System.debug('conOptions:::'+conOptions);
if(conOptions.size() > 0){
system.debug('TestLog');
System.debug('SelectId::::'+selectedConId);
for(Contact con1 : [select Id,name,Account.Name,accountid,FirstName,LastName,email,
MobilePhone,MailingCity,MailingState,MailingCountry from contact where id=:selectedConId]){
firstname = con1.FirstName;
System.debug('Entered ContactNames contact id...........'+firstname);
lastname= con1.LastName;
System.debug('lastname:::'+lastname);
email = con1.Email;
System.debug('email:::'+email );
company = con1.Account.Name;
System.debug('company:::'+company );
mailingcity = con1.MailingCity;
System.debug('mailingcity:::'+mailingcity );
mailingstate = con1.MailingState;
System.debug('mailingstate:::'+mailingstate );
mailingcountry = con1.MailingCountry;
System.debug('mailingcountry:::'+mailingcountry );
mobileno = con1.MobilePhone;
System.debug('mobileno:::'+mobileno );
}
}
}
}
else{
conOptions.add( new System.SelectOption('--None--','--None--'));
}
return conOptions;
}
}
Thanks In Advance
First I'm reading the all the salesforce Accounts in a selectoption dropdownlist.
based on the account selection i'm displaying the related contacts in other dropdownlist.
From the multiple contacts i'm selecting one contact how can i read that particular contact from
all contacts.
problem : how to filter selected contact from contact dropdownlist.
This is apex class:
public with sharing class Account_Contact_Picklist{
public String selectedAccId{get;set;}
public String selectedConId{get;set;}
public String firstname;
public String lastname;
public String email;
public String company;
public String mailingcity;
public String mailingstate;
public String mailingcountry;
public String mobileno;
public LightiningEd__Webinar_Attendees_Status__c login1;
public Account_Contact_Picklist(ApexPages.StandardController controller){
this.login1= (LightiningEd__Webinar_Attendees_Status__c)controller.getRecord();
}
public List<System.SelectOption> accOptions{get;set;}
public List<System.SelectOption> getAccountNames() {
List<System.SelectOption> accOptions= new List<System.SelectOption>();
accOptions.add( new System.SelectOption('','--Select--'));
for( Account acc : [select Id,name from Account] ){
accOptions.add( new System.SelectOption(String.valueOf(acc.Id),acc.name));
}
return accOptions;
}
public List<System.SelectOption> getContactNames(){
System.debug('Entered ContactNames account id...........'+selectedAccId );
List<System.SelectOption> conOptions= new List<System.SelectOption>();
List<System.SelectOption> options = new List<System.SelectOption>();
if(selectedConId != null){
System.debug('Entered ContactNames contact id1...........'+selectedConId );
for(contact con : [select Id,name,accountid,FirstName,LastName,email,MobilePhone,MailingCity,MailingState,MailingCountry
from contact where accountid=:selectedAccId ]){
conOptions.add(new System.SelectOption(String.valueOf(con.Id),con.name));
System.debug('conOptions:::'+conOptions);
if(conOptions.size() > 0){
system.debug('TestLog');
System.debug('SelectId::::'+selectedConId);
for(Contact con1 : [select Id,name,Account.Name,accountid,FirstName,LastName,email,
MobilePhone,MailingCity,MailingState,MailingCountry from contact where id=:selectedConId]){
firstname = con1.FirstName;
System.debug('Entered ContactNames contact id...........'+firstname);
lastname= con1.LastName;
System.debug('lastname:::'+lastname);
email = con1.Email;
System.debug('email:::'+email );
company = con1.Account.Name;
System.debug('company:::'+company );
mailingcity = con1.MailingCity;
System.debug('mailingcity:::'+mailingcity );
mailingstate = con1.MailingState;
System.debug('mailingstate:::'+mailingstate );
mailingcountry = con1.MailingCountry;
System.debug('mailingcountry:::'+mailingcountry );
mobileno = con1.MobilePhone;
System.debug('mobileno:::'+mobileno );
}
}
}
}
else{
conOptions.add( new System.SelectOption('--None--','--None--'));
}
return conOptions;
}
}
Thanks In Advance
- basha sk
- February 02, 2018
- Like
- 0
How to seperate the fields from respoonse and map with other object?
Hi Everyone,
I'm trying to map the response value to other object but i'm stucked at separeting the each value from response
if anybody having idea please let me know.
Map<String,String> test = new Map<String,String>();
Map<String,String> sample = new Map<String,String>();
List<String> orderList = new List<String>();
for(String t :sample.keySet()){
String tt = sample.get(t);
for(String s :test.keySet()){
String ss = test.get(s);
if(tt.equals(s)){
orderList.add(ss);
System.debug('OrderList:::'+orderList);
}
}
}
I got the orderList Response like below
Response : Kalyan K
Response : Kalyan K, Kalyank@tcs.com
Response : Kalyan K, Kalyank@tcs.com, Attended
Response : Kalyan K, Kalyank@tcs.com, Attended,Chennai
Response : Kalyan K, Kalyank@tcs.com, Attended, Chennai,Tamilnadu
Response : Kalyan K, Kalyank@tcs.com, Attended, Chennai, Tamilnadu, India
Response : Kalyan K, Kalyank@tcs.com, Attended, Chennai, Tamilnadu, India, 9857455552
how can i seperate the each value for assigining to the other object like below
Lead le = new Lead();
le.LastName = ss;// here map kalyan k
le.LightiningEd__AdobeEmail__c = ss; // here map Kalyank@tcs.com
le.Status = ss; //here map Attended
le.LightiningEd__City__c = ss; // here map Chennai
le.LightiningEd__State__c = ss; //here map Tamilnadu
le.LightiningEd__Country__c = ss; here map india
le.MobilePhone = ss; //here map 9857455552
LeadList.add(le);
Please anybody having idea share with me.
Regards,
- basha sk
- February 01, 2018
- Like
- 0
How to display SelectOptions in visualforce from extension?
Hi Everyone,
I'm trying to display SelectOptions dynamically in visualforce page.but it returns empty value.please anybody having idea let me know
here from visualforce page 1 i selected some records and trying to display those record field lables in SelectOption in vf page 2.
this is my apex class:
------------------------------------
public class CheckAllUsingJavascriptController {
public List<wrapAccount> wrapperAccountList {get; set;}
List<LightiningEd__Webinar_Attendees_Status__c> selectedContacts = new List<LightiningEd__Webinar_Attendees_Status__c>();
public String selectedCountry{get;set;}
List<Lead> LeadList = new List<Lead>();
List<System.SelectOption> countrieLst ;
public CheckAllUsingJavascriptController (Apexpages.StandardController stdcController){
countrieLst = new List<System.SelectOption>();
if(wrapperAccountList == null) {
wrapperAccountList = new List<wrapAccount>();
for(LightiningEd__Webinar__c a1: [select id,Name,Start_Time__c,Finish_Time__c,Registration_URL__c,Expired__c,SCO_ID__c,Retrival_Date__c,(select id,Name,principal_id__c,Login__c,isLead__c,Attandance_Status__c,Duration_Spend__c,Company_Name__c,City__c,State__c,Country__c,Mobile_Phone__c from LightiningEd__Webinar_Attendees_Statuss__r) from LightiningEd__Webinar__c where id = :ApexPages.currentPage().getParameters().get('Id')]) {
for(LightiningEd__Webinar_Attendees_Status__c a : a1.LightiningEd__Webinar_Attendees_Statuss__r){
wrapperAccountList.add(new wrapAccount(a));
}
}
}
}
public List<System.SelectOption> processSelected(){
countrieLst = new List<System.SelectOption>();
for(wrapAccount cCon: wrapperAccountList){
if(cCon.selected == true){
selectedContacts.add(cCon.acc);
}
}
for(LightiningEd__Webinar_Attendees_Status__c acc : selectedContacts){
system.debug('selected records::::'+acc);
countrieLst.add(new System.SelectOption(acc.Name,'Name'));
countrieLst.add(new System.SelectOption(acc.LightiningEd__Login__c,'Login'));
countrieLst.add(new System.SelectOption(acc.LightiningEd__Attandance_Status__c,'Attandance Status'));
countrieLst.add(new System.SelectOption(acc.LightiningEd__Company_Name__c,'Company Name'));
countrieLst.add(new System.SelectOption(acc.LightiningEd__City__c,'City'));
countrieLst.add(new System.SelectOption(acc.LightiningEd__State__c,'State'));
countrieLst.add(new System.SelectOption(acc.LightiningEd__Country__c,'Country'));
countrieLst.add(new System.SelectOption(acc.LightiningEd__Mobile_Phone__c,'Mobile Phone'));
}
return countrieLst;
}
public class wrapAccount {
public LightiningEd__Webinar_Attendees_Status__c acc {get; set;}
public Boolean selected {get; set;}
public wrapAccount(LightiningEd__Webinar_Attendees_Status__c a) {
acc = a;
selected = false;
}
}
public PageReference returnFields(){
PageReference parentPage = new PageReference('/apex/Webinar_User_Lead_Create');
parentPage.setRedirect(true);
return parentPage;
}
}
vf page:1
---------------------
<apex:page standardController="Webinar__c" tabstyle="Adobe_Webinars__tab" extensions="CheckAllUsingJavascriptController,UpdateWebinarsList,WebinarDetailsReport,RedirectPage" sidebar="false" >
<script type="text/javascript">
function selectAllCheckboxes(obj,InputID){
var inputCheckBox = document.getElementsByTagName("input");
for(var i=0; i<inputCheckBox.length; i++){
if(inputCheckBox[i].id.indexOf(InputID)!=-1){
inputCheckBox[i].checked = obj.checked;
}
}
}
</script>
<apex:form >
<apex:pageBlock title="Adobe Connect Integration with Salesforce">
<center>
<apex:commandButton value="Register" action="{!doRegistrationForm}"/>
</center><br/><br/>
<apex:pageBlockSection title="{!Webinar__c.Name} Details">
<apex:outputField value="{!Webinar__c.Name}"/>
</apex:pageBlockSection><br/>
<center>
<apex:commandButton id="saveBtn" value="Save" action="{!save}" />
<apex:commandButton id="cancelBtn" value="Cancel" action="{!cancel}" />
<apex:commandButton id="detleteBtn" value="Delete" action="{!delete}" />
</center><br/>
</apex:pageBlock>
<apex:pageBlock title="{!Webinar__c.Name} Webinar Attendees ">
<apex:commandButton action="{!getWebinarAttendees}" value="Update All" style="margin-left:40%"/>
<br/><br/>
<apex:pageBlockTable value="{!wrapperAccountList}" var="w" id="table" title="All Accounts">
<apex:column >
<apex:facet name="header">
<apex:inputCheckbox onclick="selectAllCheckboxes(this,'inputId')"/>
</apex:facet>
<apex:inputCheckbox value="{!w.selected}" id="inputId"/>
</apex:column>
<apex:column headerValue="Webinar Attendee Name">
<apex:outputLink value="{!URLFOR($Page.WebinarAttendeeDetails,w.acc.Id,[id=w.acc.Id])}">{!w.acc.name}</apex:outputLink>
</apex:column>
<apex:column value="{!w.acc.Login__c}"></apex:column>
<apex:inlineEditSupport event="ondblClick" />
<apex:column value="{!w.acc.isLead__c}"></apex:column>
<apex:inlineEditSupport event="ondblClick" />
<apex:column value="{!w.acc.Attandance_Status__c}"></apex:column>
<apex:inlineEditSupport event="ondblClick" />
<apex:column value="{!w.acc.Duration_Spend__c}"></apex:column>
<apex:inlineEditSupport event="ondblClick" />
<apex:inlineEditSupport event="ondblClick" />
<apex:column value="{!w.acc.Company_Name__c}"/>
<apex:inlineEditSupport event="ondblClick" />
<apex:column value="{!w.acc.City__c}"></apex:column>
<apex:inlineEditSupport event="ondblClick" />
<apex:column value="{!w.acc.State__c}"></apex:column>
<apex:inlineEditSupport event="ondblClick" />
<apex:column value="{!w.acc.Country__c}"/>
<apex:inlineEditSupport event="ondblClick" />
<apex:column value="{!w.acc.Mobile_Phone__c}"/>
<apex:inlineEditSupport event="ondblClick" />
</apex:pageBlockTable>
<apex:pageBlockButtons >
<apex:commandButton action="{!saveStatusChange}" value="Save"/>
<apex:commandButton id="cancelBtn1" value="Cancel" action="{!cancel}" />
<apex:commandButton id="detleteBtn1" value="Delete" action="{!delete}" />
<apex:commandButton id="leadcreate" value="Create Lead" action="{!createLead}"/>
<apex:commandButton value="Process Selected" action="{!returnFields}" rerender="table"/>
<!-- apex:commandButton value="Process Selected" action="{!returnFields}" rerender="table"/ -->
</apex:pageBlockButtons>
<apex:selectList size="1">
<apex:selectOptions value="{!countrieLst}"></apex:selectOptions>
</apex:selectList>
</apex:pageBlock>
</apex:form>
</apex:page>
vf page 2 :
----------------
<apex:page standardController="Webinar__c" extensions="CheckAllUsingJavascriptController" sidebar="false">
<apex:form >
<apex:pageBlock >
<apex:outputLabel > Countries : </apex:outputLabel>
<apex:selectList>
<apex:selectOptions value="{!countrieLst}"/>
</apex:selectList> <br/>
</apex:pageBlock>
</apex:form>
</apex:page>
vf page 2 displays empty list of values .
i'm successfullt adding all options to the list .i checked in debug logs but when trying to disply in vf pag e2 shows empty list.if anybody having idea please let me know
Thanks,
Basha
I'm trying to display SelectOptions dynamically in visualforce page.but it returns empty value.please anybody having idea let me know
here from visualforce page 1 i selected some records and trying to display those record field lables in SelectOption in vf page 2.
this is my apex class:
------------------------------------
public class CheckAllUsingJavascriptController {
public List<wrapAccount> wrapperAccountList {get; set;}
List<LightiningEd__Webinar_Attendees_Status__c> selectedContacts = new List<LightiningEd__Webinar_Attendees_Status__c>();
public String selectedCountry{get;set;}
List<Lead> LeadList = new List<Lead>();
List<System.SelectOption> countrieLst ;
public CheckAllUsingJavascriptController (Apexpages.StandardController stdcController){
countrieLst = new List<System.SelectOption>();
if(wrapperAccountList == null) {
wrapperAccountList = new List<wrapAccount>();
for(LightiningEd__Webinar__c a1: [select id,Name,Start_Time__c,Finish_Time__c,Registration_URL__c,Expired__c,SCO_ID__c,Retrival_Date__c,(select id,Name,principal_id__c,Login__c,isLead__c,Attandance_Status__c,Duration_Spend__c,Company_Name__c,City__c,State__c,Country__c,Mobile_Phone__c from LightiningEd__Webinar_Attendees_Statuss__r) from LightiningEd__Webinar__c where id = :ApexPages.currentPage().getParameters().get('Id')]) {
for(LightiningEd__Webinar_Attendees_Status__c a : a1.LightiningEd__Webinar_Attendees_Statuss__r){
wrapperAccountList.add(new wrapAccount(a));
}
}
}
}
public List<System.SelectOption> processSelected(){
countrieLst = new List<System.SelectOption>();
for(wrapAccount cCon: wrapperAccountList){
if(cCon.selected == true){
selectedContacts.add(cCon.acc);
}
}
for(LightiningEd__Webinar_Attendees_Status__c acc : selectedContacts){
system.debug('selected records::::'+acc);
countrieLst.add(new System.SelectOption(acc.Name,'Name'));
countrieLst.add(new System.SelectOption(acc.LightiningEd__Login__c,'Login'));
countrieLst.add(new System.SelectOption(acc.LightiningEd__Attandance_Status__c,'Attandance Status'));
countrieLst.add(new System.SelectOption(acc.LightiningEd__Company_Name__c,'Company Name'));
countrieLst.add(new System.SelectOption(acc.LightiningEd__City__c,'City'));
countrieLst.add(new System.SelectOption(acc.LightiningEd__State__c,'State'));
countrieLst.add(new System.SelectOption(acc.LightiningEd__Country__c,'Country'));
countrieLst.add(new System.SelectOption(acc.LightiningEd__Mobile_Phone__c,'Mobile Phone'));
}
return countrieLst;
}
public class wrapAccount {
public LightiningEd__Webinar_Attendees_Status__c acc {get; set;}
public Boolean selected {get; set;}
public wrapAccount(LightiningEd__Webinar_Attendees_Status__c a) {
acc = a;
selected = false;
}
}
public PageReference returnFields(){
PageReference parentPage = new PageReference('/apex/Webinar_User_Lead_Create');
parentPage.setRedirect(true);
return parentPage;
}
}
vf page:1
---------------------
<apex:page standardController="Webinar__c" tabstyle="Adobe_Webinars__tab" extensions="CheckAllUsingJavascriptController,UpdateWebinarsList,WebinarDetailsReport,RedirectPage" sidebar="false" >
<script type="text/javascript">
function selectAllCheckboxes(obj,InputID){
var inputCheckBox = document.getElementsByTagName("input");
for(var i=0; i<inputCheckBox.length; i++){
if(inputCheckBox[i].id.indexOf(InputID)!=-1){
inputCheckBox[i].checked = obj.checked;
}
}
}
</script>
<apex:form >
<apex:pageBlock title="Adobe Connect Integration with Salesforce">
<center>
<apex:commandButton value="Register" action="{!doRegistrationForm}"/>
</center><br/><br/>
<apex:pageBlockSection title="{!Webinar__c.Name} Details">
<apex:outputField value="{!Webinar__c.Name}"/>
</apex:pageBlockSection><br/>
<center>
<apex:commandButton id="saveBtn" value="Save" action="{!save}" />
<apex:commandButton id="cancelBtn" value="Cancel" action="{!cancel}" />
<apex:commandButton id="detleteBtn" value="Delete" action="{!delete}" />
</center><br/>
</apex:pageBlock>
<apex:pageBlock title="{!Webinar__c.Name} Webinar Attendees ">
<apex:commandButton action="{!getWebinarAttendees}" value="Update All" style="margin-left:40%"/>
<br/><br/>
<apex:pageBlockTable value="{!wrapperAccountList}" var="w" id="table" title="All Accounts">
<apex:column >
<apex:facet name="header">
<apex:inputCheckbox onclick="selectAllCheckboxes(this,'inputId')"/>
</apex:facet>
<apex:inputCheckbox value="{!w.selected}" id="inputId"/>
</apex:column>
<apex:column headerValue="Webinar Attendee Name">
<apex:outputLink value="{!URLFOR($Page.WebinarAttendeeDetails,w.acc.Id,[id=w.acc.Id])}">{!w.acc.name}</apex:outputLink>
</apex:column>
<apex:column value="{!w.acc.Login__c}"></apex:column>
<apex:inlineEditSupport event="ondblClick" />
<apex:column value="{!w.acc.isLead__c}"></apex:column>
<apex:inlineEditSupport event="ondblClick" />
<apex:column value="{!w.acc.Attandance_Status__c}"></apex:column>
<apex:inlineEditSupport event="ondblClick" />
<apex:column value="{!w.acc.Duration_Spend__c}"></apex:column>
<apex:inlineEditSupport event="ondblClick" />
<apex:inlineEditSupport event="ondblClick" />
<apex:column value="{!w.acc.Company_Name__c}"/>
<apex:inlineEditSupport event="ondblClick" />
<apex:column value="{!w.acc.City__c}"></apex:column>
<apex:inlineEditSupport event="ondblClick" />
<apex:column value="{!w.acc.State__c}"></apex:column>
<apex:inlineEditSupport event="ondblClick" />
<apex:column value="{!w.acc.Country__c}"/>
<apex:inlineEditSupport event="ondblClick" />
<apex:column value="{!w.acc.Mobile_Phone__c}"/>
<apex:inlineEditSupport event="ondblClick" />
</apex:pageBlockTable>
<apex:pageBlockButtons >
<apex:commandButton action="{!saveStatusChange}" value="Save"/>
<apex:commandButton id="cancelBtn1" value="Cancel" action="{!cancel}" />
<apex:commandButton id="detleteBtn1" value="Delete" action="{!delete}" />
<apex:commandButton id="leadcreate" value="Create Lead" action="{!createLead}"/>
<apex:commandButton value="Process Selected" action="{!returnFields}" rerender="table"/>
<!-- apex:commandButton value="Process Selected" action="{!returnFields}" rerender="table"/ -->
</apex:pageBlockButtons>
<apex:selectList size="1">
<apex:selectOptions value="{!countrieLst}"></apex:selectOptions>
</apex:selectList>
</apex:pageBlock>
</apex:form>
</apex:page>
vf page 2 :
----------------
<apex:page standardController="Webinar__c" extensions="CheckAllUsingJavascriptController" sidebar="false">
<apex:form >
<apex:pageBlock >
<apex:outputLabel > Countries : </apex:outputLabel>
<apex:selectList>
<apex:selectOptions value="{!countrieLst}"/>
</apex:selectList> <br/>
</apex:pageBlock>
</apex:form>
</apex:page>
vf page 2 displays empty list of values .
i'm successfullt adding all options to the list .i checked in debug logs but when trying to disply in vf pag e2 shows empty list.if anybody having idea please let me know
Thanks,
Basha
- basha sk
- January 24, 2018
- Like
- 0
How to maintain Session through apex REST API ?
Hi Everyone,
Apex class :
------------
here at endpoint for everytime i'm generating the session value and passing statically.
req.setEndpoint(url+'/api/xml?action=report-my-events&account-id=1309160790&&session=apac1breez6wnxuiam7asee4hw');
session=apac1breez6wnxuiam7asee4hw this value i'm passing statically for everytime.Instead of that how to maintain the session
through apex class.
global class AdobeConnectEvents{
@future (callout=true)
global static void getParticipants(String username, String password,String url){
Http http = new Http();
HttpRequest req = new HttpRequest();
HttpResponse res = new HttpResponse();
Blob headerValue = Blob.valueOf(username + ':' + password);
String authorizationHeader = 'BASIC ' +
EncodingUtil.base64Encode(headerValue);
req.setHeader('Authorization', authorizationHeader);
req.setEndpoint(url+'/api/xml?action=report-my-events&account-id=1309160790&&session=apac1breez6wnxuiam7asee4hw');
req.setMethod('GET');
req.setHeader('Content-Type', 'application/json');
req.setHeader('Accept','application/json');
try {
res = http.send(req);
System.debug('MyResult == :'+res.getBody());
}catch(System.CalloutException e){
System.debug('Callout error: '+ e);
}//return res;
}
}
Thanks In Advance,
Basha
- basha sk
- January 15, 2018
- Like
- 0
How to filter previous values from next response values ?
Hi All,
I'm trying to filter the below mentioned response like below please check it once
Map<String,String> customsettingValues = new Map<String,String>();
Map<String,String> SelectedValues = new Map<String,String>();
Set<String> orderList1 = new Set<String>();
for(String firstKey : customsettingValues.keySet()){
String firstValue = customsettingValues.get(firstKey);
for(String secondKey : SelectedValues.keySet()){
String secondValue = SelectedValues.get(secondKey);
if(firstValue.equals(secondKey)){
orderList1.add(secondValue);
System.debug('orderList1:::---------'+orderList1);
}
}
}
I got the Response Like below for the above code
orderList1:::---------{chandra}
orderList1:::---------{chandraiii@gmail.com,chandra}
orderList1:::---------{Not Attended,chandraiii@gmail.com,chandra}
orderList1:::---------{vizag,Not Attended,chandraiii@gmail.com,chandra}
orderList1:::---------{ap,vizag,Not Attended,chandraiii@gmail.com,chandra}
orderList1:::---------{Ind,ap,vizag,Not Attended,chandraiii@gmail.com,chandra}
orderList1:::---------{88888888888,Ind,ap,vizag,Not Attended,chandraiii@gmail.com,chandra}
How to change above response like below
orderList1:::---------{chandra}
orderList1:::---------{chandraiii@gmail.com}
orderList1:::---------{Not Attended}
orderList1:::---------{vizag}
orderList1:::---------{ap}
orderList1:::---------{Ind}
orderList1:::---------{88888888888}
If anybody having idea please let me know
Thanks In Advance
Basha
I'm trying to filter the below mentioned response like below please check it once
Map<String,String> customsettingValues = new Map<String,String>();
Map<String,String> SelectedValues = new Map<String,String>();
Set<String> orderList1 = new Set<String>();
for(String firstKey : customsettingValues.keySet()){
String firstValue = customsettingValues.get(firstKey);
for(String secondKey : SelectedValues.keySet()){
String secondValue = SelectedValues.get(secondKey);
if(firstValue.equals(secondKey)){
orderList1.add(secondValue);
System.debug('orderList1:::---------'+orderList1);
}
}
}
I got the Response Like below for the above code
orderList1:::---------{chandra}
orderList1:::---------{chandraiii@gmail.com,chandra}
orderList1:::---------{Not Attended,chandraiii@gmail.com,chandra}
orderList1:::---------{vizag,Not Attended,chandraiii@gmail.com,chandra}
orderList1:::---------{ap,vizag,Not Attended,chandraiii@gmail.com,chandra}
orderList1:::---------{Ind,ap,vizag,Not Attended,chandraiii@gmail.com,chandra}
orderList1:::---------{88888888888,Ind,ap,vizag,Not Attended,chandraiii@gmail.com,chandra}
How to change above response like below
orderList1:::---------{chandra}
orderList1:::---------{chandraiii@gmail.com}
orderList1:::---------{Not Attended}
orderList1:::---------{vizag}
orderList1:::---------{ap}
orderList1:::---------{Ind}
orderList1:::---------{88888888888}
If anybody having idea please let me know
Thanks In Advance
Basha
- basha sk
- February 19, 2018
- Like
- 0
External website doesn't login ondemand through salesforce iframes?
Hi Everyone,
I'm trying to login external website from salesforce iframes.
For testing I check the URL in browser like below i get the response
URL : https://xxxxxxxx.adobeconnect.com/api/xml?action=login&login=xxxxxxx.com&password=xxxxxxx
Response :
----------
<results>
<status code="ok"/>
<OWASP_CSRF_TOKEN>
<token>
442adc814ed114ac272552be35684e1253444f5d7d5e05b2ee73d72adf287320
</token>
</OWASP_CSRF_TOKEN>
</results>
now i' testing the login in same window with url : https://xxxxxxxx.adobeconnect.com/
now thios it directly opens the home page of my instance.
Now I'm doing the same process through REST api but the browser ignores the token doesn't take the login access
it just opens the login page of my instance.
This is my REST API please check it once
Apex class:
--------------
public class CreateEvent{
public Test__c login;
public CreateEvent(ApexPages.StandardSetController controller){
this.login= (Test__c)controller.getRecord();
}
public CreateEvent(ApexPages.StandardController controller){}
public Pagereference processCheck(){
CreateWebinar.postfieldsFuture(username,password,url,cookie);
PageReference pageref2 = new PageReference('/apex/AdobeIframe');
return pageref;
REST API
---------
global class CreateWebinar{
@future (callout=true)
global static void postfieldsFuture(String username, String password,String url,String cookie){
getParticipants(username, password, url,cookie);
}
global static HttpResponse getParticipants(String username, String password,String url,String cookie){
Http http = new Http();
HttpRequest req = new HttpRequest();
HttpResponse res = new HttpResponse();
Blob headerValue = Blob.valueOf(username + ':' + password);
String authorizationHeader = 'BASIC ' +
EncodingUtil.base64Encode(headerValue);
req.setHeader('Authorization', authorizationHeader);
req.setEndpoint(url+'/api/xml?action=login&login='+username+'&password='+password+'&domain=acme.adobe.com&session='+cookie);
req.setMethod('GET');
req.setHeader('Content-Type', 'application/json');
req.setHeader('Accept','application/json');
res = http.send(req);
String[] headerkeys = res.getHeaderKeys();
Map<string, string> headers = new map<string, string>();
for(string s : headerkeys){
headers.put(s,res.getHeader(s));
system.debug('header: ' + s + ' value: ' + res.getHeader(s));
}
//HeaderValues:======(Server, Cache-Control, Connection, Set-Cookie, Expires, Content-Length, Date, Content-Type)
System.debug('HeaderValues:======'+headerkeys);
System.debug('MyResult == :'+res.getBody());
}
}
Adobe Iframe
----------------
<apex:page>
<apex:iframe height="800" width="1230" src="https://meet30705009.adobeconnect.com?domain=acme.adobeconnect.com&Set-Cookie=apac1breeztxw8g5cx2g4x8wh6" scrolling="true"/>
</apex:page>
how to login to my instance ondemand through iframes please check it once
if anyone having idea please let me know
Thanks
Basha
- basha sk
- February 16, 2018
- Like
- 0
how to display standard object records into two sections based on field sepeartion?
Hi Everyone,
I have a custon object called Test__c.I'm trying to display Test__c object records into two sections
in a visualforce based on a field sepeartion.but how to read the fields from cotroller extension.
vf page
-------
<apex:page standardController="Test__c" extensions="DivedeRecordsList" recordSetVar="test" >
<apex:sectionHeader title="Test Records List" />
<apex:form >
<apex:pageBlock Title="Test Records completed">
<apex:pageBlockTable value="{!test}" var="w" >
<apex:column value="{!w.first}" />
<apex:column value="{!w.Second}" />
<apex:column value="{!w.third}" />
<apex:column value="{!w.Expired__c}" />
</apex:pageBlockTable>
</apex:pageBlock>
<apex:pageBlock Title="New Test Records">
<apex:pageBlockTable value="{!test}" var="w" >
<apex:column value="{!w.first}" />
<apex:column value="{!w.Second}" />
<apex:column value="{!w.third}" />
<apex:column value="{!w.Expired__c}" />
</apex:pageBlock>
</apex:form>
</apex:page>
Apex class
-----------
public class DivedeRecordsList {
public Test__c testrecords{get;set;}
List<Test__c> lst{get;set;}
List<Test__c> lst1{get;set;}
public DivedeWebinarsList(ApexPages.StandardController controller){
testrecords = (Test__c)controller.getRecord();
}
public List<Test__c> upcomingRecords(){
List<Test__c> lst = [select id,Name,first,second,third from Test__c where Expired__c = 'false'];
return lst;
}
public List<Test__c> completedRecords(){
List<Test__c> lst = [select id,Name,first,second,third from Test__c where Expired__c = 'true'];
return lst;
}
}
Thanks In advance
Sekhar
I have a custon object called Test__c.I'm trying to display Test__c object records into two sections
in a visualforce based on a field sepeartion.but how to read the fields from cotroller extension.
vf page
-------
<apex:page standardController="Test__c" extensions="DivedeRecordsList" recordSetVar="test" >
<apex:sectionHeader title="Test Records List" />
<apex:form >
<apex:pageBlock Title="Test Records completed">
<apex:pageBlockTable value="{!test}" var="w" >
<apex:column value="{!w.first}" />
<apex:column value="{!w.Second}" />
<apex:column value="{!w.third}" />
<apex:column value="{!w.Expired__c}" />
</apex:pageBlockTable>
</apex:pageBlock>
<apex:pageBlock Title="New Test Records">
<apex:pageBlockTable value="{!test}" var="w" >
<apex:column value="{!w.first}" />
<apex:column value="{!w.Second}" />
<apex:column value="{!w.third}" />
<apex:column value="{!w.Expired__c}" />
</apex:pageBlock>
</apex:form>
</apex:page>
Apex class
-----------
public class DivedeRecordsList {
public Test__c testrecords{get;set;}
List<Test__c> lst{get;set;}
List<Test__c> lst1{get;set;}
public DivedeWebinarsList(ApexPages.StandardController controller){
testrecords = (Test__c)controller.getRecord();
}
public List<Test__c> upcomingRecords(){
List<Test__c> lst = [select id,Name,first,second,third from Test__c where Expired__c = 'false'];
return lst;
}
public List<Test__c> completedRecords(){
List<Test__c> lst = [select id,Name,first,second,third from Test__c where Expired__c = 'true'];
return lst;
}
}
Thanks In advance
Sekhar
- basha sk
- February 12, 2018
- Like
- 0
How to redirect to the previous visualforce page from current visualforce page (like back button)?
How to redirect previous visualforce page from current visualforce page?
Hi Everyone,
First of all here i'm having two visualforce pages
1.Webinar_Details Page
2.MappingLeadPage
webinar_details page is a record details page it displays all the details of one particular record.
In this page i'm having a button calles "Mapping Lead" by clicking the button it redirects to the
"MappingLeadPage" visualforce page.after mapping the fields i'm saving the mapping and redirects to the previous record
details page.
here for redirecting i need the previous record id.how can i get the previous record id for redirecting
Webinar_Details Page
--------------------
<apex:page standardController="Webinar__c" tabstyle="Adobe_Webinars__tab" sidebar="false" extensions="RedirectPage">
<apex:form >
<apex:pageBlock title="Adobe Connect Integration with Salesforce">
<center>
<apex:commandButton value="Register" action="{!doRegistrationForm}"/>
</center><br/><br/>
<apex:pageBlockSection title="{!Webinar__c.Name} Details">
<apex:outputField value="{!Webinar__c.Name}"/>
<apex:inlineEditSupport event="ondblClick" /><br/>
</apex:pageBlockSection><br/>
</apex:pageBlock>
<apex:pageBlock >
<apex:pageBlockTable value="{!wrapperAccountList}" var="w" id="table" title="All Accounts">
<apex:column value="{!w.acc.Login__c}"></apex:column>
<apex:inlineEditSupport event="ondblClick" />
<apex:column value="{!w.acc.isLead__c}"></apex:column>
</apex:pageBlockTable>
</apex:pageBlock>
<center>
<apex:commandButton id="leadcreate1" value="Lead Mapping" action="{!doMappingPage}"/>
</center><br/>
</apex:pageBlock>
</apex:form>
</apex:page>
extension:
-----------
public class RedirectPage{
public PageReference doMappingPage(){
PageReference parentPage = new PageReference('/apex/MappingLeadPage');
parentPage.setRedirect(true);
return parentPage;
}
}
MappingLeadPage
----------------
<apex:page standardController="Lead" extensions="MappingLead1">
<apex:form >
<apex:pageBlock title="Lead Mapping" >
<apex:pageBlockSection >
<apex:pageBlock >
<apex:pageBlockSection >
Webinar Attendee Name <apex:inputField value="{!Lead.LeadFields__c}"/><br/>
Webinar Attendee Email <apex:inputField value="{!Lead.Lead_Fields1__c}"/><br/>
Webinar Attendee Company <apex:inputField value="{!Lead.Lead_Fields2__c}"/><br/>
Webinar Attende Mobile Number <apex:inputField value="{!Lead.Lead_Fields7__c}"/><br/><br/>
<!-- <apex:outputLink value="{!URLFOR($Page.Webinar_Details,w.acc.Id,[id=w.acc.Id])}">{!w.acc.name}</apex:outputLink> -->
</apex:pageBlockSection>
<apex:commandButton id="saveBtn" value="Save Mapping" action="{!processButtonClick}" style="margin-left:-2%"/>
<apex:commandButton id="saveBtn1" value="Previous Page" action="{!goBack}" style="margin-left:30%"/>
<apex:pageBlockButtons >
</apex:pageBlockButtons>
</apex:pageBlock>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>
extension
------------
public with sharing class MappingLead1 {
public Lead login;
private final ApexPages.StandardController controller;
public MappingLead1(ApexPages.StandardController controller){
this.login= (Lead)controller.getRecord();
}
public PageReference goBack(){
PageReference pg = new PageReference('/apex/Webinar_Details');
pg.setRedirect(true);
return pg;
}
}
from the MappingLeadPage page by clicking the "Previous Page" button how i redirected to the Webinar_Details Page vf page.
Please anybody help i'm trying this logic from yesterday
Thanks In Advance
Hi Everyone,
First of all here i'm having two visualforce pages
1.Webinar_Details Page
2.MappingLeadPage
webinar_details page is a record details page it displays all the details of one particular record.
In this page i'm having a button calles "Mapping Lead" by clicking the button it redirects to the
"MappingLeadPage" visualforce page.after mapping the fields i'm saving the mapping and redirects to the previous record
details page.
here for redirecting i need the previous record id.how can i get the previous record id for redirecting
Webinar_Details Page
--------------------
<apex:page standardController="Webinar__c" tabstyle="Adobe_Webinars__tab" sidebar="false" extensions="RedirectPage">
<apex:form >
<apex:pageBlock title="Adobe Connect Integration with Salesforce">
<center>
<apex:commandButton value="Register" action="{!doRegistrationForm}"/>
</center><br/><br/>
<apex:pageBlockSection title="{!Webinar__c.Name} Details">
<apex:outputField value="{!Webinar__c.Name}"/>
<apex:inlineEditSupport event="ondblClick" /><br/>
</apex:pageBlockSection><br/>
</apex:pageBlock>
<apex:pageBlock >
<apex:pageBlockTable value="{!wrapperAccountList}" var="w" id="table" title="All Accounts">
<apex:column value="{!w.acc.Login__c}"></apex:column>
<apex:inlineEditSupport event="ondblClick" />
<apex:column value="{!w.acc.isLead__c}"></apex:column>
</apex:pageBlockTable>
</apex:pageBlock>
<center>
<apex:commandButton id="leadcreate1" value="Lead Mapping" action="{!doMappingPage}"/>
</center><br/>
</apex:pageBlock>
</apex:form>
</apex:page>
extension:
-----------
public class RedirectPage{
public PageReference doMappingPage(){
PageReference parentPage = new PageReference('/apex/MappingLeadPage');
parentPage.setRedirect(true);
return parentPage;
}
}
MappingLeadPage
----------------
<apex:page standardController="Lead" extensions="MappingLead1">
<apex:form >
<apex:pageBlock title="Lead Mapping" >
<apex:pageBlockSection >
<apex:pageBlock >
<apex:pageBlockSection >
Webinar Attendee Name <apex:inputField value="{!Lead.LeadFields__c}"/><br/>
Webinar Attendee Email <apex:inputField value="{!Lead.Lead_Fields1__c}"/><br/>
Webinar Attendee Company <apex:inputField value="{!Lead.Lead_Fields2__c}"/><br/>
Webinar Attende Mobile Number <apex:inputField value="{!Lead.Lead_Fields7__c}"/><br/><br/>
<!-- <apex:outputLink value="{!URLFOR($Page.Webinar_Details,w.acc.Id,[id=w.acc.Id])}">{!w.acc.name}</apex:outputLink> -->
</apex:pageBlockSection>
<apex:commandButton id="saveBtn" value="Save Mapping" action="{!processButtonClick}" style="margin-left:-2%"/>
<apex:commandButton id="saveBtn1" value="Previous Page" action="{!goBack}" style="margin-left:30%"/>
<apex:pageBlockButtons >
</apex:pageBlockButtons>
</apex:pageBlock>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>
extension
------------
public with sharing class MappingLead1 {
public Lead login;
private final ApexPages.StandardController controller;
public MappingLead1(ApexPages.StandardController controller){
this.login= (Lead)controller.getRecord();
}
public PageReference goBack(){
PageReference pg = new PageReference('/apex/Webinar_Details');
pg.setRedirect(true);
return pg;
}
}
from the MappingLeadPage page by clicking the "Previous Page" button how i redirected to the Webinar_Details Page vf page.
Please anybody help i'm trying this logic from yesterday
Thanks In Advance
- basha sk
- February 06, 2018
- Like
- 0
How to get selected value from selectOption values dropdown list
Here in visualforce page i have two selectoption dropdownlists.
Account list
Contacts list
In accounts list i'm displaing all salesforce accounts and based on the selected account I'm displaying the related contacts in Contacts list.
After getting the selected contact i'm mapping that contact details to the other custom object.
Req: How to filter the selected contact record from selectedOption list?
This is my apex class:
public with sharing class Picklist{
public String selectedAccId{get;set;}
public String selectedConId{get;set;}
public String selectedContactId{get;set;}
public String firstname;
public String lastname;
public String email;
public String company;
public String mailingcity;
public String mailingstate;
public String mailingcountry;
public String mobileno;
public Status__c login1;
List<System.SelectOption> conOptions{get;set;}
List<System.SelectOption> options{get;set;}
public Picklist(ApexPages.StandardController controller){
this.login1= (Status__c)controller.getRecord();
}
public List<System.SelectOption> accOptions{get;set;}
//getting all salesforce accounts
public List<System.SelectOption> getAccountNames(){
List<System.SelectOption> accOptions= new List<System.SelectOption>();
accOptions.add( new System.SelectOption('','--Select--'));
for( Account acc : [select Id,name from Account] ){
accOptions.add( new System.SelectOption(String.valueOf(acc.Id),acc.name));
} return accOptions;
} //displaying all related contacts based the selectd account record. public List<System.SelectOption> getContactNames(){
List<System.SelectOption> conOptions= new List<System.SelectOption>();
if(selectedAccId != null){
for(contact con : [select Id,name,accountid,FirstName,LastName,email,MobilePhone,MailingCity,MailingState,MailingCountry from contact where accountid=:selectedAccId ]){
conOptions.add(new System.SelectOption(String.valueOf(con.Id),con.name));
System.debug('conOptions:::'+conOptions);
}
}
return conOptions;
}
//how to get the contact record from conatcs list.
public Pagereference getSelectedContact(){
System.debug('Entered Selected contact id...........'+selectedConId );
List<System.SelectOption> options = new List<System.SelectOption>();
if(conOptions.size() > 0){
System.debug('SelectId::::'+selectedConId);
for(Contact con1 : [select Id, name, Account.Name, accountid, FirstName, LastName, email, MobilePhone, MailingCity, MailingState, MailingCountry from contact where id=:selectedConId]){
firstname = con1.FirstName;
System.debug('Entered ContactNames contact id...........'+firstname);
lastname= con1.LastName; System.debug('lastname:::'+lastname);
email = con1.Email;
System.debug('email:::'+email );
}
}
else{ conOptions.add( new System.SelectOption('--None--','--None--')); } return null; } }
Thanks in advancce if anybody having idea please let me know
- basha sk
- February 05, 2018
- Like
- 0