• Praveen N
  • NEWBIE
  • 0 Points
  • Member since 2013

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 10
    Questions
  • 8
    Replies
Hi,
I have an image(attach icon)  in visualforce pag. On click of the attachicon , user should select the file and process records in controller. 
With standard apex:input file we get choose file button and can upload the file, but in my scenario i should not show the choose file button.

please help me out here.

Thanks in Advance
Praveen

 
Hi,

I have created community and activated. I have put default page option for Login, Logout, Forgot password, Change password and self registration. 

I am a System Administrator and tried to login community using community URL, it is throwing error "Please check your username and password. If you still can't log in, contact your Cummins administrator." .

i am providing correct credentials. please help me what i am dong wrong here.

Thanks in Advance.
Praveen
Hi,

can we send an approval request to user who is not in the salesforce. Requirement is, we will be having a email fields, it contains external user email address and need to send approval request. can we send approval requst to these external emails. 

Thaks in Advance.
Praveen 
Hi,

i am getting error   "Error: Failed to parse wsdl: Unsupported Schema element found http://www.w3.org/2001/XMLSchema:attribute. At: 365:64 "

any solution for this error?

Thanks in advance.

Praveen

Hi ,

 

I am using same VF and class for new reocrd creation and editing the record. i have one select list generating values dynamically. while editing the record it is not setting the actual value(which was selected in creation) to select list .

i am not putting the logic to dynamically generating select list values. while editing it is setting values to reamining fields but not for select list . is there any solution for this?

Visual force page:

 

<apex:page Controller="DGApprovalBusinessReview" tabStyle="Approval__c" id="apppage" action="{!initialize}">

<apex:form id="appform" >
<apex:sectionHeader title="Approval" subtitle="{!Oppty.Name}"/>
<apex:pageBlock title="Approval Request Form: Business Review" id="apppageblock">
<apex:actionFunction name="EnableSWSections" action="{!SWSpecificSection}" rerender="apppageblock" status="Refreshing"/>
<apex:actionFunction name="SoftwareField" action="{!SoftwareSelection}" reRender="Opptyp,ela" status="Refreshing" />

<apex:pageBlockButtons >
<apex:commandButton action="{!customSave}" value="Save" />
<apex:commandButton action="{!Cancel}" value="Cancel"/>
</apex:pageBlockButtons>
<apex:pageBlockSection columns="2" title="Opportunity Information" id="pbsec">
<apex:outputField value="{!Oppty.Opportunity_ID__c}"/>
<apex:outputField label="Opportunity Type" value="{!Oppty.Type}"/>
<apex:SelectList value="{!approvalObj.Solution_Mix__c}" id="solmix" size="1" onchange="EnableSWSectionsJS();">
<apex:selectoptions value="{!solutionmixvals}" />
</apex:SelectList>
</apex:pageBlockSection>

<apex:pageBlockSection columns="1" title="BG Specific Information(SW)" id="swsection" rendered="{!IF( SolutionMix == 'Product',true,false)}">
<apex:pageBlockSection columns="2" title="Opportunity Type" id="Opptyp">
<apex:inputField value="{!approvalObj.Software__c}" id="Software" />
<apex:inputField label="Support Type" value="{!approvalObj.Support_Type__c}" id="supprttyp" />
</apex:pageBlockSection>

<apex:pageBlockSection columns="1" title="BG Specific Information(SW)" id="swsectionservices" rendered="{!IF(SolutionMix == 'Service',true,false)}">
<apex:pageBlockSection columns="2" title="Opportunity Type" id="Service-Opptyp">
<apex:inputField label="Services" value="{!approvalObj.Services__c}" id="Services"/>
<apex:inputField label="Education" value="{!approvalObj.Education__c}" id="Education"/>
<apex:inputField label="SaaS" value="{!approvalObj.SaaS__c}" id="saas" />
<apex:inputField label="3rd Party Products + Services" value="{!approvalObj.Third_Party_Products__c}" id="thirdproduct" />
<apex:inputField label="Is Deal being financed?" value="{!approvalObj.Is_Deal_being_financed__c}" />
</apex:pageBlockSection>
</apex:pageBlock>

</apex:form>


</script>
</apex:page>

 

 

Apex class:

 

 

 

 

public with sharing class DGApprovalBusinessReview{
public String id;
public String rectypeid{get;set;}
public String AppId;
public String OptyId;
public Approval__c approvalObj{get;set;}
public Opportunity oppty {get; set;}
public List<SelectOption> solutionMixVals{set;get;}

public DGApprovalBusinessReview() {
OptyId = ApexPages.currentPage().getParameters().get('Id');
AppId = ApexPages.currentPage().getParameters().get('AppId');
Opp = [select Amount from Opportunity where Id =:OptyId];
If(ApexPages.currentPage().getParameters().get('RecordType') != null)
{
rectypeid=ApexPages.currentPage().getParameters().get('RecordType');
}
If(AppId != null && AppId != '')// for if record is editing.
{

approvalObj = [SELECT Solution_Mix__c,Software__c,Support_Type__c,Services__c,Education__c,SaaS__c,Third_Party_Products__c FROM Approval__c where id =:AppId];
solutionMixVals=new List<SelectOption>();
SolutionMix();
}
else
{
approvalObj = new Approval__c(Opportunity__c=OptyId,RecordTypeId=rectypeid);
solutionMixVals=new List<SelectOption>();

}
}

Public PageReference SWSpecificSection(){

SolutionMix = approvalObj.Solution_Mix__c;
solMix=approvalObj.Solution_Mix__c;
return null;
}

Public PageReference SoftwareSelection(){


IsSoftware = approvalObj.Software__c;
if(IsSoftware!= null){
if(IsSoftware.Contains('Private Stack Perpetual Lic to ES (ELA)') || IsSoftware.Contains('License + Support (ELA)'))
IsELA = true;
else
IsELA = false;
}
return null;
}
public PageReference customSave(){
try{

If(AppID != null && AppID != '')
{
update approvalObj;
}
else
{
approvalObj.status__c='Open';
system.debug('RecordType'+rectypeid);
approvalObj.RecordTypeId=rectypeid;
insert approvalObj;
}
PageReference pr = new PageReference('/apex/DGApprovalBusinessReviewDetail?Id='+approvalObj.id);
pr.setRedirect(true);

return pr;
}catch(Exception e){
ApexPages.addmessages(e);
return null;
}
}

 

}

 

Thanks in advance.

 

Praveen

Hi,

i have following SOQL query using in apex class,it is working fine for all profiles except one profile. When I run the following SOQL query in workbench with user login who has problematic profile,it is returning result . Same SOQL query is not returning results in apex class for this user. i am not using with sharing key word to class,it runs system mode.

Is there any specific profile permission to set? If you any idea please help me on this issue.

SOQL query:

[select id,name from user where (name='Pending Assignment 01' OR name='Pending Assignment 02' OR name='Pending Assignment 03' OR name='Pending Assignment 04') ORDER By Name ASC

 

Thanks

Praveen

Hi ,

 

approval__c app=[select id,name,opportunity__r.name,opportunity__r.Account.name from Approval__c limit 1];

string str='name';
if(app.get(str)=='test')
system.debug('passed');
else
system.debug('failed');
// The above is working fine
str='opportunity__r.name';
if(app.get(str)=='test') // this is not working
system.debug('passed');
else
system.debug('failed');

actually str valu will come from another object.

when we have relationship not able to get the value from the object. is there any workaround to get?

 

Thanks

Praveen

Hi All,

 

i have one object Opportunity. i have three other obejcts object1, object2, object3, these objects have realationship with opportunity (parent or child relaitonship). can we know dynamically these objects having which realtiohship with opportunity. whether it has child realtionship or parent relationship with opportunity.

 

Thanks

Praveen

Hi All,

 

i have two pagelayouts on task object(one is standard and one custom). both has different fields. i have created a custom button. when i click on this button it should go to the custom pagelayout.

any idea please?

thanks in advance.

 

praveen

Hi All,

 

From apex i am sending single email message. it is not showing any errors and exceptions. but still mail is not going.

code as below.

Opportunity oppty=[select id,ownerID,owner.email from Opportunity where id = :OpptyId];
EmailTemplate OwnerChangeET= [SELECT id FROM EmailTemplate WHERE developerName = 'OpportunityChangeOwner'];

Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage() ;
String[] toAddresses = new String[] {oppty.owner.email} ;
mail.setToAddresses(toAddresses) ;
mail.setTargetObjectId(oppty.ownerID);
mail.setWhatId(oppty.Id);
//mail.saveAsActivity = false;
mail.setSaveAsActivity(false);
mail.setTemplateId(OwnerChangeET.id);
List<Messaging.SendEmailResult> results = new list<Messaging.SendEmailResult>();
List<Messaging.SingleEmailMessage> singleEmailList= new list<Messaging.SingleEmailMessage>();
singleEmailList.add(mail);
results=Messaging.sendEmail(singleEmailList);
if (results[0].isSuccess())
System.debug('&&&& ' +results[0]);

 

in the debug i am getting success .  i have tried with with sharing and without sharing class.

 

debug:

01:26:19.829 (829047000)|SYSTEM_CONSTRUCTOR_EXIT|[38]|<init>()
01:26:19.829 (829066000)|SYSTEM_METHOD_ENTRY|[39]|LIST<Messaging.SingleEmailMessage>.add(Object)
01:26:19.829 (829088000)|SYSTEM_METHOD_EXIT|[39]|LIST<Messaging.SingleEmailMessage>.add(Object)
01:26:19.829 (829140000)|SYSTEM_METHOD_ENTRY|[40]|Messaging.sendEmail(LIST<Messaging.Email>)
01:26:19.928 (928161000)|EMAIL_QUEUE|[40]|subject: A new Opportunity has been Assigned to you, bccSender: false, saveAsActivity: false, useSignature: true, toAddresses: [praveenkumar.reddy@hp.com], targetObjectId: 005d0000000f3aSAAQ, whatId: 006Z0000003rmqcIAA, templateId: 00XG0000001eql8MAA, htmlBody: <html>
<p>Hi PraveenKumar Reddy N,</p>

<p>You have been assigned ownership of the Opportunity: TestOpportunity</p>
<p>
For more details, click the following link:</p><a href="https://hp--supportdev--c.cs11.visual.force.com/006Z0000003rmqcIAA">https://hp--supportdev--c.cs11.visual.force.com/006Z0000003rmqcIAA</a></html>, 
01:26:19.928 (928279000)|SYSTEM_METHOD_EXIT|[40]|Messaging.sendEmail(LIST<Messaging.Email>)
01:26:19.928 (928407000)|SYSTEM_METHOD_ENTRY|[42]|String.valueOf(Object)
01:26:19.928 (928464000)|SYSTEM_METHOD_EXIT|[42]|String.valueOf(Object)
01:26:19.928 (928484000)|SYSTEM_METHOD_ENTRY|[42]|System.debug(ANY)
01:26:19.928 (928494000)|USER_DEBUG|[42]|DEBUG|&&&& Messaging.SendEmailResult[getErrors=();isSuccess=true;]

Any idea please?
thanks in advance.
Hi,

can we send an approval request to user who is not in the salesforce. Requirement is, we will be having a email fields, it contains external user email address and need to send approval request. can we send approval requst to these external emails. 

Thaks in Advance.
Praveen 
My trigger is Working Fine, Apex Class is Working Fine, Only Test Class is Problem
This is my Test class Code:
@isTest
    private class testcountOppLineItmsCount {
    static testMethod void testcountOppLineItmsCount() {
        List<OpportunityLineItem > lstoplitm= new list<OpportunityLineItem >();
       Opportunity o = new Opportunity(name='test opp1', CloseDate=date.today(), StageName='Closed Own');
       insert o;
      
           
      OpportunityLineItem op=new OpportunityLineItem (quantity=1,Opportunityid=o.id, TotalPrice=100  );
      insert op;
     lstoplitm.add(op);
     
      insert lstoplitm;
      countOppLineItmsCount.Change(lstoplitm);
       }
       }

Error is:

System.DmlException: Insert failed. First exception on row 0; first error: FIELD_INTEGRITY_EXCEPTION, field integrity exception: PricebookEntryId, unknown (versions 3.0 and higher must specify pricebook entry id, others must specify product id): [PricebookEntryId, unknown]

--

I am New for this PricebookEntry.. psl correct my code or tell me wht shall i do?

thaks 

Hi,

i have following SOQL query using in apex class,it is working fine for all profiles except one profile. When I run the following SOQL query in workbench with user login who has problematic profile,it is returning result . Same SOQL query is not returning results in apex class for this user. i am not using with sharing key word to class,it runs system mode.

Is there any specific profile permission to set? If you any idea please help me on this issue.

SOQL query:

[select id,name from user where (name='Pending Assignment 01' OR name='Pending Assignment 02' OR name='Pending Assignment 03' OR name='Pending Assignment 04') ORDER By Name ASC

 

Thanks

Praveen

Hi ,

 

approval__c app=[select id,name,opportunity__r.name,opportunity__r.Account.name from Approval__c limit 1];

string str='name';
if(app.get(str)=='test')
system.debug('passed');
else
system.debug('failed');
// The above is working fine
str='opportunity__r.name';
if(app.get(str)=='test') // this is not working
system.debug('passed');
else
system.debug('failed');

actually str valu will come from another object.

when we have relationship not able to get the value from the object. is there any workaround to get?

 

Thanks

Praveen

Hi All,

 

i have one object Opportunity. i have three other obejcts object1, object2, object3, these objects have realationship with opportunity (parent or child relaitonship). can we know dynamically these objects having which realtiohship with opportunity. whether it has child realtionship or parent relationship with opportunity.

 

Thanks

Praveen

Hi All,

 

i have two pagelayouts on task object(one is standard and one custom). both has different fields. i have created a custom button. when i click on this button it should go to the custom pagelayout.

any idea please?

thanks in advance.

 

praveen

Hi All,

 

From apex i am sending single email message. it is not showing any errors and exceptions. but still mail is not going.

code as below.

Opportunity oppty=[select id,ownerID,owner.email from Opportunity where id = :OpptyId];
EmailTemplate OwnerChangeET= [SELECT id FROM EmailTemplate WHERE developerName = 'OpportunityChangeOwner'];

Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage() ;
String[] toAddresses = new String[] {oppty.owner.email} ;
mail.setToAddresses(toAddresses) ;
mail.setTargetObjectId(oppty.ownerID);
mail.setWhatId(oppty.Id);
//mail.saveAsActivity = false;
mail.setSaveAsActivity(false);
mail.setTemplateId(OwnerChangeET.id);
List<Messaging.SendEmailResult> results = new list<Messaging.SendEmailResult>();
List<Messaging.SingleEmailMessage> singleEmailList= new list<Messaging.SingleEmailMessage>();
singleEmailList.add(mail);
results=Messaging.sendEmail(singleEmailList);
if (results[0].isSuccess())
System.debug('&&&& ' +results[0]);

 

in the debug i am getting success .  i have tried with with sharing and without sharing class.

 

debug:

01:26:19.829 (829047000)|SYSTEM_CONSTRUCTOR_EXIT|[38]|<init>()
01:26:19.829 (829066000)|SYSTEM_METHOD_ENTRY|[39]|LIST<Messaging.SingleEmailMessage>.add(Object)
01:26:19.829 (829088000)|SYSTEM_METHOD_EXIT|[39]|LIST<Messaging.SingleEmailMessage>.add(Object)
01:26:19.829 (829140000)|SYSTEM_METHOD_ENTRY|[40]|Messaging.sendEmail(LIST<Messaging.Email>)
01:26:19.928 (928161000)|EMAIL_QUEUE|[40]|subject: A new Opportunity has been Assigned to you, bccSender: false, saveAsActivity: false, useSignature: true, toAddresses: [praveenkumar.reddy@hp.com], targetObjectId: 005d0000000f3aSAAQ, whatId: 006Z0000003rmqcIAA, templateId: 00XG0000001eql8MAA, htmlBody: <html>
<p>Hi PraveenKumar Reddy N,</p>

<p>You have been assigned ownership of the Opportunity: TestOpportunity</p>
<p>
For more details, click the following link:</p><a href="https://hp--supportdev--c.cs11.visual.force.com/006Z0000003rmqcIAA">https://hp--supportdev--c.cs11.visual.force.com/006Z0000003rmqcIAA</a></html>, 
01:26:19.928 (928279000)|SYSTEM_METHOD_EXIT|[40]|Messaging.sendEmail(LIST<Messaging.Email>)
01:26:19.928 (928407000)|SYSTEM_METHOD_ENTRY|[42]|String.valueOf(Object)
01:26:19.928 (928464000)|SYSTEM_METHOD_EXIT|[42]|String.valueOf(Object)
01:26:19.928 (928484000)|SYSTEM_METHOD_ENTRY|[42]|System.debug(ANY)
01:26:19.928 (928494000)|USER_DEBUG|[42]|DEBUG|&&&& Messaging.SendEmailResult[getErrors=();isSuccess=true;]

Any idea please?
thanks in advance.