• Tejas Bodhe
  • NEWBIE
  • 14 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 1
    Likes Given
  • 6
    Questions
  • 7
    Replies
Hi All,

I want to set a value of one field to another field before the record gets inserted using process builder.
Both the fields are on the same object and both are currency fields.

Can I do that using a process builder?

Thanks
Hi All,

I want to create Product Rule of type selection in steel brick cpq.
Product rule condition is when a user selects product "A" in quote line editor then prevent the user from selecting all products whose product family is not "Family X".
Means if the user selects product "A" in quote line editor then he should be able to select only those products whose family is "Family X".

This is what I did so far,


Product Rule




Product Action




Error Condition


If I select Product "A" in quote line editor then also I am able to select all the products other than "Family X".Which shouldn't be happening.
Hi All,

I want to create Product Rule of type selection in steel brick cpq.
Product rule condition is when a user selects product "A" in quote line editor then prevent the user from selecting all products whose product family is not "Family X".
Means if the user selects product "A" in quote line editor then he should be able to select only those products whose family is "Family X".

This is what I did so far,

Product Rule


Error Condition



Product Action


If I select Product "A" in quote line editor then also I am able to select all the products other than "Family X".Which shouldn't be happening.
Hello All,

I have a custom button on one of my objects.
From this button, I am calling a visual force page and passing the current records Id as a parameter.

This is my Custom Button URL: "/apex/VF_View_Digital_Asset?assetId={!Digital_Asset__c.Id}"

Now from visual force page controller, I am querying the one field based on "assetId" parameter. 

Snapshot of Controller Code:
recordId=ApexPages.currentPage().getParameters().get('assetId');
Digital_Asset__c redirectValues=[select id, URLToRedirect__c from Digital_Asset__c where id=:recordId];
PageReference nextPage = new PageReference(redirectValues.URLToRedirect__c);


Now, In check Marx report I get "Query: URL Redirection Attack" error.

Is there any way I can solve this issue?
How can I pass record Id from custom button to apex visual force page controller and redirect to another URL based on that record id?

Thanks
Hello All,

I have installed steel brick cpq package in my dev org.
When I change opportunity stage to "closed won" and set 'contracted' checkbox to true it automatically creates 'contracts' for that opportunity.
But I want to create 'service contract' instead of 'contract'.
Is there any way to do that? Do I need to install any other package?
Hi All,

I am trying to generate an access token for uploading a file from salesforce to Dropbox.

I got the code by referring to 
https://success.salesforce.com/answers?id=9063A000000ssnWQAQ
https://developer.salesforce.com/forums/?id=906F0000000MMoVIAW
http://forceguru.blogspot.in/2014/05/dropbox-authentication-in-salesforce.html
these sites.

Currently, my apex code is

public class dropBoxApi{
    Public String code ;
    Public String accesstoken;
    public String fileBody{get;set;}
   
   
    public dropBoxApi()
    {
        code = ApexPages.currentPage().getParameters().get('code') ;
        
        System.debug('Code='+code);
        if(code != '' && code != null)
        {
            AccessToken() ;
        }
    }

    public PageReference DropAuth()
    {
        
        system.debug('UPLOAD'+accessToken );
        //Authenticating
        PageReference pg = new PageReference('https://www.dropbox.com/1/oauth2/authorize?response_type=code&client_id='{appKey}'&redirect_uri=https://c.na46.visual.force.com/apex/DropBoxPage&state=Mytesting') ;
        
        return null;
    }

    public void AccessToken()
    {
        //Getting access token from dropbox
        
        String appKey='***********';
        String appSecreatKey='***********';
        String tokenuri = 'https://api.dropbox.com/oauth2/token?grant_type=authorization_code&code='+code+'&redirect_uri=https://c.na46.visual.force.com/apex/DropBoxPage'; 
        
        HttpRequest req = new HttpRequest();
        req.setEndpoint(tokenuri);
        req.setMethod('POST');
        req.setTimeout(60*1000);

        Blob headerValue = Blob.valueOf('{appKey}' + ':' + '{appSecretKey}');
        String authorizationHeader = 'BASIC ' + EncodingUtil.base64Encode(headerValue);
        req.setHeader('Authorization', authorizationHeader);
        Http h = new Http();
        String resp;
        HttpResponse res = h.send(req);
        resp = res.getBody();
        System.debug('response='+resp);
        JSONParser parser = JSON.createParser(resp);
        while (parser.nextToken() != null) {
            if ((parser.getCurrentToken() == JSONToken.FIELD_NAME)){
                String fieldName = parser.getText();
                parser.nextToken();
                if(fieldName == 'access_token') {
                    accesstoken = parser.getText();
                    System.debug('accesstoken='+accesstoken);
                } 
            }
        }
        system.debug('accessToken:'+accessToken );
        System.debug(' You can parse the response to get the access token ::: ' + resp);
        
        
   }
}


and my visual force page is

<apex:page controller="dropBoxApi"> <apex:form > <apex:pageblock > <apex:inputFile value="{!fileBody}" /> <apex:commandbutton action="{!DropAuth}" value="Upload Dropbox"> </apex:commandbutton></apex:pageblock> </apex:form> </apex:page>


My question is what is value of 'code' at line   
'code=ApexPages.currentPage().getParameters().get('code') '

I have tried both secret key and app key which I got from Dropbox app console.
But I get "code doesn't exist or has expired" error.
Hi All,

I want to set a value of one field to another field before the record gets inserted using process builder.
Both the fields are on the same object and both are currency fields.

Can I do that using a process builder?

Thanks
public class SendMailController {

    public String z { get; set; }

    public String y { get; set; }

    public String x { get; set; }

    public void saveMethod() {
        Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
        string[] xyz =new string[] {x};  
        mail.setToAddresses(xyz);
        mail.setSubject(y);
        mail.setHtmlBody(z);    
        Messaging.sendEmail(new Messaging.SingleEmailMessage[] {mail});
    }
   
  }
Hello All,

I have a custom button on one of my objects.
From this button, I am calling a visual force page and passing the current records Id as a parameter.

This is my Custom Button URL: "/apex/VF_View_Digital_Asset?assetId={!Digital_Asset__c.Id}"

Now from visual force page controller, I am querying the one field based on "assetId" parameter. 

Snapshot of Controller Code:
recordId=ApexPages.currentPage().getParameters().get('assetId');
Digital_Asset__c redirectValues=[select id, URLToRedirect__c from Digital_Asset__c where id=:recordId];
PageReference nextPage = new PageReference(redirectValues.URLToRedirect__c);


Now, In check Marx report I get "Query: URL Redirection Attack" error.

Is there any way I can solve this issue?
How can I pass record Id from custom button to apex visual force page controller and redirect to another URL based on that record id?

Thanks
Hi All,                    
           When End User Click the Command button need to genearte the dynamic CSV File using apex and uploading into DropBox account.how can i acheive this.  

Please advice.
Thanks,
Vivek.K
public class SendMailController {

    public String z { get; set; }

    public String y { get; set; }

    public String x { get; set; }

    public void saveMethod() {
        Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
        string[] xyz =new string[] {x};  
        mail.setToAddresses(xyz);
        mail.setSubject(y);
        mail.setHtmlBody(z);    
        Messaging.sendEmail(new Messaging.SingleEmailMessage[] {mail});
    }
   
  }