• edoardo_spano
  • NEWBIE
  • 125 Points
  • Member since 2012

  • Chatter
    Feed
  • 3
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 18
    Questions
  • 29
    Replies
Hi,

I am getting the following error in my vf page , its an inline vf page which captures the old status value and the new changed status value  from team form__c object

i have enabled the field history trakcing for that field where i am quering from team form history object




let me know what i am doing wrong here

MY VF PAGE :

<apex:page standardController="Team_Form__c"  extensions="CycleTimeSubstatusCalulation" tabStyle="Team_Form__c" sidebar="false" showHeader="false">

<apex:form >


<apex:pageblock title="EMEA SaSu Cycle-Time"  >

<apex:pageblockSection collapsible="true" showHeader="false"  columns="3"   >

<apex:outputText style="font-weight:700" value="Initial sub-status :{!gpsTeamForm.OldValue}"/>
<apex:outputText style="font-weight:700" value="New Sub-status :"/>
<apex:outputText style="font-weight:700" value="CycleTime :"/>


</apex:pageblockSection>
</apex:pageblock>

</apex:form>
</apex:page>

My controller :

public class CycleTimeSubstatusCalulation{

public  Team_Form__History  gpsTeamForm {get;set;}
//public  Team_Form__c  gpsTeamForms;

public CycleTimeSubstatusCalulation(ApexPages.StandardController controller) {
//gpsTeamForms= (Team_Form__c)controller.getRecord();
gpsTeamForm =[SELECT Id ,CreatedDate,Field,NewValue,OldValue,ParentId FROM Team_Form__History WHERE Id = :ApexPages.currentPage().getParameters().get('id') and   Field = 'SubStatus__c'];
    
    
    }

 






}


Kindly help me pls , i am struck

Thanks in Advance
when i use SeeAllData=true on test class, can able to query the records from org, and able to insert, update but not able to delete, why ?
see the below test class after delete statement assert statement is failing, can you please look into this .....  
@IsTest(SeeAllData=true)
private class TestClassOnVenkat{
  static testmethod void InsertRec(){
   venkat__c a=[select id,name from venkat__c where name='name value'];
   Venkat__c b=a.clone();
   b.name='cloneed name value';
   Test.startTest();
   insert b;
   venkat__c c=[select id,name from venkat__c where name='cloneed ZZZZZ'];
   System.assert(c != Null);   
   c.name='Update name value';
   update c;
   System.assert(c.name=='cloneed name value');   
   delete c;
   System.assert(c == null);   
   Test.stopTest();  
  }
}

Thanks
  • May 13, 2015
  • Like
  • 0
Hi All,

I'm getting a null value on a lookup field when running a test class.
 
Account a = new Account(Name = '1', Owner = u, CurrencyIsoCode = 'CAD');
        insert a;
		a = [SELECT id, AccountNumber, Name, CurrencyIsoCode, Related_Billing_Contract__c FROM account WHERE id = :a.id];

		Billing_Contract__c bc = new Billing_Contract__c(Account__c = a.id, Active__c = TRUE, Annual_Increase_Amount__c = 0.03, Billing_Frequency__c = 'Annually');
		insert bc;
		bc = [SELECT id FROM Billing_Contract__c WHERE id = :bc.id];

		a.Related_Billing_Contract__c = bc.id;
		update a;

		a = [SELECT id, AccountNumber, Name, CurrencyIsoCode, Related_Billing_Contract__c FROM account WHERE id = :a.id];

		System.debug('Related_Billing_Contract__c: ' + a.Related_Billing_Contract__c);
        
        Opportunity o = new Opportunity(Name = '2', GSS_Rep__c = g.id, Account = a, StageName = 'No Status', CloseDate = System.today(), Amount = 1, Type = 'New Implementation', License_Model__c = 'Perpetual', Owner = u, Sales_Rep2__c = s.id, Pricebook2Id = p.id, CurrencyIsoCode = 'CAD', Intall_Date_Opp__c = system.today(), Milestone_Trigger__c = 'Installation', Payment_Terms_Drop__c = '30 Days on Order');
        insert o;

        o = [SELECT id, AccountId, Account.AccountNumber, Account.Related_Billing_Contract__c, Account.Name, Name, Service_Value_No_Milesotne__c, CurrencyIsoCode, Software_Value_No_Milestone__c, Account.Id, Account.Licensing_Model__c, type, Service_Days__c FROM opportunity WHERE id = :o.id];

        System.debug('o.account.Related_Billing_Contract__c: ' + o.Account.Related_Billing_Contract__c);

My initial Debug returns an ID for the Account.Related_Billing_Contract__c, but when I go through the Opportunity to find the same value (Opportunity.Account.Related_Billing_Contract__c) I am getting NULL returned. Any help?
Hi all,
I've built a visualforce page with renderAs="pdf".
Inside this page I want to insert a table which has cells with rgba background-color, because I need to set the opacity of the background.

This is the HTML:
<table class="riepilogo">
	<tbody>
		<tr>
			<td>Demolizioni rimozioni scavi e trasporti</td>
			<td>&#9679;</td>
			<td>15.719,40</td>
		</tr>
		....
	</tbody>
</table>

This is the CSS:
table.riepilogo tbody tr td {
	background-color: rgba(229, 106, 84, 0.1);
}

When I run the page, the cells background-color doesn't appear.
If I change it in rgb (i.e. rgb(229, 106, 84)), it works.

Is there a way to set the background-color with rgba?

Thank you in advance.
Edoardo
Hi all,
I built a component, which has a function that create a component with the function $A.createComponent, but I get an error when I try to call the function for the second time.

This is the error: Uncaught rerender threw an error in 'markup://c:QuotePath' [rerender threw an error in 'markup://aura:expression' [TypeError: Cannot read property 'childNodes' of null]]

This is the function mentioned above:
showModal : function (component, event) {
	var eventTarget = event.target;
	if(eventTarget.tagName == "SPAN") eventTarget = eventTarget.parentElement;
	var toggleEnabled = eventTarget.dataset.active != "false";
	if(toggleEnabled) {
		$A.createComponent(
			"c:ModalStatoPreventivazione",
			{
				"aura:id"	: eventTarget.dataset.modalid+"-container",
				"recordId"	: component.get("v.recordId")
			},
			function(newModal) {
				if (component.isValid()) {
					var body = component.get("v.body");
					body.push(newModal);
					component.set("v.body", body);
				}
			}
		);
	}
},

Can someone give a solution for this issue?

Thanks in advance
Best regards
Edoardo
Hi all,

I wrote this lines inside a lightning component:
<aura:iteration items="{!v.items}" var="item">
	<tr class="slds-hint-parent">
		<th scope="row">
			<div class="slds-truncate">{!item.voce.Listino_fornitore__r.Articolo__r.Name}</div>
		</th>
		<td>{!item.voce.Listino_fornitore__r.Unita_di_misura__c}</td>
		<td class="slds-text-align--right"><ui:outputNumber value="{!item.voce.Quantita__c}"/></td>
		<td class="slds-text-align--right"><ui:outputCurrency value="{!item.voce.Listino_fornitore__r.Prezzo__c}"/></td>
		<td class="slds-text-align--right"><ui:outputCurrency value="{!item.voce.Listino_fornitore__r.Prezzo_scontato__c}"/></td>
		<td class="slds-text-align--right"><ui:inputNumber value="{!item.voce.Listino_cliente__r.Ricarico__c}"/></td>
		<td></td>
	</tr>
</aura:iteration>
All appear correctly, but if I try to change the value of the ui:inputNumber, it is automatically override by the old value.

I tried to remove the aura:iteration and get just the first two elements of the array "v.items", like this:
<tr class="slds-hint-parent">
	<th scope="row">
		<div class="slds-truncate">{!v.items[0].voce.Listino_fornitore__r.Articolo__r.Name}</div>
	</th>
	<td>{!v.items[0].voce.Listino_fornitore__r.Unita_di_misura__c}</td>
	<td class="slds-text-align--right"><ui:outputNumber value="{!v.items[0].voce.Quantita__c}"/></td>
	<td class="slds-text-align--right"><ui:outputCurrency value="{!v.items[0].voce.Listino_fornitore__r.Prezzo__c}"/></td>
	<td class="slds-text-align--right"><ui:outputCurrency value="{!v.items[0].voce.Listino_fornitore__r.Prezzo_scontato__c}"/></td>
	<td class="slds-text-align--right"><ui:inputNumber value="{!v.items[0].voce.Listino_cliente__r.Ricarico__c}"/></td>
	<td></td>
</tr>
<tr class="slds-hint-parent">
	<th scope="row">
		<div class="slds-truncate">{!v.items[1].voce.Listino_fornitore__r.Articolo__r.Name}</div>
	</th>
	<td>{!v.items[1].voce.Listino_fornitore__r.Unita_di_misura__c}</td>
	<td class="slds-text-align--right"><ui:outputNumber value="{!v.items[1].voce.Quantita__c}"/></td>
	<td class="slds-text-align--right"><ui:outputCurrency value="{!v.items[1].voce.Listino_fornitore__r.Prezzo__c}"/></td>
	<td class="slds-text-align--right"><ui:outputCurrency value="{!v.items[1].voce.Listino_fornitore__r.Prezzo_scontato__c}"/></td>
	<td class="slds-text-align--right"><ui:inputNumber value="{!v.items[1].voce.Listino_cliente__r.Ricarico__c}"/></td>
	<td></td>
</tr>
In this way all works fine (new values is not override), but I need to maintain the aura:iteration because I don't know how many elements there are in the array.

Can someone help me?

Thanks in advance.
Edoardo
Hi all,

since Spring '16 release, it is no longer possible to include javascript in "Messages & Alert" and "Custom Links" home page components.
Currently it seems that there are no workaround to face this change.
It is still possible to include javascript in a Visualforce home page component, but this code isn't able to interact with the rest of the page as Visualforce home page components are served in a different domain.

Someone knows a working workaround for this problem?

Thanks in advance.
Regards
Hi All,

I'm trying to replicate the standard "Send notification email to contact" checkbox, visible in the bottom of the Case edit page layout, in a custom Visualforce page.
If the user puts this flag, an email will be sent to the contact related to the case and this action will be historized as completed task, both in creation and editing.

I'm trying setting the "triggerAutoResponseEmail" parameter of the DMLOption class and passing this option in the update command.
This is my code:
public with sharing class MyController {

	private Case c;
	public Boolean sendEmail {get; set;}

	public MyController(ApexPages.StandardController ctrl) {
		c = (Case) ctrl.getRecord();
		sendEmail = false;
	}

	public PageReference save() {
		try {
			Database.DMLOptions dmo = new Database.DMLOptions();
			if(sendEmail) dmo.EmailHeader.triggerAutoResponseEmail = true;
			Database.update(c, dmo);
		} catch (Exception e) {}
	}

}

This code doesn't work because the parameter "triggerAutoResponseEmail" sends an email only after the case creation and not after editing.
How can I replicate the standard "Send notification email to contact" checkbox functionality via Apex?

Thank you in advance.
Edoardo
Hi all,

can I enable the call center for partner community users?

In the call center detail page I click on "Manage Call Center Users", then I click on "Add More Users".
If I click on button "Find" without apply filters, I see only users with "Salesforce" as user license.

Thank you in advance.
Edoardo
Hi all,

I'm trying to write the below formula in a boolean formula field:
INCLUDES($User.Roles__c,Involved_Role__c)

Roles__c is a multiselect picklist. Involved_Role__c is a text field.

When I try to save the system throw this exception:
Error: Incorrect parameter type for function 'INCLUDES()'. Expected Text Literal, received Text

I tried to use the TEXT function on Involved_Role__c field, but it doesn't work.

How can I troubleshoot this issue?

Thanks in advance.
Edoardo
Hi all,

I need to redirect some users (all with the same profile) to a Force.com Site that I already developed.
I create a login flow with the variable "LoginFlow_FinishLocation" set to the Site URL.
This works all fine.

My trouble is that I want redirect directly, without oblige users click on the "Finish" button.

Can someone please help me?

Thanks in advance.
Hi All,

there's a way to set the Finish Location to a login flow?

I've seen that this is possible including the flow in a Visualforce page, but this is not possibile (as far as I know) with login flows.

Thanks in advance.
Hi all,

Is this Opportunity Stage Storyline a new feature? Or is it a customization?

Opportunity Detail Page

Thaks in advance.
 
Hi All,

I need to create a PDF that must show two copies of the same document: one copy for the customer and one copy for the company.
These two documents are the same except for the header: into the header is specified if the copy is for the customer or for the company.

During my fisrt attempt I structured the page in this way:
<apex:page renderAs="pdf">
    <div class="header"></div>
    <div class="content">
        <!-- content for the customer's copy -->
        <div style="page-break-after: always;"></div>
        <!-- same content for the company's copy -->
    </div>
    <div class="footer"></div>
</apex:page>

But in this way the header it's the same for all the pages.

So, I created a Visualforce Component with a dynamic header, like this:
<apex:component>
    <apex:attribute name="isCustomerCopy" description="Specify if this copy is for the Customer" type="Boolean" required="true"/>

    <div class="header>
        <apex:outputLabel value="Customer's copy" rendered="{!isCustomerCopy}"/>
        <apex:outputLabel value="Company's copy" rendered="{!NOT(isCustomerCopy)}"/>
    <div>
    <div class="content"> <!-- content only once --> </div>
    <div class="footer"></div>
</apex:component>

Then I modified the visualforce page like this:
<apex:page renderAs="pdf">
    <c:MyComponent isCustomerCopy="true"/>
    <c:MyComponent isCustomerCopy="false"/>
</apex:page>

Now the header it's correct, but the two components result overlapped.

Does anyone have a solution for my problem?

Thanks in advance
Hi all,

I need to define an Email Template selectable from the standard "Send Email" button.
This Email Temaplate must have both HTML header and HTML footer, because there are some links and images, but the user must be able to insert his own text body.
Which kind of Email Template I have to use to do how I wish?

Thanks in advance.
Hi all,

I need to sort an apex:dataTable, but I have a Professional Edition environment, so I can't write APEX code.
There is a way to do this?

Thanks in advance

Hi All,

I need to access to the list of countries and their states, defined into the Territory Management, via Apex.

I just need to create a Visualforce Page for a custom object, that has the address fields and I want keep the same values of Account.

Do you have a solution for this issue?

Thanks in advance

Hi All,

I need to manage a list of Accounts with Javascript, inside a Visualforce page.

I retrieved the accounts with a SOQL query and saved the result in a public List<Account>.
When I try to assign the list at a Javascript variable, the system retrieves this error message:

Uncaught SyntaxError: Unexpected token ILLEGAL

I just tried to assign the list in this way: var accounts = {!accns};

After this assignment, I need to read an information saved in a field for each account, but I don't know how I can access at that field.

Someone can help me about these issues?

Thanks in advance
Hi all,

I have a custom object with Opportunity as parent object.
When a new record of this custom object is created, a trigger updates the Stage of the opportunity, but the Probability doesn't updated.

Example:

These are the Opportunity's Stages:
- Stage1 (10%)
- Stage2 (30%)
- Stage3 (70%)
- Stage4 (100%)

The opportunity "OPP1" now is in "Stage2" and has Probability=30%. After inserting the record "CO1" as child record of "OPP1", the stage of "OPP1" is updated in "Stage3", but its Probability is still 30%.

Someone can explain to me the reason of this behavior.

Thanks in advance.
Hi All,

In the standard homepage I've inserted a custom HTML component that contains an iframe to a Visualforce Page.
In this page I've inserted a button.
I would that when the button is clicked, the homepage is redirected to another page, and not the iframe as is now.

How I accomplish it.

Thanks in advance.
Hi to all,

I have created a visualforce page rendered as "PDF".
In the content div (body) there is a table that may have "infinite" rows.
When there are too rows, the table is extended in multiple page, but the header is not repeated for each page.

How may I accomplish it?

Thanks in advance.
Hi All,

I'm trying to replicate the standard "Send notification email to contact" checkbox, visible in the bottom of the Case edit page layout, in a custom Visualforce page.
If the user puts this flag, an email will be sent to the contact related to the case and this action will be historized as completed task, both in creation and editing.

I'm trying setting the "triggerAutoResponseEmail" parameter of the DMLOption class and passing this option in the update command.
This is my code:
public with sharing class MyController {

	private Case c;
	public Boolean sendEmail {get; set;}

	public MyController(ApexPages.StandardController ctrl) {
		c = (Case) ctrl.getRecord();
		sendEmail = false;
	}

	public PageReference save() {
		try {
			Database.DMLOptions dmo = new Database.DMLOptions();
			if(sendEmail) dmo.EmailHeader.triggerAutoResponseEmail = true;
			Database.update(c, dmo);
		} catch (Exception e) {}
	}

}

This code doesn't work because the parameter "triggerAutoResponseEmail" sends an email only after the case creation and not after editing.
How can I replicate the standard "Send notification email to contact" checkbox functionality via Apex?

Thank you in advance.
Edoardo
Hi all,

can I enable the call center for partner community users?

In the call center detail page I click on "Manage Call Center Users", then I click on "Add More Users".
If I click on button "Find" without apply filters, I see only users with "Salesforce" as user license.

Thank you in advance.
Edoardo
Hi all,

I'm trying to write the below formula in a boolean formula field:
INCLUDES($User.Roles__c,Involved_Role__c)

Roles__c is a multiselect picklist. Involved_Role__c is a text field.

When I try to save the system throw this exception:
Error: Incorrect parameter type for function 'INCLUDES()'. Expected Text Literal, received Text

I tried to use the TEXT function on Involved_Role__c field, but it doesn't work.

How can I troubleshoot this issue?

Thanks in advance.
Edoardo
In Trigger context variable only available after undelete, but not there before undelete,  want to know what is the reasion behind that ?

can you have knowledge on this pls help me ...

Thanks
 
  • May 15, 2015
  • Like
  • 0
How to write a query on Recycle bin ?
like want to know how many records is there in recycle bin ..


Thanks


 
  • May 15, 2015
  • Like
  • 0
Hi all,

I need to redirect some users (all with the same profile) to a Force.com Site that I already developed.
I create a login flow with the variable "LoginFlow_FinishLocation" set to the Site URL.
This works all fine.

My trouble is that I want redirect directly, without oblige users click on the "Finish" button.

Can someone please help me?

Thanks in advance.
Hi,

I am getting the following error in my vf page , its an inline vf page which captures the old status value and the new changed status value  from team form__c object

i have enabled the field history trakcing for that field where i am quering from team form history object




let me know what i am doing wrong here

MY VF PAGE :

<apex:page standardController="Team_Form__c"  extensions="CycleTimeSubstatusCalulation" tabStyle="Team_Form__c" sidebar="false" showHeader="false">

<apex:form >


<apex:pageblock title="EMEA SaSu Cycle-Time"  >

<apex:pageblockSection collapsible="true" showHeader="false"  columns="3"   >

<apex:outputText style="font-weight:700" value="Initial sub-status :{!gpsTeamForm.OldValue}"/>
<apex:outputText style="font-weight:700" value="New Sub-status :"/>
<apex:outputText style="font-weight:700" value="CycleTime :"/>


</apex:pageblockSection>
</apex:pageblock>

</apex:form>
</apex:page>

My controller :

public class CycleTimeSubstatusCalulation{

public  Team_Form__History  gpsTeamForm {get;set;}
//public  Team_Form__c  gpsTeamForms;

public CycleTimeSubstatusCalulation(ApexPages.StandardController controller) {
//gpsTeamForms= (Team_Form__c)controller.getRecord();
gpsTeamForm =[SELECT Id ,CreatedDate,Field,NewValue,OldValue,ParentId FROM Team_Form__History WHERE Id = :ApexPages.currentPage().getParameters().get('id') and   Field = 'SubStatus__c'];
    
    
    }

 






}


Kindly help me pls , i am struck

Thanks in Advance
when i use SeeAllData=true on test class, can able to query the records from org, and able to insert, update but not able to delete, why ?
see the below test class after delete statement assert statement is failing, can you please look into this .....  
@IsTest(SeeAllData=true)
private class TestClassOnVenkat{
  static testmethod void InsertRec(){
   venkat__c a=[select id,name from venkat__c where name='name value'];
   Venkat__c b=a.clone();
   b.name='cloneed name value';
   Test.startTest();
   insert b;
   venkat__c c=[select id,name from venkat__c where name='cloneed ZZZZZ'];
   System.assert(c != Null);   
   c.name='Update name value';
   update c;
   System.assert(c.name=='cloneed name value');   
   delete c;
   System.assert(c == null);   
   Test.stopTest();  
  }
}

Thanks
  • May 13, 2015
  • Like
  • 0
Hello Fellows,

we want to include Kuwaiti Dinar are Currency into our environment. Obviously this currency requires 3 digits to be shown instead of the regular 2 digits.
Is there any way that the standard currency fields can be extended to show also the 3 digits as well in order e.g. to show a good price on a opportunity?

Support and ideas are highly appreciated