• ssousan
  • NEWBIE
  • 0 Points
  • Member since 2013

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 1
    Likes Given
  • 35
    Questions
  • 61
    Replies
Hi, 

My salesforce site was just restricted by saledorce new update " Restrict Record Access for Guest Users"

Now guest users cant register using our site.

I am asked to review the update and acknowledge. 

Whatt happens after I acknowledge? How do i give users access to enter data on our site?

Thank you

In VisualFlow you can create multiple screens, as many as you like, but at the end it is considered one Flow,

And when you create a website from the Flow, its only one website.

 

 

How can you create multiple screens that are considered one VisualForce page?

Can I change the Default Web Address for my webpage in Sites? And how?

I need to completely change the design of a Visual workflow (FLOWS) I have made,

I know that I can provide a static CSS file as follows:

 

<apex:stylesheet value="{URLFOR{$Resourse.styles, 'styles.css')}"/>

 

But I don’t understand how to control the changes in each part of my Flow in the CSS file,

 

In Visual force markup language, this is straight forward, as this webpage show:

 

http://www.salesforce.com/us/developer/docs/pages/Content/pages_styling_custom.htm

 

I can define which parts are h1, p, or even define a style class.

 

But how can I do this with flows?

How do I even know the names of the objects in the flows?

 

I’m just calling the flow in my visual force page using one line:

 

<flow:interview name="Name"/>

 

Can anyone guide me to a website, pdf, or a webinar that demonstrates how to create/change a CSS static file for FLOWS?

 

 

  • September 10, 2013
  • Like
  • 0

When you create a Droodown List in FLOWS,
If you have a list of items [Mr, Mrs, Ms, Dr.] and you do not choose a default item,
It always chooses the first one in the list [in this example Mr],

How can I prevent that?

  • September 05, 2013
  • Like
  • 0

I am trying to save a new record in Contract,

I have required fields like Account name and Contact name,

 

Here is part of the code:

 

         Account[] aa = [SELECT Id, Name FROM Account WHERE Name = :inquery.Institution__c];
          Contact[] ac = [Select AccountId From Contact Where Email =:inquery.email__c]; 


          contract = new Contract();
          contract.Volume_Serial_Number__c  = record.Volume_Serial_Number__c;
          contract.Host_Name__c             = record.Host_Name__c;
          contract.Physical_Address__c      = record.Physical_Address__c;
          contract.License_Type__c          =  'Temporary';
          contract.CustomerSignedId         = ac.get(0).AccountId;
          contract.AccountId                = aa.get(0).Id;
          insert contract;

 

So the contact and account fields are linked to Contract [look up fields]

When I run the code I get the following error:

 

 Insert failed. First exception on row 0; first error: FIELD_INTEGRITY_EXCEPTION, Institution Contact: id value of incorrect type: 001J0000015XCOKIA4: [CustomerSignedId]

 

Does anyone know why?

 

Thanks

I am trying to call the Account name of a contact as follows:

 

public with sharing class mainSub {

public PageReference sendpassfail() {
Account_name = SELECT Account.Name, (SELECT Contact.FirstName FROM Contact Where Contact.LastName = 'Steve') FROM Account

}
}

 

But this gives me the following error:

 

unexpected token: 'SELECT' at line ----

 

Can someone tell me why?

Thanks,

I have a custom object, that includes multiple fields,

 

But the account and contact names are taken from the respective account and contact standard objects,

 

So if you go in the custom object fields, you will se that they are lookup fields for those standard objects,

 

Question: The following few lines call a specific user data based on their IP address:

 

public with sharing class main_sub {
    public List<Trainee__c> trainee{get;set;}
    public List<Contract> license{get;set;}

public PageReference Sub{
license = new List<Contract>();


license  = [select StartDate,

Host_Name__c,License_Type__c,Volume_Serial_Number__c,Expiration_Date__c,Physical_Address__c from Contract where Physical_Address__c=:'IP ADDRESS' ]; 



}
}

 

How can I call the Account name and Contact name for that IP address?

 

If someone can provide a link to an example that explains this, That would be great,

 

Thanks

I have a VisualForce page that has three functionalities,

Hence it has three 'public PageReference' subroutines,

That are called when an action happens in the page [i.e. button]

 

One of the functionalities requires user input [i.e. inputText],

So the main APEX code has a variable declaration for that input:

 

    public String UserInput { get; set; }

 

Since each task is not really related,

When I hit the button on the other two functionalities,

I get a VisualForce error, Because the inputText object has no user input,

 

How can I prevent that from happening,

 

Another way to solve this,

How do I turn off VisualForce Error messages?

So I can do error handling from APEX,

Looking at the debug log file,

The error is in VisualForce NOT APEX,

 

Thanks

Is there a way to get the inputField to accept values that are NOT in any Salesforce database [i.e object]?

 

 

Thanks

Does anyone know how to call the People object in VisualForce or Apex,

The object that has all the administrators?

 

Thanks

I have created a csvBlob that contains user records,

Can someone please tell me how to download that file?

 

Thanks

Here is the code:

 

public with sharing class Send_noti_emails {


   public PageReference download_csv() {
         string header = 'Record Id, Name , First Name , Last Name , Email, Qulification\n';
         string finalstr = header ;
         string recordString;

  for (Inquery__c inquery: [SELECT Email__c,First_Name__c, Last_Name__c,Quilification__c FROM Inquery__c  WHERE Download__c = False]){

   recordString = inquery.id+','+inquery.First_Name__c+','+inquery.Last_Name__c+','+inquery.Email__c +','+inquery.Quilification__c +'\n';
   finalstr = finalstr +recordString;

  }

    blob csvBlob = Blob.valueOf(finalstr);

   return null;
   }
}

I have the following VisualForce page: 

 

<apex:page standardController="Inquery__c" recordSetVar="accvar" contentType="text/csv#filename.csv" >"First Name","Last Name","Email","Qualification"
<apex:repeat value="{!accvar}" var="a">
<apex:outputText rendered="{!NOT(a.Download__c)}">
      {!a.First_Name__c}, {!a.Last_Name__c}, {!a.Email__c}, {!a.Quilification__c}
</apex:outputText>
</apex:repeat>
</apex:page>

 

That I call from a custom button,

Using the Using javascript&colon;

 

window.location = 'apex/Download_data';

 

The button calls the code and it works,

 

But it also redirects me to the VisualForce page,

 

How can I just execute the code,

Without being redirected to the VF page,

 

Thanks

 

 

 

Im Trying to write a button that triggers the following code or page:

 

<apex:page standardController="Inquery__c" recordSetVar="accvar" contentType="text/csv#filename.csv" >
"First Name","Last Name","Email","Qualification"
<apex:repeat value="{!accvar}" var="a">
      {!IF((!a.Downloaded__c), ({!a.First_Name__c}, {!a.Last_Name__c}, {!a.Email__c}, {!a.Quilification__c}),'Do nothing')}
</apex:repeat>
</apex:page>

 

All this is suppose to do, is save the a.First_Name__c, a.Last_Name__c, a.Email__c, a.Quilification__c Fields to a CSV File,

IF the a.Downloaded__c CHECK box is checked( i.e. TRUE).

 

But the code above gives me a Syntax error,

 

Does anyone know what wrong with the code,

 

Thanks

I have a flow setup and running on VisualForce and on Sites,

 

How do i make a file availble for users to download on the Flow or site?

 

Thanks

 

 

I'm writing an Email template that includes merged fields,

 

When I add an account field it works fine,

 

But when I try to add a field from a custom object it does not work,

 

Do Email templates accept fields from custom objects?

 

Thanks  

I have the following Trigger:

 

trigger send_notification on Inquery__c (after update) {

Inquery__c inquery = trigger.new[0];

if (Trigger.isUpdate) {

      if(inquery.Quilification__c == 'Qualified') {

      }
      if(inquery.Quilification__c == 'Disqualified') {
          Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
          EmailTemplate et=[Select id from EmailTemplate where name=:'Ineligible_course_candidate'];
          mail.setTemplateId(et.id);
          mail.setTargetObjectId(inquery.email__c);
          mail.setSenderDisplayName('Salesforce Support');
         Messaging.sendEmail(new Messaging.SingleEmailMessage[] { mail });

      }

   }
}

 

Im getting the following error:

 

Error:Apex trigger send_notification caused an unexpected exception, contact your administrator: send_notification: execution of AfterUpdate caused by: System.QueryException: List has no rows for assignment to SObject: Trigger.send_notification: line 15, column 1

 

for the following line:

 

EmailTemplate et=[Select id from EmailTemplate where name=:'Ineligible_course_candidate'];

 

Anyone know why?

 

Thanks

 

In APEX,

I want to write a few variables to a text file and send the text file via email,

 

I don't want to save the text file as a document,

I have no use for it, and I don't want to accumulate text files on Salesforce,

 

Does anyone know how to do this?

Or can lead me to a thread that does something similar,

 

Thanks

I have a call to a method in a class as follows:

 

String key1 ="test1";
String key2 ="test2";

long[] datalr =newlong[]{};
datalr
=TestClass.callerSub(key1,key2);
datalr
=TestClass.callerSub(key1,key2);

 

The test class is as follows:

 

publicclassTestClass{

 
privatestaticfinalLong[] P =newLong[18];



PublicTestClass{
}

publiclong[] callerSub(string key1,String key2){

long[] datalr =newlong[]{0,0};
integer i
;
system
.debug(LoggingLevel.INFO,P[0]);

datalr
[0]=2;
datalr
[1]=3;
for( i =0; i <18;++i ){
P
[i]= i+1
}
return datalr;

}
}

 

I am calling the TestClass.callerSub twice, The first time I call the debug statement:

 

system.debug(LoggingLevel.INFO,P[0]);

 

it returns null, as it should,

 

The second time I call it, the P[i] now has a value,

 

How do I close or destroy the TestClass class before I call it again?

 

Thanks

How can i stop APEX from executing the code at a certain line,

 

For example:

 

In C we have

exit(-2);

 

In Fortran we have

Stop

 

Whats the the equivalent command in APEX

Hi, 

My salesforce site was just restricted by saledorce new update " Restrict Record Access for Guest Users"

Now guest users cant register using our site.

I am asked to review the update and acknowledge. 

Whatt happens after I acknowledge? How do i give users access to enter data on our site?

Thank you

In VisualFlow you can create multiple screens, as many as you like, but at the end it is considered one Flow,

And when you create a website from the Flow, its only one website.

 

 

How can you create multiple screens that are considered one VisualForce page?

When you create a Droodown List in FLOWS,
If you have a list of items [Mr, Mrs, Ms, Dr.] and you do not choose a default item,
It always chooses the first one in the list [in this example Mr],

How can I prevent that?

  • September 05, 2013
  • Like
  • 0

I am trying to call the Account name of a contact as follows:

 

public with sharing class mainSub {

public PageReference sendpassfail() {
Account_name = SELECT Account.Name, (SELECT Contact.FirstName FROM Contact Where Contact.LastName = 'Steve') FROM Account

}
}

 

But this gives me the following error:

 

unexpected token: 'SELECT' at line ----

 

Can someone tell me why?

Thanks,

Does anyone know how to call the People object in VisualForce or Apex,

The object that has all the administrators?

 

Thanks

I have created a csvBlob that contains user records,

Can someone please tell me how to download that file?

 

Thanks

Here is the code:

 

public with sharing class Send_noti_emails {


   public PageReference download_csv() {
         string header = 'Record Id, Name , First Name , Last Name , Email, Qulification\n';
         string finalstr = header ;
         string recordString;

  for (Inquery__c inquery: [SELECT Email__c,First_Name__c, Last_Name__c,Quilification__c FROM Inquery__c  WHERE Download__c = False]){

   recordString = inquery.id+','+inquery.First_Name__c+','+inquery.Last_Name__c+','+inquery.Email__c +','+inquery.Quilification__c +'\n';
   finalstr = finalstr +recordString;

  }

    blob csvBlob = Blob.valueOf(finalstr);

   return null;
   }
}

In the last screen of my flow, I display the various input fields submitted by the user as a confirmation of what s/he enterred. This screen is preceeded by a Record Create task which posted the data to my custom object. All is well except for the fact that my last screen displays the default buttons of "Previous" and "Finish". How do I remove or hide the Previous button so a user does not make an inadvertent double entry by clicking the Previous button and invoking the Record Create a second time?

Hello,

 

I have a few screens in my Visual Workflow and I would like to add images to some of the screens. I haven't found such capabilities. How can I achieve my goal?

 

Thanks,

Mikhail

I am trying to send out a list of emails using an Org Wide Email address via apex but it is timing out. The emails are sent out quickly without any issues when I don't use the setOrgWideEmailAddressId() function. This is an unacceptable user experience because the page keeps on loading until it times out. 

Unfortunately I need to use an org wide email address because the email must be sent from a generic email, not the logged in user's.

 

To test out the functionality on its own I executed the following code snippet as annonymous apex and it took 3.2 minutes to finish executing. This is just for a single email.

 

List<Messaging.Email> emails = new List<Messaging.Email>();
EmailTemplate template = [SELECT Name, Markup, HtmlValue, Body, DeveloperName FROM EmailTemplate WHERE DeveloperName = 'Some_Email_Template'];
OrgWideEmailAddress replyEmail = [SELECT ID, DisplayName FROM OrgWideEmailAddress WHERE Address =: 'address@sample.com'];

// The logic here is repeated in a for loop for various contacts
Messaging.SingleEmailMessage currEmail =  new Messaging.SingleEmailMessage();

currEmail.setTemplateId(template.Id);
currEmail.setTargetObjectId('003S000000QcNfl'); // Add a contact ID
currEmail.setWhatId('701S00000007YTgIAM'); // Set a campaign ID
currEmail.setOrgWideEmailAddressId(replyEmail.Id);

// This is why I am putting the emails in a list, then sending them all
emails.add(currEmail);

Messaging.sendEmail(emails);

 Last execution at 11/30 13:38:44 in 192,171 milliseconds.

 

 

Is there a reason why this takes so long to complete when running as an annonymous apex script? In the UI it times out.

 

OR
 

Is there another way I can achieve this without providing an unacceptable user experience?