• Michael_Mantouvalos
  • NEWBIE
  • 30 Points
  • Member since 2020


  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 11
    Questions
  • 9
    Replies

Hello guys,
 
Is there any solution from when we have more than one Record Types (at different Sobjects) with the same Name?
In my org I have 2 Service types with the name  : "Service" in both Account and Case Object. 
The answer I get from the server when I make a Rest Call to create an Account with RecordType : "Service"  is: 
 
[
    {
        "message": "Name: more than one record found for external id field: [012090000005uVyAAI, 01                           2090000005uWHAAY]",
        "errorCode": "DUPLICATE_EXTERNAL_ID",
        "fields": [
            "Name"
        ]
    }
]
 
 
So basically it doenst know what Record type to apply. 
 
II have tried populating the SobjectType but it doenst work. 
 
What i did :

  "RecordType": {
                    "Name": "Service",
                    "SobjectType" : "Account" 
   }


Answer I get from server: 

[
    {
        "message": "More than 1 field provided in an external foreign key reference in entity: RecordTyp                             e",
        "errorCode": "INVALID_FIELD",
        "fields": []
    }
]

Hello everyone,

I have created a visualforce Email template that uses a visualforce component to display some records in a form of a table. The problem is that inside my visualforce component whatever HTML I use, it does not render the HTML and in Email preview, it shows  the HTML tags. For example I want to create a simple table  isnide my component :

Email Template :
<messaging:emailTemplate subject="test subject" recipientType="Contact" relatedToType="Booking__c">
<messaging:plainTextEmailBody >

<c:PaxInformation/>

Congratulations!
This is your new Visualforce Email Template.

Dear Partner,  
blah blah blah.......

</messaging:plainTextEmailBody>
</messaging:emailTemplate>

Visualforce Component (Name : PaxInformation)

<apex:component controller = "PaxInformationController" access="global" >

<table class="table">
    <thead>    
        <tr>
            <th>Opportunity Name</th> 
            <th>Opportunity Description</th>
            <th>Opportunity Amount</th>
        </tr>
    </thead>        
</table>
</apex:component>


Final Email received (body): 


User-added image


____________________________________

Any ideas on why is this happening?
Why it does not render the html tags to an actual html table?


Thanks in advance,
Michael.

Hi all,

I need to migrate some files and attachments from 8 old Objects to 2 new Objects in salesforce. I have two types of files to migrate, Content Version files and Attachments. We have a link between the old and new objects and would like to move the files without risking losing any of them. Can you please advise me on how I can do that? I have tried several methods we found online but none of them works. Which is the SF standard file/attachment standard migration method?
Thank you.

Hello Everyone, 

Is there a way to access the URL of a Dashboard's Image that is generated in Classic salesforce, so I can attach it to an email and send it to someone?

I would like to query the Dashboard that I need, then find its image URL , and then attach the URL to an Email body through SingleEmailMessage

Is this possible?

Thank you.

Hello,

I am quite new to salesforce and I have a question about page redirection. I have created the following PageReference in Apex : 

 

PageReferenceIs there a way to navigate directy to the generated Url without the use of a visualForce Page? When I call this method, It doesn't do anything.

 

Thanks in advance!

 

 

salesforce URL

 

Hello everyone,

Is there a way to convert this parametirized URL to be called  from an aura button? (also with parameters)

 

thank you

Hello everybody!

I have a component that has a jsController. Inside the controller there my "doInit" function. 

I also have created another  function with 4 parameters

printFunction : function ( param1, patam2, param3, param4){
.......
}

Is there a way to call printFunction having also defined the parameters,  from  inside "doInit" function?

Thanks in advance!

Hi all,
I have some text input fields in an aura component.
i.e: 
 <lightning:input type="text" label="Name" id="text-input-id1" value="{!v.name}"/>

The idea is to submit the text on js controller when pressing anywhere outside of the input field it self. 
Something similar to this event :  onClick = "{!c.handleClick}"   ,but when pressing outside the input field. (or pressing tab to go to the next one)

Is there something i could do? I have searched everywhere with zero luck. 

 

Thank you!!

Hello everyone. I have a security question to make.  So I am viewing a prospect from pardot through the pardot API from my apex code. Everything works great I have no issues with the implementation.  Initially, I make a request to  https://login.salesforce.com/services/oauth2/token, so i can receive a token that I need to access pardot API.  I do this using the following keys in my request:

grant_type --> password
client_id --> "the client id i get from connected app I have created"
client_secret -->"the client secret i get from connected app I have created"
username --> "username of org of the connected app I have created"
password --> " password of org of the connected app I have created"

 

The problem is that I pass these values hardcoded directly in my apex code (username, password , client_secret, client_id)  Wich I know is not a good practice, and also it would cause problmes when for example the administrator will change the password of the org of the connected app.

 

I need a way for those values to be inserted elsewhere and not be visible inside my apex code. I have found something about named requests and auth. providers but I cannot understad clearly what I have to do.  Whould be a good solution to create a custom object and insert the values there with encryption o I can decrypt them in the code?


how I get the Token:

 

public static String getToken(){
        Http http = new Http();
        HttpRequest request = new HttpRequest();
        String body = 'grant_type=password&client_id='+clientId+'&client_secret='+clientSecret+'&username='+userName+'&password='+password;
        request.setEndpoint('https://login.salesforce.com/services/oauth2/token');
        request.setMethod('POST');
        request.setBody(body);
        HttpResponse response = http.send(request);
        Map<String, Object> results = (Map<String, Object>) JSON.deserializeUntyped(response.getBody());
if(response.getStatusCode() == 200){
 String token = (String)results.get('access_token');
return token;
}else{
             throw new CalloutException('FAILED TO GET TOKEN');
}



After receiving the Token I make an Http Request to pardot:

 

HttpRequest request = new HttpRequest();
        request.setEndpoint('https://pi.pardot.com/api/prospect/version/4/do/read?email='+email+'&format=json');  
        request.setMethod('POST');
        request.setHeader('Authorization', 'Bearer ' + token); 
        request.setHeader('Pardot-Business-Unit-Id',  unitId);
        HttpResponse response = http.send(request);

 

 

Thank you in Adcance!!

 

Hi everyone,

I have a procedure that creates some data from a aura component page. This component uses a form and a submit button. This button (submitRecord function below) creates the data and then i navigate to a custom report to view that data. I need a way so when i press that button and the records get created, then to be redirected to this custom report page directrly. I used this :  window.location.href = 'link_of_custom_report' and it worked. Instead i need to relocate dynamicaly and not with a direct link. Is there a way to do so? Thanks in advance!

controller: 

({
    submitRecord : function(component, event, helper) {
        var action = component.get("c.createSummaryRecordsFromSpecicDates");
        action.setParams({"setDateFrom" : component.get("v.startDate"),
                          "setDateTo" : component.get("v.endDate")
        });
        action.setCallback(this, function(result){
            var state = result.getState();
            if (component.isValid() && state === "SUCCESS"){
               ********** i need something here in order to redirect to my reports page **********
            }
        });
        $A.enqueueAction(action);
    }
})

Hi, I have an apex method with two Date parameters that inserts into the Database a list a custom objects depending on those dates. The problem i face is when i try to collect the Dates from the Lightning page.  I want two simple Date Inputs and a Submit button that can pass the date values to the js controller and from there finally to the apex method.  Can somebody please show me the way of constructing the inputs and submit button in the html page, and also how to compose the js controller in order to call the apex method including these two parameters? 

Thanks in advance!

Hello everyone,

I have created a visualforce Email template that uses a visualforce component to display some records in a form of a table. The problem is that inside my visualforce component whatever HTML I use, it does not render the HTML and in Email preview, it shows  the HTML tags. For example I want to create a simple table  isnide my component :

Email Template :
<messaging:emailTemplate subject="test subject" recipientType="Contact" relatedToType="Booking__c">
<messaging:plainTextEmailBody >

<c:PaxInformation/>

Congratulations!
This is your new Visualforce Email Template.

Dear Partner,  
blah blah blah.......

</messaging:plainTextEmailBody>
</messaging:emailTemplate>

Visualforce Component (Name : PaxInformation)

<apex:component controller = "PaxInformationController" access="global" >

<table class="table">
    <thead>    
        <tr>
            <th>Opportunity Name</th> 
            <th>Opportunity Description</th>
            <th>Opportunity Amount</th>
        </tr>
    </thead>        
</table>
</apex:component>


Final Email received (body): 


User-added image


____________________________________

Any ideas on why is this happening?
Why it does not render the html tags to an actual html table?


Thanks in advance,
Michael.

salesforce URL

 

Hello everyone,

Is there a way to convert this parametirized URL to be called  from an aura button? (also with parameters)

 

thank you

Hello everybody!

I have a component that has a jsController. Inside the controller there my "doInit" function. 

I also have created another  function with 4 parameters

printFunction : function ( param1, patam2, param3, param4){
.......
}

Is there a way to call printFunction having also defined the parameters,  from  inside "doInit" function?

Thanks in advance!

Hi all,
I have some text input fields in an aura component.
i.e: 
 <lightning:input type="text" label="Name" id="text-input-id1" value="{!v.name}"/>

The idea is to submit the text on js controller when pressing anywhere outside of the input field it self. 
Something similar to this event :  onClick = "{!c.handleClick}"   ,but when pressing outside the input field. (or pressing tab to go to the next one)

Is there something i could do? I have searched everywhere with zero luck. 

 

Thank you!!

Hi, I have an apex method with two Date parameters that inserts into the Database a list a custom objects depending on those dates. The problem i face is when i try to collect the Dates from the Lightning page.  I want two simple Date Inputs and a Submit button that can pass the date values to the js controller and from there finally to the apex method.  Can somebody please show me the way of constructing the inputs and submit button in the html page, and also how to compose the js controller in order to call the apex method including these two parameters? 

Thanks in advance!