• Vijay sidaraddi
  • NEWBIE
  • 175 Points
  • Member since 2015
  • Accenture

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 44
    Questions
  • 14
    Replies
Hi Friends, 
i have this user story to implement in vf  can someone help me on this requirement.

We should have component which can display the complete release status. By this we mean that we have to show in which org the release is deployed as of current day, in which org testing is completed and which are the target orgs are in pending status from deploying the code and testing. 
Ex: Consider we have 4 orgs i.e. Dev, QA, UAT and Prod. 
1. When new release is planned and implentation is started, we should show users that currently code is in dev sandbox which means release is in development phase. 
2. When code is deployed to QA, we should show that code is deployed to QA but pending to QA testing 
3. When QA testing is completed, we should show user that QA testing is completed 
4. When code is deployed to UAT, accordingly, we have to display the status 
5. when UAT is completed, we should show all previous stages and UAT as completed 
6. Once code is deployed and available to users, we should show complete pipeline as green meaning this release is successfully deployed to production.

Thanks
Vijaykumar S
Hi Friends,

Can some one help me where im wrong in this class and test class ,which is not covering minimum code coverage of 75% .also i have made bold things in test class which i couldnt able to satisfy in If statement can someone help on this.

Class Name :JenkinsConnectEmailServiceHandler 
global class JenkinsConnectEmailServiceHandler implements Messaging.InboundEmailHandler{
    
    global Messaging.InboundEmailResult handleInboundEmail(Messaging.InboundEmail email, Messaging.InboundEnvelope envelope){
        String subject = email.subject;
        List<String> subjectSplitList = subject.split('»'); 
        System.debug('*** subjectSplitList *** '+subjectSplitList);
        String stageDetails = subjectSplitList[subjectSplitList.size()-1];
        System.debug('*** Stage Name *** '+stageDetails);
        
        List<String> stageDetailsList = stageDetails.split('-');
        String stageName = stageDetailsList[0].trim();
        String buildNumberString = stageDetailsList[1].trim();
        String stageStatus = stageDetailsList[2].trim();
        Deployment_Stage__c stageObj;
        Decimal buildNumber = 0;
        for(String s: buildNumberString.split('#')){
            if(s.trim().isNumeric()){
                buildNumber = Decimal.valueOf(s.trim());
            }
        }
        
        //Map<String, String> stagesMap = new Map<String, String>();
        String stageLabel = '';
        for(Stages__c st: Stages__c.getAll().values()){
            //stagesMap.put(st.Stage_Name__c, st.Name);
            if(String.isEmpty(stageLabel) && stageName.containsIgnoreCase(st.Name)){
                stageLabel = st.Stage_Name__c; 
            }
        }
        
        /*for(Deployment__c dep: [select Id, (Select Id, Name, Build_Number__c, Stage_Label__c from Deployment_Stages__r 
                                            where  Stage_Label__c =: stageLabel AND Build_Number__c =: buildNumber)
                                from Deployment__c order by LastModifiedDate desc limit 1]){
          */                      
            for(Deployment_Stage__c stage: [Select Id, Name, Build_Number__c, Stage_Label__c from Deployment_Stage__c 
                                            where  Stage_Label__c =: stageLabel AND Build_Number__c =: buildNumber]){
                System.debug('*** stage *** '+stage);
                stageObj = stage;
                break;
                /*if(stageName.containsIgnoreCase(stagesMap.get(stage.Stage_Label__c)) && (buildNumber == stage.Build_Number__c)){
                    System.debug('*** stage matched *** '+stage.Stage_Label__c);
                    
                }*/
            }
        //}
        if(stageObj != null){
            List<Attachment> attachmentList = new List<Attachment>();
            // get attachments, if any
            if(email.textAttachments != null){
                for (Messaging.Inboundemail.TextAttachment tAttachment : email.textAttachments) {
                    Attachment attachment = new Attachment();
                    attachment.Name = tAttachment.fileName;
                    attachment.Body = Blob.valueOf(tAttachment.body);
                    attachment.ParentId = stageObj.Id;
                    attachmentList.add(attachment);
                }
            }
            if(email.binaryAttachments != null){
                for (Messaging.Inboundemail.BinaryAttachment bAttachment : email.binaryAttachments) {
                  Attachment attachment = new Attachment();
                 
                  attachment.Name = bAttachment.fileName;
                  attachment.Body = bAttachment.body;
                  attachment.ParentId = stageObj.Id;
                  attachmentList.add(attachment);
                }
            }
            insert attachmentList;
        }
        return null;
    }
}

****************************below is the test class for above class**********

@isTest
public class JenkinsConnectEmailServiceHandlerTests {
    public static testMethod void TestJenkinsConnectEmailServiceHandler()
    {
        RM_Configuration__c RConfig = new RM_Configuration__c();
        RConfig.RecordTypeid = DeploymentControllerService.getRecordTypeIdByName('RM_Configuration__c', 'RM Config');
        insert RConfig;
        Release__c re = new Release__c();
        re.Name='Release90';
        re.Status__c = 'Yellow';
        insert re;
        Deployment__c attachmenttext = new Deployment__c();    
        attachmenttext.Name = 'Build # 67';
        attachmenttext.Release__c = re.id;
        
        insert attachmenttext;
        Deployment_Stage__c DStage = new Deployment_Stage__c();
        DStage.Name = 'DevOps_CR_novasuite_code_analysis';
        DStage.Deployment__c = attachmenttext.id;
        Insert DStage;
        
        //attachmenttext.stage.Name = 'testing';
        // create a new email and envelope object
        Messaging.InboundEmail email = new Messaging.InboundEmail() ;
        Messaging.InboundEnvelope env = new Messaging.InboundEnvelope();  
        
        // setup the data for the email
        email.subject = 'Devops_Internal » Internal_Team » DevOps_CR_novasuite_code_analysis - Build # 67 - Successful: Check console output at http://52.49.193.65/jenkins/job/Devops_Internal/job/Internal_Team/job/DevOps_CR_novasuite_code_analysis/67/'; 
        email.fromAddress = 'someaddress@email.com';
        email.plainTextBody = 'email body\n2225256325\nTitle';
        
        // add an Binary attachment
        Messaging.InboundEmail.BinaryAttachment attachment = new Messaging.InboundEmail.BinaryAttachment();
        attachment.body = blob.valueOf('my attachment text');
        attachment.fileName = 'textfileone.txt';
        attachment.mimeTypeSubType = 'text/plain';
        email.binaryAttachments = new Messaging.inboundEmail.BinaryAttachment[] { attachment };
            
            // add an Text atatchment
            Messaging.InboundEmail.TextAttachment attachmentname = new Messaging.InboundEmail.TextAttachment();
        attachmentname.body = 'my attachment text';
        attachmentname.fileName = 'textfiletwo3.txt';
        attachmentname.mimeTypeSubType = 'texttwo/plain';
        email.textAttachments =   new Messaging.inboundEmail.TextAttachment[] { attachmentname };
            
            JenkinsConnectEmailServiceHandler testInbound=new JenkinsConnectEmailServiceHandler ();
        testInbound.handleInboundEmail(email, env); 
        
         
        
            Stages__c st1=new Stages__c();
        st1.Name='DevOps_CR_novasuite_code_analysis';
        
             insert st1;
        
        
        String subject = email.subject;
        List<String> subjectSplitList = subject.split('»');
        String stageDetails = subjectSplitList[subjectSplitList.size()-1];
        List<String> stageDetailsList = stageDetails.split('-');
        String stageName = stageDetailsList[0].trim();
        String buildNumberString = stageDetailsList[1].trim();
        String stageStatus = stageDetailsList[2].trim();
        Deployment_Stage__c stageObj;
        Decimal buildNumber = 0;
        for(String s: buildNumberString.split('#')){
            if(s.trim().isNumeric()){
                buildNumber = Decimal.valueOf(s.trim());
            }
        }
        String stageLabel = '';
        for(Stages__c st: Stages__c.getAll().values()){
            //stagesMap.put(st.Stage_Name__c, st.Name);
            if(String.isEmpty(stageLabel) && stageName.containsIgnoreCase(st.Name)){
                stageLabel = st.Stage_Name__c; 

            }
        }
       
    }
}

Thanks
Vijaykumar S
Hi All,
We were facing an issue in lightning component for a ‘Digital Signature’ component, where we replaced the following code to the below one in order to fix one locker services issue:
 
<canvas> in component before locker service was enabled:
<canvas id="PsignatureCanvas" class="box" />        (Previous line of code-before locker)
 
<canvas> in component change we’ve done after enabling locker service is:
<canvas aura:id="PsignatureCanvas" class="box"/>  (New changed line of code-after locker enabled)
 
 
Previous line of code in Renderer (was working fine with locker disabled):
                        Var canvas = document.getElementById("PsignatureCanvas");         // returning console value as -       [object HTMLCanvasElement]
                        Var context = canvas.getContext("2d");                                             //returning console value as -                 [object CanvasRenderingContext2D]
 
New locker fixing line of code in Renderer (changed to fix locker issue):
                        Var canvas = component.find('PsignatureCanvas');               // returning console value as -             SecureComponent: markup://aura:html {12315:0} {PsignatureCanvas}{ key: {"namespace":"c"} }
                        Var context = canvas.getContext("2d");                                        
     // showing error -                  
This page has an error. [canvas.getContext is not a function]


Thanks
Vijaykumar
Hi Friends,
I  am facing issues with the insert operation while reading from csv
can you help me on that


public class ImportDataFromCSVController {
    
    public Blob csvFileBody{get;set;}
    public List<SalesInfluenceReporting__c> salesInfList{get;set;}
    public Boolean showSave{get;set;}
    public Integer salesInfCount{get;set;}
    
    public ImportDataFromCSVController(){
        showSave = false;
        salesInfCount = 0;
    }
    
    public void saveRecords() {
        ApexPages.getMessages().clear();
        
        try{
                    
                    upsert salesInfList;
                    ApexPages.Message errorMessage = new ApexPages.Message(ApexPages.severity.CONFIRM,'Sales Influence Report Updated Successfully');
                    ApexPages.addMessage(errorMessage);
                
            
        }catch (Exception e){
            addErrorMsg('An error has occured while saving the Sales Influence Report.');
        }
     
    }
    
    public void importCSVFile(){
        showSave = false;
        salesInfList = New List<SalesInfluenceReporting__c>();
        map<String,SalesInfWrapper> csvMap = new map<String,SalesInfWrapper>();
        Integer mmsIdColumnNo = null;
        Integer quarterColumnNo = null;
        Integer monthColumnNo = null;
        Integer clientColumnNo = null;
        Integer OGColumnNo = null;
        Integer subVertColumnNo = null;
        Integer oppNameColumnNo = null;
        Integer statusColumnNo = null;
        Integer devOffColumnNo = null;
        Integer valueColumnNo = null;
        Integer natureOfOpptyColumnNo = null;
        Integer demoDoneColumnNo = null;
        string csvAsString = '';
        list<String> csvFileLines = new list<String>();
        
        
        List<SalesInfluenceReporting__c> tempList = new List<SalesInfluenceReporting__c>();
        try{
            csvAsString = csvFileBody.toString();
            csvFileLines = csvAsString.split('\n');
        }catch (Exception e){
            addErrorMsg('An error has occured while importing data. Please make sure input csv file is correct');
            return;
        }
        
        list<String> csvHeaderData = csvFileLines[0].split(',');
        for(Integer i=0;i<csvHeaderData.size();i++){
            if(csvHeaderData[i].trim()=='MMS Id'){
                mmsIdColumnNo = i;
            }else if(csvHeaderData[i].trim()=='Quarter'){
                quarterColumnNo = i;
            }else if(csvHeaderData[i].trim()=='Month'){
                monthColumnNo = i;
            }else if(csvHeaderData[i].trim()=='Client'){
                clientColumnNo = i;
            }else if(csvHeaderData[i].trim()=='OG'){
                OGColumnNo = i;
            }else if(csvHeaderData[i].trim()=='Sub-Vertical'){
                subVertColumnNo = i;
            }else if(csvHeaderData[i].trim()=='Opportunity Name'){
                oppNameColumnNo = i;
            }else if(csvHeaderData[i].trim()=='Status'){
                statusColumnNo = i;
            }else if(csvHeaderData[i].trim()=='DevOps Offered'){
                devOffColumnNo = i;
            }else if(csvHeaderData[i].trim()=='Value'){
                valueColumnNo = i;
            }else if(csvHeaderData[i].trim()=='Nature Of Oppty'){
                natureOfOpptyColumnNo = i;
            }else if(csvHeaderData[i].trim()=='Demo Done'){
                demoDoneColumnNo = i;
            }
        }
        if(mmsIdColumnNo != null && quarterColumnNo != null && monthColumnNo != null && clientColumnNo != null && OGColumnNo != null && subVertColumnNo != null && oppNameColumnNo != null && statusColumnNo !=null && devOffColumnNo != null && valueColumnNo !=null && natureOfOpptyColumnNo != null && demoDoneColumnNo !=null ){
            
            for(Integer i=1;i<csvFileLines.size();i++){
                string[] csvRecordData = csvFileLines[i].split(',');
                SalesInfWrapper recWrapper = new SalesInfWrapper();
               
                recWrapper.mmsId = csvRecordData[mmsIdColumnNo];
                recWrapper.quarter = csvRecordData[quarterColumnNo];    
                recWrapper.month = csvRecordData[monthColumnNo];
                recWrapper.client = csvRecordData[clientColumnNo];
                recWrapper.OG = csvRecordData[OGColumnNo];
                recWrapper.subVertical = csvRecordData[subVertColumnNo];
                recWrapper.oppName = csvRecordData[oppNameColumnNo];
                recWrapper.status = csvRecordData[statusColumnNo];
                recWrapper.devOpsOff = csvRecordData[devOffColumnNo];
                recWrapper.value = csvRecordData[valueColumnNo];
                recWrapper.natureOfOpty = csvRecordData[natureOfOpptyColumnNo];
                recWrapper.demoDone = csvRecordData[demoDoneColumnNo];
                  
                csvMap.put(csvRecordData[mmsIdColumnNo],recWrapper); 
                
                //salesInfList.add(recWrapper);
                }
                
            }
            tempList = [Select MMS_Id__c, Quarter__c, Month__c, Client__c, OG__c, Opportunity_Name__c, Sub_Vertical__c,Demo_Done__c, Status__c,Value__c,Nature_of_Oppty__c, DevOps_Offered__c From SalesInfluenceReporting__c Where MMS_Id__c In : csvMap.keySet()];
            system.debug('------tempList -----'+tempList );
            system.debug('------tempList.size()-----'+tempList.size() );
            if(tempList.size()>0)
            {
                for(SalesInfluenceReporting__c currRec : tempList ){
                            currRec.MMS_Id__c = csvMap.get(currRec.MMS_Id__c).mmsId;
                            currRec.Quarter__c = csvMap.get(currRec.MMS_Id__c).quarter;
                            currRec.Month__c = csvMap.get(currRec.MMS_Id__c).month;
                            currRec.Client__c = csvMap.get(currRec.MMS_Id__c).client;
                            currRec.OG__c = csvMap.get(currRec.MMS_Id__c).OG;
                            currRec.Sub_Vertical__c = csvMap.get(currRec.MMS_Id__c).subVertical;
                            currRec.Opportunity_Name__c = csvMap.get(currRec.MMS_Id__c).oppName;
                            currRec.Status__c = csvMap.get(currRec.MMS_Id__c).status;
                            currRec.DevOps_Offered__c = csvMap.get(currRec.MMS_Id__c).devOpsOff;
                            currRec.Value__c = csvMap.get(currRec.MMS_Id__c).value;
                            currRec.Nature_of_Oppty__c = csvMap.get(currRec.MMS_Id__c).natureOfOpty;
                            currRec.Demo_Done__c = csvMap.get(currRec.MMS_Id__c).demoDone;
                            salesInfList.add(currRec);
                    }
            }
            
            else{
                addErrorMsg('No Matching Sales Influence Reports Found.');
                return;
                }
            if(salesInfList.size()>0){
                showSave = true;
                salesInfCount = salesInfList.size();
                system.debug('------countt-----'+salesInfCount );
            }
            /*else if(salesInfList.size() == 0){
                showSave = true;
                saveRecords();
            } */
            else
            {
                addErrorMsg('No Sales Influence Reports To Update. All values are up to date.');
            }
           }
            
      
    public class SalesInfWrapper{
        public string mmsId{get;set;}
        public string quarter{get;set;}
        public string month{get;set;}
        public string client{get;set;}
        public string OG{get;set;}
        public string subVertical{get;set;}
        public string oppName{get;set;}
        public string status{get;set;}
        public string devOpsOff{get;set;}
        public string value{get;set;}
        public string natureOfOpty{get;set;}
        public string demoDone{get;set;}
        
    }
    
    public void addErrorMsg(String err){
        ApexPages.Message errorMessage = new ApexPages.Message(ApexPages.severity.ERROR,err);
        ApexPages.addMessage(errorMessage);
    }

   
}
************************vf page****************


<apex:page controller="ImportDataFromCSVController">
    <apex:form >
        <apex:pagemessages />
        <apex:pageBlock >
            <apex:pageBlockSection columns="4"> 
                <apex:inputFile value="{!csvFileBody}"  />
                <apex:commandButton value="Upload CSV" action="{!importCSVFile}"/>
            </apex:pageBlockSection>
        </apex:pageBlock>
        <apex:pageBlock id="opptySec">
            <apex:pageBlockButtons location="top">
               <apex:commandButton action="{!saveRecords}" value="Save Sales Influence Reports" /> 
            </apex:pageBlockButtons>
             <apex:outputPanel rendered="{!showSave}"><b>Number Of Opportunities : {!salesInfCount }</b></apex:outputPanel>
           <apex:pageblocktable value="{!salesInfList}" var="salesInf">
                <apex:column value="{!salesInf.MMS_Id__c}"/> 
                <apex:column value="{!salesInf.Quarter__c}"/>
                <apex:column value="{!salesInf.Month__c}"/>
                <apex:column value="{!salesInf.Client__c}"/>
                <apex:column value="{!salesInf.OG__c}"/>
                <apex:column value="{!salesInf.Sub_Vertical__c}"/>
                <apex:column value="{!salesInf.Opportunity_Name__c }"/>
                <apex:column value="{!salesInf.Status__c }"/>
                <apex:column value="{!salesInf.DevOps_Offered__c }"/>
                <apex:column value="{!salesInf.Value__c }"/>
                <apex:column value="{!salesInf.Nature_of_Oppty__c }"/>
                <apex:column value="{!salesInf.Demo_Done__c }"/>
                
                
            </apex:pageblocktable> 
        </apex:pageBlock>
    </apex:form>
</apex:page>
             
Thanks
Vijaykumar 


 
I have a  scenario-
 
There are 2 objects-
 
SalesInfluenceReportings : It is loaded with data corresponding to CMT.
Masters : It is loaded with master data for all types of OG.
 
Now, we need to have a relationship and based on MMS Id from SalesInfluenceReportings and Opportunity Id from Masters these should be related.
 
I have created a trigger on after insert/update to populate the field but it is not updating. Can you please look into the code and help me if I am missing something.
Trigger Name : updateMaster


trigger updateMaster on SalesInfluenceReporting__c (after insert, after update) {
 
  Map<Id, String> idMap = new Map<Id, String>();
  Boolean matchOnce = false;

    for(SalesInfluenceReporting__c obj :trigger.new)

    {
        idMap.put(obj.Name,obj.MMS_Id__c);
        
        system.debug('********'+idMap);
       
     }
     
     

 List<Master__c> mList =[Select Id,Opportunity_Id__c from Master__c ]; 
    
 List<SalesInfluenceReporting__c > ul = new List<SalesInfluenceReporting__c >();
 
 for(SalesInfluenceReporting__c obj :trigger.new)
{
     for(Master__c m :mList ){
        
           SalesInfluenceReporting__c  rectoUpdate = new SalesInfluenceReporting__c ();
                system.debug('+++++++++'+idMap.get(obj.id));
                if(matchOnce == false){
                if(m.Opportunity_Id__c == idMap.get(obj.id)){
                rectoUpdate.Id = obj.id;
                rectoUpdate.Master__c = m.id;
                matchOnce = true;
                ul.add(rectoUpdate );  
                system.debug('-------'+rectoUpdate );   
           }
          }
         break;
      }
   }
    system.debug('@@@@@@@@'+ul);
    update ul;
}

Can someone tell me where im wrong its not updating .

Thanks
Vijaykumar.S
HI Friends,

Can someone help me where im wrong in this query as im getting only record id instead its values which i have highlighrd fields  in bold which are lookup fields. even if i tried for relationship still im getting record ids.


        lstAssignment = [SELECT ENQ_Project_Name__c,ENQ_AFE__c,ENQ_Inspection_Level__c,
                         ENQ_Status__c,ENQ_Surveillance_Discipline__c,ENQ_Other__c,ENQ_QSC_Contact__r.Name,
                         ENQ_QSC__c,ENQ_Enbridge_Work_Order_Number__c,ENQ_Vendor_Shop_Number__c,ENQ_QSC_Work_Order__c,
                         ENQ_Supplier_Tracking_Number__c,ENQ_QSC_Report_Number__c,ENQ_Prime_Supplier_Name__c,                  ENQ_Sub_Supplier_Name__c, ENQ_Prime_Supplier_Contact__c,ENQ_Sub_Supplier_Contact__c,ENQ_Estimated_of_Visits__c,ENQ_Scheduled_Start_Date__c, ENQ_Estimated_Assignment_Hours__c,ENQ_Scheduled_End_Date__c,ENQ_Actual_Hours__c,ENQ_Estimated_Travel_Distance__c,ENQ_Hours_Remaining__c,ENQ_Unit_of_Distance__c,ENQ_Actual_Distance_Miles__c,ENQ_Distance_Remaining__c,ENQ_Comments__c  FROM ENQ_Assignment_Package__c
                   WHERE Id = :ApexPages.currentPage().getParameters().get('Id')];
                               
    
HI Friends,

im trying to get the records for nested query in developer, i couldn ot able to do it can some one suggest me where im wrong 

SELECT ENQ_Project_Name__c,ENQ_AFE__c,ENQ_Inspection_Level__c,
                         ENQ_Status__c,ENQ_Surveillance_Discipline__c,ENQ_Other__c,
                         (SELECT ENQ_QSC__c,ENQ_QSC_Contact__c FROM ENQ_Surveillance_Reports__c)
                          FROM ENQ_Assignment_Package__c 

Error message : 
ENQ_QSC__c,ENQ_QSC_Contact__c FROM ENQ_Surveillance_Reports__c)
                                   ^
ERROR at Row:3:Column:69
Didn't understand relationship 'ENQ_Surveillance_Reports__c' in FROM part of query call. If you are attempting to use a custom relationship, be sure to append the '__r' after the custom relationship name. Please reference your WSDL or the describe call for the appropriate names.

Thanks
Vijaykumar 
HI friends,

Suggest me wherer im wrong in this apex class


public with sharing class Pdfcontroller {
   { public List assList{get;set;}
    public Pdfcontroller (){
        assList = [select assignmentnumber,AFE,inspectionlevel,ProjectName,status from assignmentpackage limit 10];
    }
}

***************Vf page*******************
<apex:page controller="PdfController" renderAs="pdf">
  <apex:form >
    <apex:pageBlock >
        <apex:pageBlockTable value="{!assList}" var="ass" border="2">
           <apex:column value="{!ass.assignmentnumber}"/>
           <apex:column value="{!ass.AFE}"/>
           <apex:column value="{!ass.inspectionlevel}"/>
           <apex:column value="{!ass.ProjectName}"/>
           <apex:column value="{!ass.status}"/>
        </apex:pageBlockTable>
    </apex:pageBlock>
  </apex:form>
</apex:page>

 
hi can someone suggest me where im wrong in this class as i couldnt able to save it.

public class ExportasPDF {
 public static Integer AssignmentNumber
    public ExportasPDF() {
        AssignmentNumber = [SELECT AssignmentNumber, AFE FROM AssignmentPackage
                   WHERE AssignmentNumber = :ApexPages.currentPage().getParameters().get('AssignmentNumber')];
    }

 
    public AssignmentPackage getAssignmentNumber() {
        return assignmentPackage;
    }

    public PageReference ExportasPDF() {
        update AssignmentNumber;
        return null;
    }
}




*********Vf page 

<apex:page controller="ExportasPDF" tabStyle="AssignmentPackage">
    <apex:form>
        <apex:pageBlock title="New assignment package {!$User.Assignment Number}">
             belong to Assignment AFE: <apex:inputField value="{!Assignment.AFE}"/>

            <apex:commandButton action="{!ExportasPDF}" value="ExportasPDF"/>
        </apex:pageBlock>
    </apex:form>
</apex:page>

Thanks
Vijaykumar S
Hi , 

create a VF page to generate a PDF from the Case objects which includes fields This pdf should cover all the info from the case object as well as the related lists like Related Contracts, case Assignments,Contacts and Scope of work.

Can someone please provide me apex class for this object.

 
  1. Trigger for Sharing records – how to  build the following triggers?
    1. On the Case object  object
      1. When the case is assigned to QSC contact , he needs to get visibility in Read Write mode
      2. If the QSC Contact is removed, this visibility need to be removed
Hi Team,

Could someone tell how to do htis 
Build a button called “Export as PDF” on the case object and create a VF page to generate a PDF from the case object .

Thanks
Vijaykumar.S 

Hi frineds,

How to write a batch process to pull records from a csv file which is kept in an FTP location. We will need this for PO/ materials integration Can someone help me on this.

 

Thanks

Vijaykumar S

Hi
I have object A which is having ten fields data also i have another object which is Object B  but i want to full column A,and ColumnB data   to Vf page  to display both te objects data is this is possible through SOQL ..

as per my understand i can display data using SOSL, is there any possibilities to display multiple objects data into a VF page..

Cheers!!
Vijay S
Hi 

I have two object A and object B where object b is having  three records in it  i have to do some perform action on object A when object B is to have 4 records in it. how to acheive it , logic 

Thanks
Vijay 
HI
I have three object A, B and C but  i want to make C as my junction object 
where i will define master detail relationship and which one will be hte primary and secondary

Thanks
Vijay
Hi 
i have classes to move production org from development org , waht are the base requirement, 

is it posible can deploy changes to production org which is only comepleted only 60 percentage testing 

Thanks
Vijay S
Hi
I have object A which is having ten columns but i want to full column A,and ColumnB data   to Vf page and objectB is having ten columns of data i want to full only column c and Column D data of Object B to Vf page  in the same page 
using two different object data to display in single VF page , how to achieve it..

Thanks
Hi

i have Account object which is having ten columns among that i  want column a , columnB,column c, and column D data  to 
display in VF page How to do it?

Thanks
Vijay
HI 

Action fucntion is used to refresh the VF partial page using rerender  can i do it by using Apex button on that 

calling method  teh fucntionality is used for action attribute used is it possible can we do it through apex button if 

yes how?

Thanks
Vijay 
I have a  scenario-
 
There are 2 objects-
 
SalesInfluenceReportings : It is loaded with data corresponding to CMT.
Masters : It is loaded with master data for all types of OG.
 
Now, we need to have a relationship and based on MMS Id from SalesInfluenceReportings and Opportunity Id from Masters these should be related.
 
I have created a trigger on after insert/update to populate the field but it is not updating. Can you please look into the code and help me if I am missing something.
Trigger Name : updateMaster


trigger updateMaster on SalesInfluenceReporting__c (after insert, after update) {
 
  Map<Id, String> idMap = new Map<Id, String>();
  Boolean matchOnce = false;

    for(SalesInfluenceReporting__c obj :trigger.new)

    {
        idMap.put(obj.Name,obj.MMS_Id__c);
        
        system.debug('********'+idMap);
       
     }
     
     

 List<Master__c> mList =[Select Id,Opportunity_Id__c from Master__c ]; 
    
 List<SalesInfluenceReporting__c > ul = new List<SalesInfluenceReporting__c >();
 
 for(SalesInfluenceReporting__c obj :trigger.new)
{
     for(Master__c m :mList ){
        
           SalesInfluenceReporting__c  rectoUpdate = new SalesInfluenceReporting__c ();
                system.debug('+++++++++'+idMap.get(obj.id));
                if(matchOnce == false){
                if(m.Opportunity_Id__c == idMap.get(obj.id)){
                rectoUpdate.Id = obj.id;
                rectoUpdate.Master__c = m.id;
                matchOnce = true;
                ul.add(rectoUpdate );  
                system.debug('-------'+rectoUpdate );   
           }
          }
         break;
      }
   }
    system.debug('@@@@@@@@'+ul);
    update ul;
}

Can someone tell me where im wrong its not updating .

Thanks
Vijaykumar.S
HI Friends,

Can someone help me where im wrong in this query as im getting only record id instead its values which i have highlighrd fields  in bold which are lookup fields. even if i tried for relationship still im getting record ids.


        lstAssignment = [SELECT ENQ_Project_Name__c,ENQ_AFE__c,ENQ_Inspection_Level__c,
                         ENQ_Status__c,ENQ_Surveillance_Discipline__c,ENQ_Other__c,ENQ_QSC_Contact__r.Name,
                         ENQ_QSC__c,ENQ_Enbridge_Work_Order_Number__c,ENQ_Vendor_Shop_Number__c,ENQ_QSC_Work_Order__c,
                         ENQ_Supplier_Tracking_Number__c,ENQ_QSC_Report_Number__c,ENQ_Prime_Supplier_Name__c,                  ENQ_Sub_Supplier_Name__c, ENQ_Prime_Supplier_Contact__c,ENQ_Sub_Supplier_Contact__c,ENQ_Estimated_of_Visits__c,ENQ_Scheduled_Start_Date__c, ENQ_Estimated_Assignment_Hours__c,ENQ_Scheduled_End_Date__c,ENQ_Actual_Hours__c,ENQ_Estimated_Travel_Distance__c,ENQ_Hours_Remaining__c,ENQ_Unit_of_Distance__c,ENQ_Actual_Distance_Miles__c,ENQ_Distance_Remaining__c,ENQ_Comments__c  FROM ENQ_Assignment_Package__c
                   WHERE Id = :ApexPages.currentPage().getParameters().get('Id')];
                               
    
HI friends,

Suggest me wherer im wrong in this apex class


public with sharing class Pdfcontroller {
   { public List assList{get;set;}
    public Pdfcontroller (){
        assList = [select assignmentnumber,AFE,inspectionlevel,ProjectName,status from assignmentpackage limit 10];
    }
}

***************Vf page*******************
<apex:page controller="PdfController" renderAs="pdf">
  <apex:form >
    <apex:pageBlock >
        <apex:pageBlockTable value="{!assList}" var="ass" border="2">
           <apex:column value="{!ass.assignmentnumber}"/>
           <apex:column value="{!ass.AFE}"/>
           <apex:column value="{!ass.inspectionlevel}"/>
           <apex:column value="{!ass.ProjectName}"/>
           <apex:column value="{!ass.status}"/>
        </apex:pageBlockTable>
    </apex:pageBlock>
  </apex:form>
</apex:page>

 
hi can someone suggest me where im wrong in this class as i couldnt able to save it.

public class ExportasPDF {
 public static Integer AssignmentNumber
    public ExportasPDF() {
        AssignmentNumber = [SELECT AssignmentNumber, AFE FROM AssignmentPackage
                   WHERE AssignmentNumber = :ApexPages.currentPage().getParameters().get('AssignmentNumber')];
    }

 
    public AssignmentPackage getAssignmentNumber() {
        return assignmentPackage;
    }

    public PageReference ExportasPDF() {
        update AssignmentNumber;
        return null;
    }
}




*********Vf page 

<apex:page controller="ExportasPDF" tabStyle="AssignmentPackage">
    <apex:form>
        <apex:pageBlock title="New assignment package {!$User.Assignment Number}">
             belong to Assignment AFE: <apex:inputField value="{!Assignment.AFE}"/>

            <apex:commandButton action="{!ExportasPDF}" value="ExportasPDF"/>
        </apex:pageBlock>
    </apex:form>
</apex:page>

Thanks
Vijaykumar S

Hi frineds,

How to write a batch process to pull records from a csv file which is kept in an FTP location. We will need this for PO/ materials integration Can someone help me on this.

 

Thanks

Vijaykumar S

Hi
I have object A which is having ten fields data also i have another object which is Object B  but i want to full column A,and ColumnB data   to Vf page  to display both te objects data is this is possible through SOQL ..

as per my understand i can display data using SOSL, is there any possibilities to display multiple objects data into a VF page..

Cheers!!
Vijay S
Hi 

I have two scenario  

1) I have read access on my profile levele for an objectA  and OWD is public read/write for same object which is ObjectA, what access i have here 
I mean do i have only read accesss for this object or write also( my thinking is only read) 

2) I have Write access on my profile levele for an objectA  and OWD is public read  for same object which is ObjectA, what access i have here 
I mean do i have only read accesss for this object or write also( my thinking is only read)

My answer is I can edit object field if i have write access in profile level?

please provide me the anwers.

Thanks
Vijay S
 
Hi Team,

There is a standard opportunity page , which is having custom which can call a method, how to do it,( If Vf page was not there) .

Thanks
* USer A  (profile a)  is going to  create a record he is the owner of it /created a Case,once you create a case tht particuler page should be locked once you submitted to suport team so now its locked if owner want to make update of any field for case object ,should not able to edit once you submitted to the support, if you owner want to make changes to the case ,how to achieve this? 

How to edit cases by owner of the case once it is locked 

Thanks
Vijay S
 
Hi 

A user is made a field is hidden if I have to run one apex class which is accessing a same filed which is hidden by other user will my apex class run or will i Get any error ?

Thanks
Vijay S
Hi Friends,

Could you please help some on this

When I accepted lead records in my Queue it should assigned to me ( I mean once accepted Im the owner of that record mean time it should also get changed its status as in progress , how to achieve this.
Hi,

I have Vf page which is having 10 records when i selected one record which is having check box than it should be enable the  button  than im going to share selected record with some user ( for sharing i can use apex sharing, let me know), let me know how to do this.

<apex:page Controller="Democlass" extensions="">
<apex:form>
<apex:inputCheckbox id="isCheckBox" style="opacity:{!w2.isPartOrderabilityStatusCode};" value="{!w2.isCheckBox}" >
<apex:actionSupport event="onclick" action="{!checkBoxStaus}" reRender="pb2"/>
</apex:inputCheckBox>
<apex:commandButton value="Add Selected"   rendered="{!(if(isButtonValid==true, true, false))}" action="{!selectRecords}" id="sparebtn" reRender="frm">
<apex:actionSupport event="onclick" rerender="resultsBlock" status="statusSaveTrip"/>
</apex:commandButton>
</apex:form>
</apex:page>

Thanks
Vijay S