• Kiran.sfdc14
  • NEWBIE
  • 0 Points
  • Member since 2012

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 10
    Questions
  • 2
    Replies
Hi All,

Currently we are working on sandbox preview release (Winter 15), there is a new feature on Activities "Enable User Control over Task Assignment Notifications" which is default checked.

Procedure :

I have a custom "New Task" visualforce page from which we can create a task and assign to multiple users, there is a check box "Send Notification Mail".
When we check "Send Notification Mail" and create a task there is a custom code which will send email to all the users who are assigned to the task.

When "Enable User Control over Task Assignment Notifications" is checked.

a)  When I create a new task from visualforce page with out checking "Send Notification Mail" automatic email notifiaction is sent to assigned to user by salesforce with related to value as null.
b) When I create a new task from visualforce page with checking "Send Notification Mail" 2 mails are going to the users in which one is auto generated email from salesforce which has related to value as null and other one is system generated mail.

Now the problem is with the new feature "Enable User Control over Task Assignment Notifications" salesforce is automatically sending the mail with related to value as null.

Hi,

 

Publisher actions documents says these are avaliable in chatter mobile by adding mobile smart actions to gloabal layout.

I have added the mobile smart actions to global layout but chatter mobile doesn't show the actions. Am I missing any required configuration any work around for this ?

 

Please let me know, thanks in advance.

 

Kiran

Publisher actions documents says these are avaliable in chatter mobile by adding mobile smart actions to gloabal layout.

I have added the mobile smart actions to global layout but chatter mobile doesn't show the actions. Am I missing any required configuration any work around for this ?

Hello,

 

I have a requirement to update parent record when there is a update on child record.

 

Suppose there is a Account with "Read-Only" permission and on a Opportunity with Full-Access, when I change the status of the opportunity, I should be able to update the account record as well. 

 

Can this be achieved in any ways. Please help me in solviing this mistery.

 

Thanks in Advanced 

Kiran

Hi All,

 

Ours is a managed package. We have installed the app in customer org. But the system admin is able to view the VF page code.

 

Is there any possible way how we can restrict this?

 

Regards,

Kiran

 

Hi,

 

I am deploying my project from sandbox to production. And i am using "ANT" tool for deploying. But it is giving me error as given below:

Error: objects/Form__c.object(144,13):field integrity exception: unknown (must specify either cascade delete or restrict delete for required lookup foreign key)

Can anybody help me please. Thanks,

Hi everyone,

 

I am working on a visualforce page, which consist of components and tabs. When I am rendering my component it is going out of the form.

 

This is my code:

 

<apex:page standardController="On_Study_Pathology_Form__c" extensions="OnStudyPathology" id="pageId">
<script>
    function check() {
        var insertedProcedureIds = document.getElementById('pageId:pageBlockId:pageSectionId:pageCompId:ProcedureComponent:showProcedureForm:insertedProcedureIds').value;
        document.getElementById('pageId:formId:ProcedureIds').value = insertedProcedureIds;
        //alert(document.getElementById('pageId:formId:ProcedureIds').value);
        return true;
    }
    function showDCIS(val){
        if(val.value == 'Yes'){
            document.getElementById('pageId:pageBlockId2').style.display='';
        } else {
            document.getElementById('pageId:pageBlockId2').style.display='none';
        }
    }
    function showLCIS(val){
        if(val.value == 'Yes'){
            document.getElementById('pageId:pageBlockId3').style.display='';
        } else {
            document.getElementById('pageId:pageBlockId3').style.display='none';
        }
    }
    function showITP(val){
        if(val.value == 'Yes'){
            document.getElementById('pageId:pageBlockId4').style.display='';
        } else {
            document.getElementById('pageId:pageBlockId4').style.display='none';
        }
    }
</script>    
    <apex:tabPanel switchType="client" value="{!currentTab}" id="theTabPanel" contentStyle="font-size: 12px;">
        <apex:tab label="Procedure" name="procedureTab" id="ProcedureId" ontabenter="return false;">
            <apex:form onsubmit="return check();" id="formId">
                <apex:inputHidden id="ProcedureIds" value="{!ProcedureIds}" />
                <apex:pageBlock id="blockId">
                    <apex:pageBlockButtons location="top">
                        <apex:commandButton action="{!next}" value="Next" reRender="theTabPanel" status="counterStatus"/>
                        <apex:actionStatus id="counterStatus" startText="Processing..." onstop=""/>
                       </apex:pageBlockButtons>
                       <apex:pageBlockSection columns="1" id="blockSectionId">
                           <apex:pageBlockSectionItem >
                            <apex:outputLabel value="Does the patient have bilateral breast cancer?" for="procedureDate"/>
                            <apex:inputField value="{!ospObj.Does_the_patient_have_bilateral_breast_c__c}" id="procedureDate" required="true"/>
                        </apex:pageBlockSectionItem>
                        <apex:pageBlockSectionItem >
                            <apex:outputLabel value="Tumor laterality (or side with most advanced disease)" for="Tumorlaterality"/>
                            <apex:outputPanel >
                                <apex:inputField value="{!ospObj.Tumor_laterality__c}" id="Tumorlaterality" required="true"/>
                                <apex:outputlabel value="Select the breast that meets the criteria for the study"/>
                            </apex:outputPanel>
                        </apex:pageBlockSectionItem>
                       </apex:pageBlockSection>
                </apex:pageBlock>
            </apex:form>
            <apex:pageBlock title="Positive Breast Biopsies" id="pageBlockId">
                  <apex:pageBlockSection columns="1" id="pageSectionId">
                    <c:ProcedureComponent subForm="On-Study Pathology Form(Positive Breast Biopsies)" id="pageCompId"/>
                </apex:pageBlockSection>
              </apex:pageBlock>
              <apex:pageBlock title="Lymph Node Biopsies" id="pageBlockId1">
                  <apex:pageBlockSection columns="1" id="pageSectionId1">
                    <c:ProcedureComponent subForm="On-Study Pathology Form(Lymph Node Biopsies)" id="pageCompId1"/>
                </apex:pageBlockSection>
              </apex:pageBlock>
        </apex:tab>
         <apex:tab label="Disease Description" name="Disease Description" id="tabTwo" ontabenter="return false;">
             <b>Procedure(s):</b><apex:outputText value="{!tumor}"/>
             <apex:outputPanel >
                 <apex:form onsubmit="return check();">
                     <apex:pageBlock >
                         <apex:pageBlockButtons location="top">
                            <apex:commandButton action="{!next}" value="Next" reRender="theTabPanel" status="counterStatus"/>
                            <apex:actionStatus id="counterStatus" startText="Processing..." onstop=""/>
                           </apex:pageBlockButtons>
                         <apex:pageBlockSection >
                             <apex:pageBlockSectionItem >
                                 <apex:outputLabel value="Is DCIS present?" />
                                 <apex:inputField value="{!ospObj.Is_DCIS_Present__c}" onChange="showDCIS(this);"/>
                             </apex:pageBlockSectionItem>
                         </apex:pageBlockSection>
                     </apex:pageBlock>
                </apex:form>
                <apex:outputPanel id="pageBlockId2" style="display : none;">
                    <apex:pageBlock title="Procedure(s): DCIS Details"  >
                          <apex:pageBlockSection columns="1" id="pageSectionId2">
                            <c:DCIS subFormNew="On-Study Pathology Form" id="compId"/>
                        </apex:pageBlockSection>
                      </apex:pageBlock>
                  </apex:outputPanel>
                  <apex:form onsubmit="return check();">
                     <apex:pageBlock >
                         <apex:pageBlockSection >
                             <apex:pageBlockSectionItem >
                                 <apex:outputLabel value="Is LCIS present?" />
                                 <apex:inputField value="{!ospObj.Is_LCIS_Present__c}" onChange="showLCIS(this);"/>
                             </apex:pageBlockSectionItem>
                         </apex:pageBlockSection>
                     </apex:pageBlock>
                </apex:form>
                <apex:outputPanel id="pageBlockId3" style="display : none;">
                    <apex:pageBlock title="Procedure(s): LCIS Details" >
                          <apex:pageBlockSection columns="1" id="pageSectionId3">
                            <c:LCIS subFormLCIS="On-Study Pathology Form" id="pageCompId3"/>
                        </apex:pageBlockSection>
                      </apex:pageBlock>
                  </apex:outputPanel>
                  <apex:form onsubmit="return check();">
                     <apex:pageBlock >
                         <apex:pageBlockSection >
                             <apex:pageBlockSectionItem >
                                 <apex:outputLabel value="Is invasive tumor present?" />
                                 <apex:inputField value="{!ospObj.Is_invasive_tumor_present__c}" onChange="showITP(this);"/>
                             </apex:pageBlockSectionItem>
                         </apex:pageBlockSection>
                     </apex:pageBlock>
                </apex:form>
                <apex:outputPanel id="pageBlockId4" style="display : none;">
                    <apex:pageBlock title="Invasive Tumor Details" >
                          <apex:pageBlockSection columns="1" id="pageSectionId4">
                            <c:InvasiveTumor subFormIT="On-Study Pathology Form" id="pageCompId4"/>
                        </apex:pageBlockSection>
                      </apex:pageBlock>
                  </apex:outputPanel>
            </apex:outputPanel>
        </apex:tab>
    </apex:tabPanel>

</apex:page>

 

 

Please can any one help. Thanks in advance.

 

Kiran

 

Hi,

 

I am generating reports in xl format, attaching it, sending mail using apex class and scheduling it.

 

If I run this code using developer console I am getting all the report data. But, If I run the code using schedule job my generated xl file is showing with some script tag.

 

Pagereference ref = new Pagereference('https://--.salesforce.com/{ReportId}?export=1&enc=UTF-8&xf=csv');
Blob b = ref.getContent();
System.debug('----content--->'+b);
Messaging.EmailFileAttachment efa = new Messaging.EmailFileAttachment();
String dt = String.valueof(system.today());
efa.setFileName('24hrsDeals - DGL Units Received '+dt+'.csv');
efa.setBody(b);
Messaging.SingleEmailMessage email = new Messaging.SingleEmailMessage();
String[] toAddresses = new string[]{'asc.sfdc.tester@gmail.com'};
email.setSubject( 'Test' );
email.setToAddresses(toAddresses);
email.setPlainTextBody('Test');
email.setFileAttachments(new Messaging.EmailFileAttachment[] {efa});
Messaging.SendEmailResult [] r = Messaging.sendEmail(new Messaging.SingleEmailMessage[] {email});

 

Below is the generated xl file when scheduling.

 

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE">
<script>
var escapedHash = '';
var url = 'https://test.salesforce.com/?ec=302&startURL=%2F00OA00000044eKD%3Fxf%3Dcsv%26export%3D1%26inline%3D1%26enc%3DUTF-8';
if (window.location.hash) {
   escapedHash = '%23' + window.location.hash.slice(1);
}
if (window.location.replace){
window.location.replace(url + escapedHash);
} else {;
window.location.href = url + escapedHash;
}
</script>

</head>


 

I have two fields one with Rich text Area and other is long Text area. I have Trigger which removes all the HTML tags of Rich Text Area and stores in Long Text Area. Now my Text is generated with multiple spaces. So I tried with

result = result.replaceAll('\\s+',' ');

result = result.replaceAll('  ',' ');

result = result.replaceAll('&nbsp;&nbsp;',' ');

But this did not solve my problem. Is there any other solution to remove multi spaces between my text.

 

 

trigger UpdateSearsDescriptionFieldUpdate on ECS__Product__c (before insert, before update) {   

 

  for(ECS__Product__c pro : Trigger.new){       

  if(pro.ECS__Description__c != null && pro.ECS__Description__c != ''){           

  string result = pro.ECS__Description__c.replaceAll('<br/>',' ');         

    System.debug('pro.ECS__Description__c-----:'+pro.ECS__Description__c);       

      System.debug('result-----:'+result);             result = result.replaceAll('<br />',' ');  

           System.debug('result-----:'+result);             string HTML_TAG_PATTERN = '<.*?>';    

         System.debug('HTML_TAG_PATTERN-----:'+HTML_TAG_PATTERN);    

         pattern myPattern = pattern.compile(HTML_TAG_PATTERN);    

         System.debug('myPattern-----:'+myPattern);          

   matcher myMatcher = myPattern.matcher(result);       

      System.debug('myMatcher-----:'+myMatcher);    

         result = myMatcher.replaceAll('');  

           System.debug('result-----:'+result);    

         result = result.replaceAll('<br>','');    

         System.debug('result-----:'+result);    

         result = result.replaceAll('&lt;','');     

        System.debug('result-----:'+result);    

         result = result.replaceAll('&gt;','');     

        result = result.replaceAll('&amp;','&');    

         result = result.replaceAll('&#39;','\'');    

         result = result.replaceAll('\\s+',' ');    

         System.debug('result before replace-----:'+result);     

        result = result.replaceAll('  ',' ');     

        System.debug('result-----:'+result);    

         result = result.replaceAll('&nbsp;&nbsp;',' ');    

         System.debug('result-----:'+result);   

          if(result.length() > 2400) {   

           result = result.substring(0, 2400);   

          }     

        pro.Sears_com_Description__c = result;  

           System.debug('pro.Sears_com_Description__c-----:'+pro.Sears_com_Description__c);    

     }    

 }

 }

This is my code. Sears_com_Description__c is Long Text area and ECS__Description__c  is Rich Text Area.

 

 

Thanks,

 

Hi All,

 

I am writting a trigger which is updating a field removing all the Html tags.

 

trigger UpdateSearsDescriptionFieldUpdate on ECS__Product__c (before insert, before update) {    

             for(ECS__Product__c pro : Trigger.new){   

                 if(pro.ECS__Description__c != null && pro.ECS__Description__c != ''){       

                      string result = pro.ECS__Description__c.replaceAll('\'&lt;\'br/\'&gt;\'',' ');  

                      result = result.replaceAll('\'&lt;\'br /\'&gt;\'',' ');   

                      string HTML_TAG_PATTERN = '\'&lt;\'.*?\'&gt;\'';

                      pattern myPattern = pattern.compile(HTML_TAG_PATTERN);  

                      matcher myMatcher = myPattern.matcher(result);

                      result = myMatcher.replaceAll(' '); 

                      result = result.replaceAll('<br>',' ');

                      result = result.replaceAll('\'&lt;\'',' ');

                      result = result.replaceAll('\'&gt;\'',' ');

                      pro.Sears_com_Description__c = result;   

                     System.debug('pro.Sears_com_Description__c-----:'+pro.Sears_com_Description__c);  

       }

     }

 }

 

This trigger is working fine in SandBox but not working in prodution. ECS__Description__c is of Rich Text data type and Sears_com_Description__c is of long text area.

 

Thanks in advance.

 

Thanks,

Kiran

Hello,

 

I have a requirement to update parent record when there is a update on child record.

 

Suppose there is a Account with "Read-Only" permission and on a Opportunity with Full-Access, when I change the status of the opportunity, I should be able to update the account record as well. 

 

Can this be achieved in any ways. Please help me in solviing this mistery.

 

Thanks in Advanced 

Kiran

Hi everyone,

 

I am working on a visualforce page, which consist of components and tabs. When I am rendering my component it is going out of the form.

 

This is my code:

 

<apex:page standardController="On_Study_Pathology_Form__c" extensions="OnStudyPathology" id="pageId">
<script>
    function check() {
        var insertedProcedureIds = document.getElementById('pageId:pageBlockId:pageSectionId:pageCompId:ProcedureComponent:showProcedureForm:insertedProcedureIds').value;
        document.getElementById('pageId:formId:ProcedureIds').value = insertedProcedureIds;
        //alert(document.getElementById('pageId:formId:ProcedureIds').value);
        return true;
    }
    function showDCIS(val){
        if(val.value == 'Yes'){
            document.getElementById('pageId:pageBlockId2').style.display='';
        } else {
            document.getElementById('pageId:pageBlockId2').style.display='none';
        }
    }
    function showLCIS(val){
        if(val.value == 'Yes'){
            document.getElementById('pageId:pageBlockId3').style.display='';
        } else {
            document.getElementById('pageId:pageBlockId3').style.display='none';
        }
    }
    function showITP(val){
        if(val.value == 'Yes'){
            document.getElementById('pageId:pageBlockId4').style.display='';
        } else {
            document.getElementById('pageId:pageBlockId4').style.display='none';
        }
    }
</script>    
    <apex:tabPanel switchType="client" value="{!currentTab}" id="theTabPanel" contentStyle="font-size: 12px;">
        <apex:tab label="Procedure" name="procedureTab" id="ProcedureId" ontabenter="return false;">
            <apex:form onsubmit="return check();" id="formId">
                <apex:inputHidden id="ProcedureIds" value="{!ProcedureIds}" />
                <apex:pageBlock id="blockId">
                    <apex:pageBlockButtons location="top">
                        <apex:commandButton action="{!next}" value="Next" reRender="theTabPanel" status="counterStatus"/>
                        <apex:actionStatus id="counterStatus" startText="Processing..." onstop=""/>
                       </apex:pageBlockButtons>
                       <apex:pageBlockSection columns="1" id="blockSectionId">
                           <apex:pageBlockSectionItem >
                            <apex:outputLabel value="Does the patient have bilateral breast cancer?" for="procedureDate"/>
                            <apex:inputField value="{!ospObj.Does_the_patient_have_bilateral_breast_c__c}" id="procedureDate" required="true"/>
                        </apex:pageBlockSectionItem>
                        <apex:pageBlockSectionItem >
                            <apex:outputLabel value="Tumor laterality (or side with most advanced disease)" for="Tumorlaterality"/>
                            <apex:outputPanel >
                                <apex:inputField value="{!ospObj.Tumor_laterality__c}" id="Tumorlaterality" required="true"/>
                                <apex:outputlabel value="Select the breast that meets the criteria for the study"/>
                            </apex:outputPanel>
                        </apex:pageBlockSectionItem>
                       </apex:pageBlockSection>
                </apex:pageBlock>
            </apex:form>
            <apex:pageBlock title="Positive Breast Biopsies" id="pageBlockId">
                  <apex:pageBlockSection columns="1" id="pageSectionId">
                    <c:ProcedureComponent subForm="On-Study Pathology Form(Positive Breast Biopsies)" id="pageCompId"/>
                </apex:pageBlockSection>
              </apex:pageBlock>
              <apex:pageBlock title="Lymph Node Biopsies" id="pageBlockId1">
                  <apex:pageBlockSection columns="1" id="pageSectionId1">
                    <c:ProcedureComponent subForm="On-Study Pathology Form(Lymph Node Biopsies)" id="pageCompId1"/>
                </apex:pageBlockSection>
              </apex:pageBlock>
        </apex:tab>
         <apex:tab label="Disease Description" name="Disease Description" id="tabTwo" ontabenter="return false;">
             <b>Procedure(s):</b><apex:outputText value="{!tumor}"/>
             <apex:outputPanel >
                 <apex:form onsubmit="return check();">
                     <apex:pageBlock >
                         <apex:pageBlockButtons location="top">
                            <apex:commandButton action="{!next}" value="Next" reRender="theTabPanel" status="counterStatus"/>
                            <apex:actionStatus id="counterStatus" startText="Processing..." onstop=""/>
                           </apex:pageBlockButtons>
                         <apex:pageBlockSection >
                             <apex:pageBlockSectionItem >
                                 <apex:outputLabel value="Is DCIS present?" />
                                 <apex:inputField value="{!ospObj.Is_DCIS_Present__c}" onChange="showDCIS(this);"/>
                             </apex:pageBlockSectionItem>
                         </apex:pageBlockSection>
                     </apex:pageBlock>
                </apex:form>
                <apex:outputPanel id="pageBlockId2" style="display : none;">
                    <apex:pageBlock title="Procedure(s): DCIS Details"  >
                          <apex:pageBlockSection columns="1" id="pageSectionId2">
                            <c:DCIS subFormNew="On-Study Pathology Form" id="compId"/>
                        </apex:pageBlockSection>
                      </apex:pageBlock>
                  </apex:outputPanel>
                  <apex:form onsubmit="return check();">
                     <apex:pageBlock >
                         <apex:pageBlockSection >
                             <apex:pageBlockSectionItem >
                                 <apex:outputLabel value="Is LCIS present?" />
                                 <apex:inputField value="{!ospObj.Is_LCIS_Present__c}" onChange="showLCIS(this);"/>
                             </apex:pageBlockSectionItem>
                         </apex:pageBlockSection>
                     </apex:pageBlock>
                </apex:form>
                <apex:outputPanel id="pageBlockId3" style="display : none;">
                    <apex:pageBlock title="Procedure(s): LCIS Details" >
                          <apex:pageBlockSection columns="1" id="pageSectionId3">
                            <c:LCIS subFormLCIS="On-Study Pathology Form" id="pageCompId3"/>
                        </apex:pageBlockSection>
                      </apex:pageBlock>
                  </apex:outputPanel>
                  <apex:form onsubmit="return check();">
                     <apex:pageBlock >
                         <apex:pageBlockSection >
                             <apex:pageBlockSectionItem >
                                 <apex:outputLabel value="Is invasive tumor present?" />
                                 <apex:inputField value="{!ospObj.Is_invasive_tumor_present__c}" onChange="showITP(this);"/>
                             </apex:pageBlockSectionItem>
                         </apex:pageBlockSection>
                     </apex:pageBlock>
                </apex:form>
                <apex:outputPanel id="pageBlockId4" style="display : none;">
                    <apex:pageBlock title="Invasive Tumor Details" >
                          <apex:pageBlockSection columns="1" id="pageSectionId4">
                            <c:InvasiveTumor subFormIT="On-Study Pathology Form" id="pageCompId4"/>
                        </apex:pageBlockSection>
                      </apex:pageBlock>
                  </apex:outputPanel>
            </apex:outputPanel>
        </apex:tab>
    </apex:tabPanel>

</apex:page>

 

 

Please can any one help. Thanks in advance.

 

Kiran