• Uves Ravat
  • NEWBIE
  • 0 Points
  • Member since 2012

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 17
    Questions
  • 18
    Replies

Hi,

 

I have a component that is linked to a visualforce page. I am trying to get the image field dynamically but even though there is a link on that field its not returning back the image.

 

The code is below:

<apex:outputpanel rendered="{!isEmailFlag == true}">
<c:pdfHeaderFooter type="header" position="center">
<apex:image url="{!obj['c2g__OwnerCompany__r']['c2g__LogoURL__c']}" alt="LOGO HERE" />
</c:pdfHeaderFooter>
</apex:outputpanel>

 

What is wrong with the above code please.

 

Thanks

PR

Hi,

 

Just wanted to know if it possible to have one visualforce template but in different languages depending on the company/account i am using?

 

Thanks in advance

 

 

Hi,

 

I am not sure this is due to Visualforce page or Apex code but i have input field thats allows me to input some text in. for example if i type in "s" it gives me all the string i have used containing "s". the problem is that My Recent Items doesnt disappear after i select what string i want?

 

Any reasons why?

 

Thanks

Hi,

 

Currently i am sending emails with PDF Attachments. The problem is the user cant edit PDF file so i wanted if possible to still send the PDF file but the data inside the PDF should be also show on the actual email. is that possible?

 

This is my current code

 

			Messaging.SingleEmailMessage email = new Messaging.SingleEmailMessage(); 
	
			// Reference the attachment page and pass in the account ID
			PageReference pdf =  Page.attachmentProposal;
			pdf.getParameters().put('id',(String)myProjectId );
			pdf.setRedirect(true);
			
			// Take the PDF content
			Blob b = pdf.getContent();
	
			// Create the email attachment
			Messaging.EmailFileAttachment efa = new Messaging.EmailFileAttachment();
			efa.setFileName(proposalFile);
			efa.setBody(b);
	
			// Adddress
			String [] toAddresses = new String[] {address};
	 
			// Sets the paramaters of the email 
			email.setSubject(subject );
			email.setToAddresses( toAddresses );
			email.setPlainTextBody('refer attached PDF :');
			email.setFileAttachments(new Messaging.EmailFileAttachment[] {efa});  
			Messaging.SendEmailResult [] r =   Messaging.sendEmail(new Messaging.SingleEmailMessage[] {email});   

 

Thanks

 

Hi.

 

If anyone can help me that would be great. I want a error message appear on the screen to say project is locked if a variable is true. Below

 

    public void updatingProjectProposalHeader()
    {
        SObject ErrorMessage;
        if (m_ProposalLocked)
        {
           // if its true, i want it to display on the screen that project it locked.
        }
    }

 

if have tried the following code, the error message is very ugly.

 

	public void updatingProjectProposalHeader()
	{
		if (m_ProposalLocked)
		{
			throw new lockProposalException ('Proposal Locked');
		}
	}

	public class lockProposalException extends Exception{}

 Thanks

 

Hi,

 

I have trigger that runs if i change any details of any fields in my Tax object. I have two field Tax Value 1 and Tax Value 2. if i do any changes that would affect any values i want a message box appearing say that Value 1 doesnt match value two. if it does it should give the user two options update the value 2 (for example) by one button or dont update value two 

 

Thanks

Uves

(want it like message error box in java)

Hi

 

Is it possible to stop a user from updating/deleting a record when a certain checkbox is true?

For example i have field approved. if the field is false, user can edit that record but if its true they cant?

Probably have to use a trigger and see if approved field is false then allow update and true not but i cant put it in code?

 

thanks

Uves

Hi,

 

Is there is anyway i can hide a field in edit mode and not in page layout. its a v-lookup field

 

Thanks

 

Uves

Hi

 

I am trying to create an image on the tab as followers:

 

 

I have used the following code but the image doesnt appear. any reason why?

 

 #navigation ul li a {
     background-image:url({!$Resource.norm_right}) no-repeat 100% 0;
     color: #06C;
     padding: 5px 0;
     text-decoration: none;
 }

 

Thanks

 

Hi

 

I have been trying to use the following method doesnt work. Here is the code

 

	public static String padRight(String s, integer n) {
		
		return String.format('%1$-' + n + 's', s);  
}

 I am trying to pad my strings.

 

for example if i have two words from and yesterday, i want pad from so from would be fromxxxxx. i want the padding on every word in the list to make all the words in the string have the same characters, Like in this example from and yesterday would have the same number of characters

 

Thanks

Uves

Hi,

 

i am having an error with this. it says field expression not allowed for generic sobject

 

the code is 

 

			for (SObject subDynamInvoice : dynamInvoice.c2g__PurchaseInvoiceLineItems__r )
			{
				mapOfInvoiceNameToInvoice2.put(invName, subDynamInvoice );
			}

 

Thanks

Hi. I have been trying to make the following code dynamic but it kept on failing?

 

Any help?

journal.Enquiry_Token__c = mappedJournals.get(journal.c2g__Reference__c).Enquiry_Token__c;
journal.End_Date__c = mappedJournals.get(journal.c2g__Reference__c).End_Date__c;
journal.Start_Date__c = mappedJournals.get(journal.c2g__Reference__c).Start_Date__c;
journal.SITS_Old_and_New_Number__c = mappedJournals.get(journal.c2g__Reference__c).SITS_Old_and_New_Number__c;
journal.Sage_QB_Account__c = mappedJournals.get(journal.c2g__Reference__c).Sage_QB_Account__c;

 Thanks

Hi,

 

How can i make this soqgl query more efficent so i dont hit any govner limits

 

        String query;
        if(contractIds == null || contractIds.size() == 0)
            query = 'Select id FROM Ceto_Contract__c WHERE (Status__c = :statusActive OR Status__c = :statusPending) AND (Contract_Expiration_Date__c > :runDate OR Contract_Expiration_Date__c = null) AND (Cancellation_Date__c > :runDate OR Cancellation_Date__c = null)';
            
        if(Test.isRunningTest())
            query += ' limit 1';
        return query;

 

Thanks

<apex:page showheader="false" sidebar="false" controller="searchFlightsController" standardstylesheets="false">
<apex:form style="font-size:13pt">
<h1 style="text-align:center;color:black;"> Search for Flights </h1>
<apex:pageBlock title="Search for Flights">
<apex:pageblockSection >
<apex:inputField value="{!flight.departureCountry__c}" /><br/>
<apex:inputField value="{!flight.Departure__c}" />
<apex:inputField value="{!flight.destinationCountry__c}" /><br/>
<apex:inputField value="{!flight.Destination__c}" />
<apex:inputField value="{!flight.dayOfDeparture__c}"/><br/>
<apex:inputField value="{!flight.timeOfDeparture__c}" />
<apex:inputField value="{!flight.dayOfArrival__c}" /><br/>
<apex:inputField value="{!flight.timeOfArrival__c}" /><br/>
<apex:commandButton rerender="FlightsDetail" action="{!searchFlights}" value="Search for Flights">
<apex:param value="{!flight.dayOfDeparture__c}" assignTo="{!dayOfDep}"/>
</apex:commandButton>
</apex:pageblockSection>
<apex:pageblockSection >
<apex:outputPanel id="FlightsDetail">
<apex:repeat value="{!flightsResult}" var="flightres">
<p>{!flightres.timeOfArrival__c} </p>
</apex:repeat>
</apex:outputPanel>
</apex:pageblockSection>
</apex:pageBlock>
</apex:form>
</apex:page>

 

Hi, i am having an error assigning the day the user selects (from a list) from a visualforce page. Whatever the day the user selects i want to use it in my controller. the problem is the value is always null. Any helps what i am doing wrong. (higlighted red whats not working) If i make the value monday it works. so i am not getting the value what the user selects i think

 

Thanks

Hi, i am creating page breaks between serveral invoices. This is currently working but the problem is that it always create a blank page at the end...how can i avoid this.

 

here is the code i have using. for example if i have 4 invoice page it creates 5 pages

 

<apex:repeat value="{!invoicePageList}" var="invoicePage">
<c:SalesInvoicePage4 salesInvoicePage="{!invoicePage}" />
<div style="page-break-before: always;">&nbsp;</div>
</apex:repeat>

Hi,

 

I want to know how i can open another visualforce page from a visualforce page by the use of button.

The first visualforce page i am using i am adding a contact to database which will have a unique id. when i add the user to the database it should open another visualforce to show the details i have added to the database.

 

Thank You

Hi, 

 

I want to create trigger or class that will only allow the user to create credit note per invoice and also make sure for every invoice there is matching credit note.

 

Any help???

 

Cheers

Hi,

 

I have a component that is linked to a visualforce page. I am trying to get the image field dynamically but even though there is a link on that field its not returning back the image.

 

The code is below:

<apex:outputpanel rendered="{!isEmailFlag == true}">
<c:pdfHeaderFooter type="header" position="center">
<apex:image url="{!obj['c2g__OwnerCompany__r']['c2g__LogoURL__c']}" alt="LOGO HERE" />
</c:pdfHeaderFooter>
</apex:outputpanel>

 

What is wrong with the above code please.

 

Thanks

PR

Hi,

 

Currently i am sending emails with PDF Attachments. The problem is the user cant edit PDF file so i wanted if possible to still send the PDF file but the data inside the PDF should be also show on the actual email. is that possible?

 

This is my current code

 

			Messaging.SingleEmailMessage email = new Messaging.SingleEmailMessage(); 
	
			// Reference the attachment page and pass in the account ID
			PageReference pdf =  Page.attachmentProposal;
			pdf.getParameters().put('id',(String)myProjectId );
			pdf.setRedirect(true);
			
			// Take the PDF content
			Blob b = pdf.getContent();
	
			// Create the email attachment
			Messaging.EmailFileAttachment efa = new Messaging.EmailFileAttachment();
			efa.setFileName(proposalFile);
			efa.setBody(b);
	
			// Adddress
			String [] toAddresses = new String[] {address};
	 
			// Sets the paramaters of the email 
			email.setSubject(subject );
			email.setToAddresses( toAddresses );
			email.setPlainTextBody('refer attached PDF :');
			email.setFileAttachments(new Messaging.EmailFileAttachment[] {efa});  
			Messaging.SendEmailResult [] r =   Messaging.sendEmail(new Messaging.SingleEmailMessage[] {email});   

 

Thanks

 

Hi.

 

If anyone can help me that would be great. I want a error message appear on the screen to say project is locked if a variable is true. Below

 

    public void updatingProjectProposalHeader()
    {
        SObject ErrorMessage;
        if (m_ProposalLocked)
        {
           // if its true, i want it to display on the screen that project it locked.
        }
    }

 

if have tried the following code, the error message is very ugly.

 

	public void updatingProjectProposalHeader()
	{
		if (m_ProposalLocked)
		{
			throw new lockProposalException ('Proposal Locked');
		}
	}

	public class lockProposalException extends Exception{}

 Thanks

 

Hi

 

Is it possible to stop a user from updating/deleting a record when a certain checkbox is true?

For example i have field approved. if the field is false, user can edit that record but if its true they cant?

Probably have to use a trigger and see if approved field is false then allow update and true not but i cant put it in code?

 

thanks

Uves

Hi

 

I am trying to create an image on the tab as followers:

 

 

I have used the following code but the image doesnt appear. any reason why?

 

 #navigation ul li a {
     background-image:url({!$Resource.norm_right}) no-repeat 100% 0;
     color: #06C;
     padding: 5px 0;
     text-decoration: none;
 }

 

Thanks

 

Hi

 

I have been trying to use the following method doesnt work. Here is the code

 

	public static String padRight(String s, integer n) {
		
		return String.format('%1$-' + n + 's', s);  
}

 I am trying to pad my strings.

 

for example if i have two words from and yesterday, i want pad from so from would be fromxxxxx. i want the padding on every word in the list to make all the words in the string have the same characters, Like in this example from and yesterday would have the same number of characters

 

Thanks

Uves

Hi,

 

i am having an error with this. it says field expression not allowed for generic sobject

 

the code is 

 

			for (SObject subDynamInvoice : dynamInvoice.c2g__PurchaseInvoiceLineItems__r )
			{
				mapOfInvoiceNameToInvoice2.put(invName, subDynamInvoice );
			}

 

Thanks

Hi,

 

How can i make this soqgl query more efficent so i dont hit any govner limits

 

        String query;
        if(contractIds == null || contractIds.size() == 0)
            query = 'Select id FROM Ceto_Contract__c WHERE (Status__c = :statusActive OR Status__c = :statusPending) AND (Contract_Expiration_Date__c > :runDate OR Contract_Expiration_Date__c = null) AND (Cancellation_Date__c > :runDate OR Cancellation_Date__c = null)';
            
        if(Test.isRunningTest())
            query += ' limit 1';
        return query;

 

Thanks

<apex:page showheader="false" sidebar="false" controller="searchFlightsController" standardstylesheets="false">
<apex:form style="font-size:13pt">
<h1 style="text-align:center;color:black;"> Search for Flights </h1>
<apex:pageBlock title="Search for Flights">
<apex:pageblockSection >
<apex:inputField value="{!flight.departureCountry__c}" /><br/>
<apex:inputField value="{!flight.Departure__c}" />
<apex:inputField value="{!flight.destinationCountry__c}" /><br/>
<apex:inputField value="{!flight.Destination__c}" />
<apex:inputField value="{!flight.dayOfDeparture__c}"/><br/>
<apex:inputField value="{!flight.timeOfDeparture__c}" />
<apex:inputField value="{!flight.dayOfArrival__c}" /><br/>
<apex:inputField value="{!flight.timeOfArrival__c}" /><br/>
<apex:commandButton rerender="FlightsDetail" action="{!searchFlights}" value="Search for Flights">
<apex:param value="{!flight.dayOfDeparture__c}" assignTo="{!dayOfDep}"/>
</apex:commandButton>
</apex:pageblockSection>
<apex:pageblockSection >
<apex:outputPanel id="FlightsDetail">
<apex:repeat value="{!flightsResult}" var="flightres">
<p>{!flightres.timeOfArrival__c} </p>
</apex:repeat>
</apex:outputPanel>
</apex:pageblockSection>
</apex:pageBlock>
</apex:form>
</apex:page>

 

Hi, i am having an error assigning the day the user selects (from a list) from a visualforce page. Whatever the day the user selects i want to use it in my controller. the problem is the value is always null. Any helps what i am doing wrong. (higlighted red whats not working) If i make the value monday it works. so i am not getting the value what the user selects i think

 

Thanks

Hi, i am creating page breaks between serveral invoices. This is currently working but the problem is that it always create a blank page at the end...how can i avoid this.

 

here is the code i have using. for example if i have 4 invoice page it creates 5 pages

 

<apex:repeat value="{!invoicePageList}" var="invoicePage">
<c:SalesInvoicePage4 salesInvoicePage="{!invoicePage}" />
<div style="page-break-before: always;">&nbsp;</div>
</apex:repeat>

Hi,

 

I want to know how i can open another visualforce page from a visualforce page by the use of button.

The first visualforce page i am using i am adding a contact to database which will have a unique id. when i add the user to the database it should open another visualforce to show the details i have added to the database.

 

Thank You