• qraish
  • NEWBIE
  • 65 Points
  • Member since 2013

  • Chatter
    Feed
  • 2
    Best Answers
  • 2
    Likes Received
  • 1
    Likes Given
  • 7
    Questions
  • 21
    Replies

Please anyone let me know..,How to insert OpportunityLineItemSchedule record using Apex in Test class?

The following query works fine in SOQL

 

select account.name,name,account.ownerid,ownerid from contact limit 10

 

so all the fields are available.

 

This one is unparsable by SOQL

select account.name,name,account.ownerid,ownerid from contact where account.ownerid!=ownerid  limit 10

 

Anyway to do this ? 

I have worked on providing users to upload multiple websites for internal facing website. 
But wondering what are the defined best practices in terms of functional and security best to enforce in terms of apex/visualforce layer in order to ensure malicious files are not uploaded via the public facing website built on the force.com platform?
Any thoughts and shareable experience would be greatly appreciated :)
 

  • March 13, 2015
  • Like
  • 1

Seeking insights on necessity of entitlement management/processes on a use case to create reports with regards to customer communication, case escalations, severity and case status. Would following use cases be possible on scope of entitlements only? What can be the other options?

> Ensuring initial feedback to customers within certain minutes or hours depending on Case Severity.
> Ensuring updates to customers on hourly or daily basis depending on Case severity.
> Reports on cases based on the timeline of initial feedback or update.
> Reports on escalated and pending cases.

Thanks a ton!

Regards

Really looking for some help/insights here..Any guidance would be greatly appreciated!!

 

Here's my scenario:

A record id can be obtained in the controller using ApexPages.currentpage().getParameters().get('RecId') when 'RecId' is already parsed in the URL...

 

The problem is: Say a record with id=RecId already exists with values in Field A. Now, we need to prompt user to enter data in Field B and also show them value of Field A by autopopulating..

I am having extremely difficult time to figure out how to tie up both the prepopulate and update process to the same record.

If I use ApexPages.StandardController.getRecord, it would allow me update the Field B. But how can I prepopulate field A. Or vice versa..how to do both at the same time?


Thank you for your time!!

  • December 11, 2013
  • Like
  • 0

Using PermissionSet() and SOQL we can list the permission sets which are owned by profile using the SOQL statement
 Select Id,Name, IsOwnedByProfile, Profile.Name, Label from PermissionSet where IsOwnedByProfile=TRUE


My question is can we assign a permission set owned by a profile to different profile? For example: A custom profile named IT KingKong is listed in the Profile.Name column of the result from SOQL above. Can I assign this permission set(owned by IT KingKong profile) to another custom profile?


The interface after clicking 'Edit Assignment' from a User record doesn't list any permission sets owned by profile, it only list custom permission set that we created....

Any insights/help will be greatly appreciated. Thank you!! Source for SOQL: - By Adam Torman

  • October 22, 2013
  • Like
  • 0

Hi All,

 

In a visualforce page, we can display picklist values based on the profile of logged in user and record type settings simply by using something like..

<apex:inputField id="testid" value="{!Case__c.Status__c}" />

 

However, I am seeking for some tips to achieve something like this in a single VF page...

 

- In picklist Field A, user will select one record type from a list of record types (These record types for an object would have already been configured in the back end) ...

- In the same page, another Picklist field B (whose values are dependent on the record type) gets populated with a list of values based on the record type selected in Field A...(The values displayed in Field B would have already been configured in the back end)....

 

Could it be done in a single VF page without or with the use of an extension?

 

Thanks in advance for any insights!!

 

QR

 

 

 

  • October 14, 2013
  • Like
  • 0

Couple of questions:

 

- In the report generated from User  object with columns such as last login date, name, email, and browser..
instead of generating report with all the login attempts by users, can we display only the last login history record per user for every user?

 

-  'Browser', field is available on User object,  from Winter 14 release onwards only. For instances in prior release, can we get this information i.e. Name of the browser used to login?

 

Thank you for your time and insights!

 

 

 

 

 

  • October 08, 2013
  • Like
  • 0

In an email to case set up, the body of the email is set to be displayed as description in the case in salesforce.

 

This goes ugly when an email consist of a table and the data in table comes off something like this in Case Description for e.g.

 

Library Complaints Issue Information: Issue Date Location Issue Description Vandalism Aug 30 1969 12:00:00:000AM 4th floor Too many people 4th floor lobby Issuer Information: Student Number Title First Name Type StudentID22222222����������

 

Can we parse out the information on the table of email's body in some sensible manner in Case description??

 

Any insights towards the solution will be greatly appreciated.

 

Thank you!!

  • September 19, 2013
  • Like
  • 1

I have worked on providing users to upload multiple websites for internal facing website. 
But wondering what are the defined best practices in terms of functional and security best to enforce in terms of apex/visualforce layer in order to ensure malicious files are not uploaded via the public facing website built on the force.com platform?
Any thoughts and shareable experience would be greatly appreciated :)
 

  • March 13, 2015
  • Like
  • 1

In an email to case set up, the body of the email is set to be displayed as description in the case in salesforce.

 

This goes ugly when an email consist of a table and the data in table comes off something like this in Case Description for e.g.

 

Library Complaints Issue Information: Issue Date Location Issue Description Vandalism Aug 30 1969 12:00:00:000AM 4th floor Too many people 4th floor lobby Issuer Information: Student Number Title First Name Type StudentID22222222����������

 

Can we parse out the information on the table of email's body in some sensible manner in Case description??

 

Any insights towards the solution will be greatly appreciated.

 

Thank you!!

  • September 19, 2013
  • Like
  • 1

I have worked on providing users to upload multiple websites for internal facing website. 
But wondering what are the defined best practices in terms of functional and security best to enforce in terms of apex/visualforce layer in order to ensure malicious files are not uploaded via the public facing website built on the force.com platform?
Any thoughts and shareable experience would be greatly appreciated :)
 

  • March 13, 2015
  • Like
  • 1
HI  Here is my scenario that causes this error:

I have create a VF page which is a registration form. It is hosted on a Force.com site. What I want to do is this:
When a user enteres contact information, he will get an email notification containing a generic email address called "noreply@someemail.org" listed as the From: Email Header or Sender. I use Org wide Email Addressesmethod setOrgWideEmailAddressId to create this.

However that email doesn't appear and I get an error rmessage that says :

SendEmail failed caused by: System.EmailException: SendEmail failed. First exception on row 0; first error: INSUFFICIENT_ACCESS_OR_READONLY, Not profiled to access this Org-wide Email.

Q) Does anyone know if I am receiving this error because the external  user to the Force.com Site is of a profile type that is a Guest  Site User and not  one that is a Salesforce Licensed User like System Admin?

I ask this question because when I run a test locally for this VF Page  within Salesforce (as a System Admin), the test user I use will get the email notification that does contain the Sender Header "noreply@someemail.org"  and no error exception is displayed.

 Thanks in advance!
Hi,
My Lead having Notes&Attachments in related list.i want to send multiple attachment to mail at a time by selecting attachments .
any one give me idea how i acheive this...

thanks in advance

Really looking for some help/insights here..Any guidance would be greatly appreciated!!

 

Here's my scenario:

A record id can be obtained in the controller using ApexPages.currentpage().getParameters().get('RecId') when 'RecId' is already parsed in the URL...

 

The problem is: Say a record with id=RecId already exists with values in Field A. Now, we need to prompt user to enter data in Field B and also show them value of Field A by autopopulating..

I am having extremely difficult time to figure out how to tie up both the prepopulate and update process to the same record.

If I use ApexPages.StandardController.getRecord, it would allow me update the Field B. But how can I prepopulate field A. Or vice versa..how to do both at the same time?


Thank you for your time!!

  • December 11, 2013
  • Like
  • 0

Using PermissionSet() and SOQL we can list the permission sets which are owned by profile using the SOQL statement
 Select Id,Name, IsOwnedByProfile, Profile.Name, Label from PermissionSet where IsOwnedByProfile=TRUE


My question is can we assign a permission set owned by a profile to different profile? For example: A custom profile named IT KingKong is listed in the Profile.Name column of the result from SOQL above. Can I assign this permission set(owned by IT KingKong profile) to another custom profile?


The interface after clicking 'Edit Assignment' from a User record doesn't list any permission sets owned by profile, it only list custom permission set that we created....

Any insights/help will be greatly appreciated. Thank you!! Source for SOQL: - By Adam Torman

  • October 22, 2013
  • Like
  • 0

Hi All,

 

In a visualforce page, we can display picklist values based on the profile of logged in user and record type settings simply by using something like..

<apex:inputField id="testid" value="{!Case__c.Status__c}" />

 

However, I am seeking for some tips to achieve something like this in a single VF page...

 

- In picklist Field A, user will select one record type from a list of record types (These record types for an object would have already been configured in the back end) ...

- In the same page, another Picklist field B (whose values are dependent on the record type) gets populated with a list of values based on the record type selected in Field A...(The values displayed in Field B would have already been configured in the back end)....

 

Could it be done in a single VF page without or with the use of an extension?

 

Thanks in advance for any insights!!

 

QR

 

 

 

  • October 14, 2013
  • Like
  • 0

Trying to translate a button on a custom object, but it doesn't seem to be taking. I'm a system admin and set myself up as a translator. Any ideas what I should check to get this to work? I tried a 2nd button the same object as a test, but that one didn't translate either.

  • October 08, 2013
  • Like
  • 0

Couple of questions:

 

- In the report generated from User  object with columns such as last login date, name, email, and browser..
instead of generating report with all the login attempts by users, can we display only the last login history record per user for every user?

 

-  'Browser', field is available on User object,  from Winter 14 release onwards only. For instances in prior release, can we get this information i.e. Name of the browser used to login?

 

Thank you for your time and insights!

 

 

 

 

 

  • October 08, 2013
  • Like
  • 0

In an email to case set up, the body of the email is set to be displayed as description in the case in salesforce.

 

This goes ugly when an email consist of a table and the data in table comes off something like this in Case Description for e.g.

 

Library Complaints Issue Information: Issue Date Location Issue Description Vandalism Aug 30 1969 12:00:00:000AM 4th floor Too many people 4th floor lobby Issuer Information: Student Number Title First Name Type StudentID22222222����������

 

Can we parse out the information on the table of email's body in some sensible manner in Case description??

 

Any insights towards the solution will be greatly appreciated.

 

Thank you!!

  • September 19, 2013
  • Like
  • 1

Below is the code for the trigger but i am getting error 

"Error: Compile Error: expecting a semi-colon, found 'Idval' at line 2 column 8"

 

trigger onUpdateOfObjectB on Object_B__c (Before insert,before update) {
set Idval=new set();
set Ids=new set();

for (Object_B__c ct: trigger.new)
{
idval.add(ct.Lookup_Object_A__c);
ids.add(ct.Id);
}

List Aclist=[select Id,Priority__c from Object_A__c where Id =:Idval];

List Bclist=new List();
List Cclist=[select Lookup_Object_B__c,Status__c from Object_C__c where Lookup_Object_B__c=:ids];

for(Object_A__c ac: Aclist)
{
for(Object_C__c cc: Cclist)
{
if(ac.Priority__c=='P1' && cc.Status__c=='Closed')
{
System.debug('SDFGsdf sdfsdf');
cc.addError('Your custom error message');
}
}
}
}

 

Can anybody help me its urgent...

  • August 21, 2013
  • Like
  • 0

Hi,

 

I'm trying to insert a record in to cases object with attachment. Here ineed to put one condition i.e. 

if attachment size is greater thhan 10 mb then record should not insert and a message has to display like"attachment size exceeded limit is 10 mb". I'm trying with the below code its not working can anyone help mein this issue.

 

public with sharing class LibraryAskUsRequestController {

/*
* @description Property section
*/
public String librarycontent { get; set; }
public Case request{get; set;}
public Attachment att {get; set;}
public boolean FacultyResearchRequest {get; set;}
public Transient Blob filebody { get; set; }
public Transient Blob attbody { get; set; }
public String contentType { get; set; }
public Boolean incorrect_Captcha {get;set;}
public boolean attsize_exceeded { get; set; }
public String filename{ get; set; }
public integer attsize {get; set; }

/*
* @description Constructor
*/
public LibraryAskUsRequestController() {

request = new Case();
Attachment att = new Attachment();
librarycontent = TextManagerUtils.getAppText(CoreConstants.ApplicationId.core.name(), CRMCoreConstants.TM_LIBRABY_ASKUS_CONTENT);

}
/*
* @description this method is used to insert new record on clicking Submit button
*/
public PageReference Save() {

try{
if(Recaptcha.response!='') {
/* verifying recapthca */

if(Recaptcha.getVerify())
{
if(attbody!=null)
{
If(attbody.size()>10485760 ){
ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.WARNING, 'This file exceeds the maximum size limit of 10MB.'));
return null;
}
}
else{

request.Request_Type__c='Ask Us';
request.Origin='Web';
Database.DMLOptions dmo = new Database.DMLOptions();
dmo.assignmentRuleHeader.useDefaultRule= true;
dmo.EmailHeader.triggerAutoResponseEmail = true;
request.setOptions(dmo);

if(attbody!=null){

att = new Attachment();
att.body = attbody;
att.Name=filename;
att.BodyLength=10485760;
att.ContentType=contentType;
att.ParentId = request.Id;
insert att;

attbody=null;
att.Body=null;
}
}

insert request;
PageReference confirmation = new PageReference('http://www.google.com');
return confirmation;


}

else{
incorrect_Captcha=true;
return null;
}
}
else{
incorrect_Captcha=true;
return null;
}
}

catch(Exception e) {
ApexPages.addMessage(new ApexPages.Message(ApexPages.severity.WARNING, e.getMessage()));
}
finally
{
att = new Attachment();
}

return null;
}

}

Hi,

 

I have chart in report. Whether i can use that in visualforce page.????

 

I have seen the options like Viasulforce chartting and google charts.

 

Bt here i need is that i created a chart in report and i jus want to call that in visualforce page. Can i do that..?

Is it posible to require a field to be non-blank based on an action of a different field on the same page layout via standard SFDC functionality?

 

Use case: I have a Picklist and Picklist (Multi-Select) which combine (logically) to require or not require an entry in a Text field. For example, the Picklist includes: car, truck, plane, boat. The Picklist (Multi-Select) includes: engine, control unit, driver, passenger, luggage. The Text field must be non-blank if Picklist does not = "car" or "truck" AND Picklist (Multi-Select) = "luggage" ONLY

 

Can this be done without VF / Apex code?

 

I tried various combinations of IF / INCLUDES / AND / NOT logic and either I built it wrong or this won't work.

 

TIA!

Please anyone let me know..,How to insert OpportunityLineItemSchedule record using Apex in Test class?

Hi, 

 

I recently created a workflow with an outbound message, there was an error on the receiving end and the messages got delayed.  Due to the error I deleted the outbound message in an attempt to delete the Queued messages, however they did not get removed from the queue.  I have tried to click "Del" and "Retry" in an attempt to get them cleared out, and neither of those buttons have any effect on the queue.  I have confirmed there are no longer any Outbound Messages in my account, does anyone know any other way to remove these, or remedy the situation?  

 

Thanks!

  • July 31, 2013
  • Like
  • 0

The following query works fine in SOQL

 

select account.name,name,account.ownerid,ownerid from contact limit 10

 

so all the fields are available.

 

This one is unparsable by SOQL

select account.name,name,account.ownerid,ownerid from contact where account.ownerid!=ownerid  limit 10

 

Anyway to do this ? 

Hi,
My Lead having Notes&Attachments in related list.i want to send multiple attachment to mail at a time by selecting attachments .
any one give me idea how i acheive this...

thanks in advance