• Vineetz
  • NEWBIE
  • 0 Points
  • Member since 2013

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 6
    Replies
Hey all,

I have an app hosted on heroku that is trying to access Salesforce data layer.
I am trying to user Sfdc.canvas.client.ajax but im unable to get neither a SUCCESS or FAILURE from this call.
I also am not facing any error.

Please find my code below :
________________________________________________________________________
I HAVE ADDED THE FOLLOWING LIBRARIES : 
________________________________________________________________________

            <script type="text/javascript" src="/sdk/js/canvas-all.js"></script>
            <script type="text/javascript" src="/sdk/js/client.js"></script>
            <script type="text/javascript" src="/sdk/js/xd.js"></script>
            <script type="text/javascript" src="/sdk/js/oauth.js"></script>
            <script type="text/javascript" src="/sdk/js/cookies.js"></script>
            <script type="text/javascript" src="/scripts/json2.js"></script>
            <script type="text/javascript" src="/scripts/chatter-talk.js"></script>

____________________________________________________________________________________________

AJAX CALL : 
_____________________________________________________________________________________________
                        /* VIN */
                        function doFunction(){
                            var sr = JSON.parse('<%=signedRequestJson%>');
                            alert(Object.values(sr));
                            alert(JSON.stringify(sr, undefined, 2));
                            alert(JSON.stringify(sr.client.oauthToken, undefined, 2));
                            console.debug('xaxa' + Object.values(sr));
                            console.log("XAXA" + Object.values(sr));
                            //var sizes = Sfdc.canvas.client.size();
                            //alert('CLIENT SIZE' + sizes);
                            var csId =sr.context.environment.parameters.contactid;
                            alert('csID' + csId);
                            //Creating a variable with query Structure
                            var queryUrl= sr.context.links.queryUrl+"?q=SELECT+id+from+Contact+where+id='"+csId+"'"; 
                            //var xaxaurl = sr.context.links.queryUrl+"?q=SELECT+ID,NAME+FROM+CASE";
                            alert('QUERYCALL' + queryUrl );
                            //alert('OOGA WOOGA  BOOGA' );
                            
                            // Below block makes an AJAX call to Salesforce
                            
                            Sfdc.canvas.client.ajax(queryUrl,
                            { client : sr.client, //Send the req to signed request Client which has the OAuth – The Same request that requested Post to TMG - reused
                                method: 'GET', // GET method will request the fetched record details back from Salesforce
                                contentType: "application/json",
                                token : sr.client.oauthToken,
                                success : function(data) {
                                    alert('SUCCESS');
                                    console.debug("SUCCESS");
                                    console.log("SUCCESS");
                                },
                                failure : function(error) {
                                    alert('FAILURE');
                                    console.debug("SUCCESS");
                                    console.log("SUCCESS");

                                }
                            });
                        }

Please let me know if theres anything wrong that i'm doing ? anything missing from my end ?

Also can anyone provide me a link with the latest SDK with all the JS libraries (THE SDK in Canvas framework on github doesnt have the libraries)
Any help is appreciated.
 
Hey all,

I have an app hosted on heroku that is trying to access Salesforce data layer.
I am trying to user Sfdc.canvas.client.ajax but im unable to get neither a SUCCESS or FAILURE from this call.
I also am not facing any error.

Please find my code below :
________________________________________________________________________
I HAVE ADDED THE FOLLOWING LIBRARIES : 
________________________________________________________________________

            <script type="text/javascript" src="/sdk/js/canvas-all.js"></script>
            <script type="text/javascript" src="/sdk/js/client.js"></script>
            <script type="text/javascript" src="/sdk/js/xd.js"></script>
            <script type="text/javascript" src="/sdk/js/oauth.js"></script>
            <script type="text/javascript" src="/sdk/js/cookies.js"></script>
            <script type="text/javascript" src="/scripts/json2.js"></script>
            <script type="text/javascript" src="/scripts/chatter-talk.js"></script>

____________________________________________________________________________________________

AJAX CALL : 
_____________________________________________________________________________________________
                        /* VIN */
                        function doFunction(){
                            var sr = JSON.parse('<%=signedRequestJson%>');
                            alert(Object.values(sr));
                            alert(JSON.stringify(sr, undefined, 2));
                            alert(JSON.stringify(sr.client.oauthToken, undefined, 2));
                            console.debug('xaxa' + Object.values(sr));
                            console.log("XAXA" + Object.values(sr));
                            //var sizes = Sfdc.canvas.client.size();
                            //alert('CLIENT SIZE' + sizes);
                            var csId =sr.context.environment.parameters.contactid;
                            alert('csID' + csId);
                            //Creating a variable with query Structure
                            var queryUrl= sr.context.links.queryUrl+"?q=SELECT+id+from+Contact+where+id='"+csId+"'"; 
                            //var xaxaurl = sr.context.links.queryUrl+"?q=SELECT+ID,NAME+FROM+CASE";
                            alert('QUERYCALL' + queryUrl );
                            //alert('OOGA WOOGA  BOOGA' );
                            
                            // Below block makes an AJAX call to Salesforce
                            
                            Sfdc.canvas.client.ajax(queryUrl,
                            { client : sr.client, //Send the req to signed request Client which has the OAuth – The Same request that requested Post to TMG - reused
                                method: 'GET', // GET method will request the fetched record details back from Salesforce
                                contentType: "application/json",
                                token : sr.client.oauthToken,
                                success : function(data) {
                                    alert('SUCCESS');
                                    console.debug("SUCCESS");
                                    console.log("SUCCESS");
                                },
                                failure : function(error) {
                                    alert('FAILURE');
                                    console.debug("SUCCESS");
                                    console.log("SUCCESS");

                                }
                            });
                        }

Please let me know if theres anything wrong that i'm doing ? anything missing from my end ?

Also can anyone provide me a link with the latest SDK with all the JS libraries (THE SDK in Canvas framework on github doesnt have the libraries)
Any help is appreciated.

I am also seeing the following errors when I inspect browser : 

Unrecognized Content-Security-Policy directive 'referrer'.

b @ SfdcSessionBase204.js:31
updateExpires @ SfdcSessionBase204.js:34
e @ SfdcSessionBase204.js:35
t @ SfdcCore.js:220
SfdcFramework.b.require @ SfdcCore.js:234
(anonymous) @ SfdcSessionBase204.js:36
(anonymous) @ SfdcSessionBase204.js:36
sessionserver204.html:1 Unrecognized Content-Security-Policy directive 'reflected-xss'.


errors in SfdcSessionBase204.js:36  :
LINE NO 36 : 
!c||!f){if(k.push(a.id),!c&&!f){a=e.document;c=a.createElement("iframe");c.setAttribute("title","sessionserver");var b=c.style;b.position="absolute";b.left=b.top="-999px";e.addEventListener?e.addEventListener("message",l,!1):e.attachEvent&&e.attachEvent("onmessage",l);a.body.appendChild(c);c.src=h}}else f.postMessage(Sfdc.JSON.stringify(m(a)),h)}var q=!1;try{q=!!e.localStorage}catch(s){console.log("Can't access local storage: "+s)}var n=!(e.postMessage&&q),c=null,f=null,g={},p=0,k=[];Sfdc.provide("SfdcApp.SfdcSession",
 
Hi all,

I am working on a lightning app that needs OEM embeded License. My questions are as follows :

1) Can start building the app in my developer account and get the license once the app is ready ?
2) Can someone help me as to how much will it cost for this license ?
3) Are there any restictions in building this app with OEM embeded license ?
4) how much time will it take for verification in appexchange ?
5) Can this app be made available to sell some place outside app exchange ?

Thanks a lot.
All right, I have worked on a rather complicated requirement, which needs me to add dynamic values (Contacts) to a multiselect picklist field.

The problem : When the user deselects the values inserted in the multiselect picklist field, the value gets deleted.

PS : these multiselect picklist values have been inserted into a multiselect picklist field via code (a trigger and controller).

Please do suggest any workaround for the same.
Is anyone working on a similar implementation ?
I currently have a Lightning that displays a list of custom Master object records. 
<aura:component implements="force:appHostable,flexipage:availableForAllPageTypes" controller="ListWhiteboardItemsApexController">
    
    <aura:attribute name="whiteboardItems" type="Whiteboard_Item__c[]"/>
    
    <aura:handler name="init" value="{!this}" action="{!c.doInit}" />
        
    <aura:iteration items="{!v.whiteboardItems}" var="whiteboardItem">  
            <c:whiteboardItem whiteboardItem="{!whiteboardItem}" "/>
    </aura:iteration>
    
   
    
</aura:component>

Each master record has many detail records attached to it. Would I need to do a database call for all the detail records? How do I reference them in my code?

Here was was the relationship looks like in the schema
User-added image
Illegal assignment from List<System.SelectOption> to Set<String>  
@Line 15

public class FieldDependencyPickList {
public    Map<String,List<String>> cityMap{get;set;}
    public List<SelectOption> place {set;get;}
    public List<SelectOption> city {set;get;}
    public String selCity    {get;set;}
    public String selPlace    {set;get;}

public FieldDependencyPickList(){
    cityMap=new Map<String,List<String>>();
    List<String> hcityPlaces=new List<String> {'apet','npet','bpet','abpet'};
        List<String> apcityPlaces=new List<String> {'rjy','kkd','tni','vskp'};
            cityMap.put('HYD',hcityPlaces);            
            cityMap.put('AP',apcityPlaces);
                Set<String> place=cityMap.keySet();
L15   place=new List<SelectOption>();
        city=new List<SelectOption>();
        SelectOption so=new SelectOption('none','-None-');
        city.add(so);
        place.add(so);
    for(String p:place){
        SelectOption nsp=new SelectOption(p,p);
        city.add(nsp);
}  
    }
        public void placesGetter(){    
            place.clear();
            List<String> sp=cityMap.get(selcity);
            for(String pp:sp){
                SelectOption so1=new SelectOption(pp,pp);
                place.add(so1);
    }
  }
}

Hi,

Am unable to refresh any of the resources in the IDE from the server.

When am trying to refresh a page from the web, getting an Exception saying:

 

 

Unable to refresh resource 'MileaeExension.cls':
com.salesforce.ide.api.metadata.types.Metadata$JaxbAccessorF_fullName cannot be cast to com.sun.xml.bind.v2.runtime.reflect.Accessor

 

Unable to refresh resource 'MileaeExension.cls':


com.salesforce.ide.api.metadata.types.Metadata$JaxbAccessorF_fullName cannot be cast to com.sun.xml.bind.v2.runtime.reflect.Accessor

 

Please assist to rectify the issue. 

 

Thanks in advance,

VNath

hi  i created a site where the guest users can edit their personal information. the operation should be on lead object.so i created a custom controller submitt which will save the edited info by user. it worked fine in the develoepr mode. when i put that page in sites its not updating the information on the lead record. when i went to public access settings and checked there are no modify permission for leads on sites. how can i achieve this task through sites. 

I have To Radio Buttons and two textboxes placed beside them.As shown:  
<apex:panelGrid id="panelgrid" columns="2" > 
                             <apex:selectradio id="replyTo1" value="{!ReplyTo}" onclick="ReplyToField(this);" >                                            <apex:selectOption itemValue="replyToEmail"></apex:selectOption>                        
                             </apex:selectradio>
                             <apex:inputtext id="txt1" value="{!ownerEmail}" size="30"/><br/>
 
                             <apex:selectradio id="contactEmail" value="{!ContactEmail}">
                                  <apex:selectOption itemValue="cntEmail" ></apex:selectOption>
                             </apex:selectradio>
                             <apex:inputtext id="txt2" value="{!contact.Email}" size="30"/>
                         </apex:panelGrid>
 
When i click on the Radio button i want the Textbox value displayed beside it in apex code.
How can i check which Radio button is clicked in the server side(Apex controller) and get the text box value of the Radio  button clicked.
 
Or is there any other way to do so.as i dont have any idea on Radio Buttons. 
 
 Thanks
shaan 
 

 
 
 
 
  • June 27, 2009
  • Like
  • 0