• Brandon COFFIN
  • NEWBIE
  • 30 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 13
    Questions
  • 5
    Replies
Hi,

I have a Visualforce page that has a lookup field and when it changes, I would like to perform an Apex action then rerender another block.

Here is the code I wrote :
<apex:pageBlockTable value="{!generalInformation}" var="information">
            	<apex:column headerValue="{!$ObjectType.Object__c.Fields.Lookup__c.Label}">
                    <apex:inputField id="test" value="{!information.Lookup__c}" required="true">
                        <apex:actionSupport event="onchange" action="{!action}" reRender="table" />
                    </apex:inputField>
                </apex:column>
                <apex:column headerValue="{!$ObjectType.Object__c.Fields.Date__c.Label}">
                	<apex:inputField value="{!information.Date__c}" />
                </apex:column>
                <apex:column headerValue="{!$ObjectType.Object__c.Fields.Single_picklist_one__c.Label}">
                	<apex:inputField value="{!information.Single_picklist_one__c}" />
                </apex:column>
                <apex:column headerValue="{!$ObjectType.Object__c.Fields.Single_picklist_two__c.Label}">
                	<apex:inputField value="{!information.Single_picklist_two__c}" />
                </apex:column>
            </apex:pageBlockTable>

This code works, the onchang fires. But when I set the other fields required like this :
<apex:pageBlockTable value="{!generalInformation}" var="information">
            	<apex:column headerValue="{!$ObjectType.Object__c.Fields.Lookup__c.Label}">
                    <apex:inputField id="test" value="{!information.Lookup__c}" required="true">
                        <apex:actionSupport event="onchange" action="{!action}" reRender="table" />
                    </apex:inputField>
                </apex:column>
                <apex:column headerValue="{!$ObjectType.Object__c.Fields.Date__c.Label}">
                	<apex:inputField value="{!information.Date__c}" required="true" />
                </apex:column>
                <apex:column headerValue="{!$ObjectType.Object__c.Fields.Single_picklist_one__c.Label}">
                	<apex:inputField value="{!information.Single_picklist_one__c}" required="true" />
                </apex:column>
                <apex:column headerValue="{!$ObjectType.Object__c.Fields.Single_picklist_two__c.Label}">
                	<apex:inputField value="{!information.Single_picklist_two__c}" required="true" />
                </apex:column>
            </apex:pageBlockTable>

It stops working.
I tried using imediate="true" and a Javascript function (but maybe it wasn't correct)

Thanks
Hello,

I am working on quotes and I need to retrive information from a custom child object of Product we created.
On the quote record page, when we click on a button, a PDF is generated.
For each product associated to the quote, information are returned from Quote Line Item by a SOQL query.
I would like to retrieve the information I need on the Product child object (one record of this object is associated to only one product).

Here is the query we use :
qlis = [SELECT Id, PriceBookEntry.Product2.Name, Description, Notes__c, UnitPrice, Quantity, TotalPrice, Total_Weight__c, CurrencyIsoCode, Weight__c, PricebookEntry.Product2.ProductKey__c, PricebookEntry.Product2.Item_designation_marking__c FROM QuoteLineItem WHERE QuoteId = :quoteId];

User-added image
What is the best way to do this ? I would like to do this in only one query but I don't think it is possible.
Hello,

I have a custom related list on the Quote object and I would like a profile to see a button redirecting to a visualforce page.
My profile can see it but not the one I would like to, despite it can reach the page (when I paste it connected a a user with that profile).
My options
My options

profileoptions
Profile options

Do you know where it might come from ?

Thanks
Hello,

I have an issue on a lookup (with a field filter) field visibility on a profile. I checked multiple times, the field security level is correct, the profile can see the field and the custom object where the informations are stored.

Can you help me ?
 
Thanks,
Hello,

I have a trouble with an e-mail my e-mail to Salesforce (email@salesforce.com).
I have two e-mails : a@domain.com and b@domain.com. Everything works fine for all the e-mails but I don't receive information when I send from b@domain.com to email@salesforce.com
I can send from a@domain.com to email@salesforce.com, from a@domain.com to b@domain and from b@domain.com to a@domain with no problem so I think all my configurations are fine.

Do you have an idea ?
Thanks
Hello,

I would like to get all the IDs of the contacts that are related to a specific account.
I found this : https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/dome_relationship_traversal.htm but I would like to do the same using an external ID like : https://instance.salesforce.com/services/data/v39.0/sobjects/Accounts/EXTERNALIDFIELD/EXTERNALID/Contacts?fields=ID

Is it possible ?

Thanks,
COFFIN Brandon
Hello,

In S-Docs, I would like to have two fields in the same related list column, how can I do this ?

Thanks,
COFFIN Brandon
Hello,

I have a problem with my Java rest API request.
I would like to have the full JSON response, I explain.

For example, in Java, here is what I have for response code :
400

And for response message :
Bad request

Using something else, the code is the same but the message is :
Item designation/marking: data value too large: DECOR ENTIER \&quot;COMMUNE DE CONTHEY+EAUX CLAIRES\&quot; 400KN (max length=60)

This is what I would like to have in Java, using HttpURLConnection.

How can I do this ?

Thank you,
COFFIN Brandon
Hello,

I'm working with the rest API in order to make an upsert of the products in Salesforce.
The Java code I developed worked fine since today.
Two products are not working and the response is 400 bad request, so probably JSON error (according to the status code)
Nothing changed in my code and all the other products worked correctly.

Here is the requested URL :
https://na38.salesforce.com/services/data/v38.0/sobjects/Product2/ProductKey__c/DEV%3AELMT%20AUTRE?_HttpMethod=PATCH

And the JSON body :
{"PURCHASING_GROUP__C":"ART",
"PRODUCT_UOM__C":"UN",
"PRODUCT_WEIGHT__C":"1.000",
"DESCRIPTION":"ELEMENT FONTE POUR DEVIS",
"M3_STAT__C":"20",
"ITEM_DESIGNATION_MARKING__C":"ELEMENT FONTE AUTRE QUE CADRE OU TAMPON POUR DEVIS",
"ITEM_TYPE__C":"S",
"ITEM_GROUP__C":"CM",
"PRODUCTCODE":"DEV:ELMT AUTRE",
"ISACTIVE":"true",
"NAME":"DEV:ELMT AUTRE"}

Thanks
Hello,

I have to perform a multiple upsert of the standard object Product using an external ID.
I found this https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/dome_upsert.htm and this http://releasenotes.docs.salesforce.com/en-us/summer15/release-notes/rn_api_rest.htm#sobject_tree_resource but it doesn't help me.
Here is my Java code :
 
try {
			HttpURLConnection sfdcConnection = (HttpURLConnection) new URL("https://cs61.salesforce.com/services/data/v39.0/sobjects/Product2/External_ID__c/1?_HttpMethod=PATCH").openConnection();
			
			sfdcConnection.setRequestMethod("POST");
			sfdcConnection.setDoOutput(true);
			sfdcConnection.setRequestProperty("Content-Type", "application/json");
			sfdcConnection.setRequestProperty("Accept", "application/json");
			sfdcConnection.setRequestProperty("Authorization", "Bearer token");
			
			DataOutputStream dts = new DataOutputStream(sfdcConnection.getOutputStream());
			dts.writeChars(JSONFile);
			
			BufferedReader br = new BufferedReader(new InputStreamReader(sfdcConnexion.getInputStream()));
			String result;
			if (sfdcConnection.getResponseCode() == 200) {
				while ((resultat = br.readLine()) != null) {
					System.out.println(resultat);
				}
			} else {
				System.out.println(sfdcConnection.getResponseCode());
			}
		} catch (Exception e) {
			System.out.println(e);
		}

Here is the JSON file :
{
	"records":[
		{"External_ID__c":"1","Name":"Product1"},
		{"External_ID__c":"2","Name":"Product2"}
	]
}

Thanks,
COFFIN Brandon
Hello,
I will try to explain my problem as clearly as possible.
I must create a template for quotes that puts the products in a table but I would like that if the table is not full in height, define a min-height to cover the whole page.
It works fine in HTML put in PDF, I have some problems with the table height.

The code and images might be more clear :
<!-- ******************** START RELATED LIST SECTION UNIQUEID:42********************-->
<style type="text/css">table.table42 {border-collapse:collapse; border-spacing:0px; font-family:Arial,Helvetica,sans-serif; font-size:10px; width:100%; sd:repeatheader;border-spacing:0;border-width: 0;}
.table42header {padding: 5px 10px; border-bottom: 1px solid #808080; border-width: 1px 1px 1px 0;}
.table42col0 {border-right: 1px dotted #808080; border-width: 0 1px 1px 1px;}
.table42col1 {border-right: 1px dotted #808080; border-width: 0 1px 1px 0;}
.table42col2 {border-right: 1px dotted #808080; border-width: 0 1px 1px 0;}
.table42col3 {border-right: 1px dotted #808080; border-width: 0 1px 1px 0;}
.table42col4 {border-right: 1px dotted #808080; text-align: right; border-width: 0 1px 1px 0;}
.table42col5 {border-right: 1px dotted #808080; text-align: right; border-width: 0 1px 1px 0;}
.table42col6 {border-right: 1px dotted #808080; text-align: right; border-width: 0 1px 1px 0;}
.table42col7 {text-align: right; border-width: 0 1px 1px 0;}
</style>
<div style="border: 1px solid #808080;">
<table class="table42" style="min-height: 17.5cm;">
<thead>
<tr>
<th class="table42header" style="border-width: 1px 1px 1px 0;">N&deg; Lig</th>
<th class="table42header">Type r&eacute;ponse</th>
<th class="table42header">R&eacute;f&eacute;rence client</th>
<th class="table42header">Code Article / D&eacute;signation / Description / Marquage</th>
<th class="table42header">Qt&eacute;</th>
<th class="table42header">Masse total Ligne</th>
<th class="table42header">Prix net unitaire HT</th>
<th class="table42header">Montant Net HT Ligne</th>
</tr>
</thead>
<tbody style="vertical-align: bottom;"><!--{{!
<lineitems><class>table42</class>
<listname>emea_adjudications_product_related_list__r</listname>
<column>name</column>
<column>proposal_type__c</column>
<column>customer_product_ref__c</column>
<column>Emea_Product_proposal__r.Emea_Product__r.name</column>
<column>quantity__c</column>
<column>total_weight__c</column>
<column>price__c</column>
<column>total_turnover__c</column>
</lineitems>
}}--></p>
<tr>
<td class="table42col0">&nbsp;</td>
<td class="table42col1">&nbsp;</td>
<td class="table42col2">&nbsp;</td>
<td class="table42col3">&nbsp;</td>
<td class="table42col4">&nbsp;</td>
<td class="table42col5">&nbsp;</td>
<td class="table42col6">&nbsp;</td>
<td class="table42col7">&nbsp;</td>
</tr>
</tbody>
<tfoot>
<tr>
<td colspan="8">
<table style="width: 100%;">
<thead>
<tr>
<th>Masse Totale (kg)</th>
<th>Net HT (EUR)</th>
<th>TVA 21% (EUR)</th>
<th>TTC (EUR)</th>
</tr>
</thead>
<tbody>
<tr>
<td>{{!Opportunity.ajd_total_weight_kg__c #,###.##}}</td>
<td>{{!Opportunity.net_ht_eur__c #,###.##}}</td>
<td>{{!Opportunity.adj_tva_21__c #,###.##}}</td>
<td>{{!Opportunity.adj_to_ttc__c #,###.##}}</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tfoot>
</table>
</div>
<!-- ******************** END RELATED LIST SECTION UNIQUEID:42********************-->

Expected :
Expected

Actual result :
Actual result

Thanks for your answers
Hello,

I'm trying to update children records of an account when this one in edited but I keep having an error.
Here is my condition :
AND(CONTAINS([Account].Owner.Profile.Name, "emea"),
OR(ISPICKVAL([Account].emea_Prescriptor_Type__c , "Aiports Management"),
ISPICKVAL([Account].emea_Prescriptor_Type__c , "Air Base"),
ISPICKVAL([Account].emea_Prescriptor_Type__c , "Airport"),
ISPICKVAL([Account].emea_Prescriptor_Type__c , "Airport Authority"),
ISPICKVAL([Account].emea_Prescriptor_Type__c , "Airport equipment"),
ISPICKVAL([Account].emea_Prescriptor_Type__c , "Army"),
ISPICKVAL([Account].emea_Prescriptor_Type__c , "Aviation"),
ISPICKVAL([Account].emea_Prescriptor_Type__c , "Consultant Company and Architect"),
ISPICKVAL([Account].emea_Prescriptor_Type__c , "Contractor"),
ISPICKVAL([Account].emea_Prescriptor_Type__c , "Naval Base"),
ISPICKVAL([Account].emea_Prescriptor_Type__c , "Parc of exhibition"),
ISPICKVAL([Account].emea_Prescriptor_Type__c , "Port"),
ISPICKVAL([Account].emea_Prescriptor_Type__c , "Port Authority"),
ISPICKVAL([Account].emea_Prescriptor_Type__c , "Port concessionaire"),
ISPICKVAL([Account].emea_Prescriptor_Type__c , "Ports operator")),
[Account].Must_be_visited_by_Airport_Port_Team__c)

The "[Account].Must_be_visited_by_Airport_Port_Team__c" is a boolean type so I don't know why it don't work correctly.
I also have another condition with NOT([Account].Must_be_visited_by_Airport_Port_Team__c) to test if the box is unchecked.

Thanks for your answers
Hello,

I would like to know the best practice for, when a Lead is created, check if one Account have the same email.
I tried with Apex but I'm not having good results.

Thanks for you answers
Hello,

I am working on quotes and I need to retrive information from a custom child object of Product we created.
On the quote record page, when we click on a button, a PDF is generated.
For each product associated to the quote, information are returned from Quote Line Item by a SOQL query.
I would like to retrieve the information I need on the Product child object (one record of this object is associated to only one product).

Here is the query we use :
qlis = [SELECT Id, PriceBookEntry.Product2.Name, Description, Notes__c, UnitPrice, Quantity, TotalPrice, Total_Weight__c, CurrencyIsoCode, Weight__c, PricebookEntry.Product2.ProductKey__c, PricebookEntry.Product2.Item_designation_marking__c FROM QuoteLineItem WHERE QuoteId = :quoteId];

User-added image
What is the best way to do this ? I would like to do this in only one query but I don't think it is possible.
Hello,

I have an issue on a lookup (with a field filter) field visibility on a profile. I checked multiple times, the field security level is correct, the profile can see the field and the custom object where the informations are stored.

Can you help me ?
 
Thanks,
Hello,

I have a problem with my Java rest API request.
I would like to have the full JSON response, I explain.

For example, in Java, here is what I have for response code :
400

And for response message :
Bad request

Using something else, the code is the same but the message is :
Item designation/marking: data value too large: DECOR ENTIER \&quot;COMMUNE DE CONTHEY+EAUX CLAIRES\&quot; 400KN (max length=60)

This is what I would like to have in Java, using HttpURLConnection.

How can I do this ?

Thank you,
COFFIN Brandon
Hello,

I'm trying to update children records of an account when this one in edited but I keep having an error.
Here is my condition :
AND(CONTAINS([Account].Owner.Profile.Name, "emea"),
OR(ISPICKVAL([Account].emea_Prescriptor_Type__c , "Aiports Management"),
ISPICKVAL([Account].emea_Prescriptor_Type__c , "Air Base"),
ISPICKVAL([Account].emea_Prescriptor_Type__c , "Airport"),
ISPICKVAL([Account].emea_Prescriptor_Type__c , "Airport Authority"),
ISPICKVAL([Account].emea_Prescriptor_Type__c , "Airport equipment"),
ISPICKVAL([Account].emea_Prescriptor_Type__c , "Army"),
ISPICKVAL([Account].emea_Prescriptor_Type__c , "Aviation"),
ISPICKVAL([Account].emea_Prescriptor_Type__c , "Consultant Company and Architect"),
ISPICKVAL([Account].emea_Prescriptor_Type__c , "Contractor"),
ISPICKVAL([Account].emea_Prescriptor_Type__c , "Naval Base"),
ISPICKVAL([Account].emea_Prescriptor_Type__c , "Parc of exhibition"),
ISPICKVAL([Account].emea_Prescriptor_Type__c , "Port"),
ISPICKVAL([Account].emea_Prescriptor_Type__c , "Port Authority"),
ISPICKVAL([Account].emea_Prescriptor_Type__c , "Port concessionaire"),
ISPICKVAL([Account].emea_Prescriptor_Type__c , "Ports operator")),
[Account].Must_be_visited_by_Airport_Port_Team__c)

The "[Account].Must_be_visited_by_Airport_Port_Team__c" is a boolean type so I don't know why it don't work correctly.
I also have another condition with NOT([Account].Must_be_visited_by_Airport_Port_Team__c) to test if the box is unchecked.

Thanks for your answers
Hello,

I would like to know the best practice for, when a Lead is created, check if one Account have the same email.
I tried with Apex but I'm not having good results.

Thanks for you answers