• SHAIK MOHAMMAD YASEEN
  • NEWBIE
  • 155 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 30
    Questions
  • 17
    Replies
Hi All,

I am having code below. for a batch, when ever my batch fails i will send an email to admin with the current batch status, can you please help me how to cover the else part in the finish method. 

public class AccountBatch implements Database.Batchable<sObject>
{
    public database.QueryLocator start(Database.BatchableContext bc)
    {
        string Query='select id, Name From Account';
        system.debug('Query-->'+Query);
        return database.getQueryLocator(Query);
    }
    public void execute(database.BatchableContext bc,list<sObject> scope)
    {   
        helperClass test = new helperClass();
        test.helperMethod(scope);
    }  
    public void finish(Database.BatchableContext bc)
    {
        AsyncApexJob a = [Select Id, Status, NumberofErrors, JobItemsProcessed, TotalJobItems, CreatedBy.Email, ExtendedStatus
                          from AsyncApexJob
                          Where Id =:bc.getJobId()];
        String batchName = 'AccountBatch';                
        If(a.Status=='Completed' && a.NumberofErrors==0)
        {
            Database.executeBatch(new nextBatch(),50);                      
        }
        else
        { 
            System.debug('invalid batch');
            UtilityCls bu = new UtilityCls();      
            bu.sendEmailNotificationOnBatchJobFail(batchName, a.Status, a.TotalJobItems, a.NumberOfErrors,a.ExtendedStatus);
        } 
    }       
}
Hi All,

Can you please help with the requirement for conga composer report, I am having three fields which i need to use Group by "department__c", "Function__c", "Member__r.Name" and get the data. below is the query for example. I am getting the total average for the records but i should need the average in different way.

Like we need the avaerage of Effectiveness__c for Department__C, avaerage of Effectiveness__c for Function__c, and avaerage of Effectiveness__c for Member__r.Name

below is the tree view
Department__c---top 
Function__c-- sceond top
Member__r.Name-- last 

Current Query:
SELECT AVG(EffectiveNess__c), department__c, Function__c, Member__r.Name FROM FF__Plan__c GROUP BY department__c, Function__c, Member__r.Name

below is the test data: i need the effectiveness indiviudally like for a department i need the average effectivess, for a function, for a member.
Effective ness  Department Function  Member
10                    Dept1          Func11    Member11
20                    Dept1          Func11    Member12
10                    Dept1          Func12   Member11
20                    Dept1          Func12   Member12
10                    Dept2          Func21   Member21
10                    Dept2          Func21   Member22

Please help me on this request
Hi All,

Please help on the below requirement. 

Is it possible to create a list view for users to view the emails from all of the queues to which they are assigned in one bucket.

Best Regards,
 
Hi All,

Can you please help me with any sample code which will display records of account object on vfpage with pagination jquery grid(http://js-grid.com/demos/) having below options.
*sorting
*filtering
*with pagination buttons and page numbers

In the above i am having a controller will get the list of accounts(AccList) in constructor, i have to display 20 records per page. each next button of page number is clicked it should not go to controller all the processing should be done in jquery itself.

Please let me know if any possibility for the above. please refer the link for clear idea "http://js-grid.com/demos/"
Thanks in advance,
Mohammad Yaseen
 
Hi All,

On VFpage i have inputtext field when button is clicked I have to display the text in the inputtext field below the field and empty the inputtext. i should be having the ability to repeat the same for n number of button clicks

Please help me with sample code for the same. Thanks

Best Regards,
Mohammad Yaseen
Hi All,

Please help me on the below 

I have a VFpage where in one section i need to display all the avaliable attachments for a record(FYI i have record ID for the partitcular record lets say recId).

Please help me with sample code in order to acheive this also on click of the attachment record i should be able to download the attachment.

BEst Regards,
Mohammad Yaseen
Hi All,

I am using static resource bootsrap for alignment of the page, when i am trying to render the page as pdf the alignment is failing and getting the boostrap file code as text and disaplyed on my vfpage at the top. 

my requirement is on click of button on vfpage i need to get the page(as pdf/as image) and attach to the record. can we acheive this with out loosing alignment. if yes it would be very greatful if you can share me with code for the same. Thansk


Best Regards,
Mohammad Yaseen
Hi All,

I am having below selectradio on my vfpage with values"agree" and "disagree", now my requirement id i need to check if the radio button is checked or not after clicking a button.

can any one please with code to implement this using javascript

<apex:pageBlock id="block">
<apex:selectRadio  id="radioButtonId" value="{!selectedValue}" styleClass="mandatoryField" >
<apex:selectOptions  value="{!RadioValues}" />
</apex:selectRadio>

Best Regards,
Mohammad Yaseen.
<apex:pageBlock id="block">
Hi All,

on a vfpage i have a inputtext box and a insert button next to it. 

my requirement is when user types some text in the inputtextbox and presees insert button then a new row has to be added below with the text as outputtext. 

when the user again types some text in the input textbox and again pressed insert button then the previously added row should go down and the new row should be added with the text input 

Please let me know how to achieve. it will be more helpful if code can be shared for the same.

Best Regards,
Mohammad Yaseen.
Hi All,

I have a VFpage with some content on it and top i have two radio checkboxes(agree and disagree) and a button(submit).

Now my requirement is i have to disable the radio checkboxes and button when the page loads and have to enable the same when the user scrolls till end of the page(just to ensure he has read the entire content of page).


Please help me how to achieve this functionality and also please share if there any code for the same. Thanks.

BEst Regards,
Mohammad Yaseen
Hi All,

I am new to UI(usage of CSS, bootstrap and jscript with VFpage)Please help me on the below issue, i want to dispaly a custom error message if user doesnt input value in the below text box and clicks the button it has to show a custom message as a pop up saying the field is a mandatory.
Can anyone please help me with the css and style code fto achieve this. below i have mentioned the sample code for the field and the button

Field code below:
<apex:outputPanel rendered="{!secQuesAns.isfreeText}">
<apex:inputTextarea id="textareview" value="{!secQuesAns.SelectedAnswer}" rows="3" styleClass="need manadatoryclass here" style="resize:none;" />
 </apex:outputPanel>


button code below:
<div class="panel-body" >
<span><a class=" btn btn-primary" onclick="submitedrec();">Submit</a></span>
</div>


actionfunction code:
<apex:actionFunction name="submitrec" action="{!submitrecord}"  > </apex:actionFunction>

custom message code
<div ><span style="color:red;"> <b>(!) All the questions in this questionnaire are mandatory,Please verify and answer all the questions required below</b></span><br/><br/><br/></div>



Best Regards,
Mohammad Yaseen
Hi All,

I have a custom object custObj with fields Question__c, answer__c, i am querying old records from database into a list oldRecsList

now i have a new List newRecsList i am getting from UI which doesnot have ids, now i have to compare two lists check if Question__c of old list and Question__c of new list are same if yes then have to check if answer__c are different. based on the criteria i have to insert new records which are not in database and update the records with changes in to old records, delete the old records if they are not in new list.

I have tried iterating two lists but was unable achieve may be i was unable to include some complex logics. here is the sameple code. please help me wha are all should be considered and where was i doing wrong. Thanks

for(custObj__c newRec :newRecsList )
            {
                for(custObj__c savedRec: oldRecsList)
                {
                    if(savedRec.Question__c ==newRec.Question__c && savedRec.answer__c!= newRec.answer__c)
                    {
                       savedRec.answer__c=newRec.answer__c;
                        ListtoUpdateRecs.add(savedRec);
                    }
                    else if(savedRec.question__c!=newRec.question__c)
                    {
                        ListtodeleteRecs.add(savedRec);
                    }
                    else
                    {
                        ListtoInsertRecs.add(newRec);
                    }
                }
            }
            update ListtoUpdateRecs;
            delete ListtodeleteRecs;
            insert ListtoInsertRecs;
Hi All,

I have requirement where i have to use custom label which contains the url, i have to embed url in html email template on a field along with the detail link of the particular record.

Please help me how to reference the custom label in html emil template as well as how to merge detail link along with the custom label to embed on the field

best regards,
mohammad yaseen
Hi All,

I am downloading an excel report from VFpage i am having four columns header1, header2, header3, header4, i am having sample data as below. 

header1 header2 header3 header4
aaaa     aaaaaa  aaaaaaa aaaaaa
bbbb     bbbbbb  bbbbbbb bbbbbb
aaaa     aaaaaa  aaaaaaa aaaaaa
aaaa     aaaaaa  aaaaaab aaaaab
aaaa     aaaaaa  aaaaaab aaaaaa
aaaa     aaaaab  aaaaaab aaaaab

I need to sort as below. Please how can we achieve this. Please note that i am passing a map whcih holds the data. here is the format. 
map<header1,List < obj>> where obj contains header2, header3, header4. 

header1 header2 header3 header4
aaaa     aaaaaa  aaaaaaa aaaaaa
aaaa     aaaaaa  aaaaaaa aaaaaa
aaaa     aaaaaa  aaaaaab aaaaaa
aaaa     aaaaaa  aaaaaab aaaaab
aaaa     aaaaab  aaaaaab aaaaab
bbbb     bbbbbb  bbbbbbb bbbbbb

Please help me how to acheive this. Thanks
 
Hi All,

below i have a piece of code where i  need to sort the items correctly but sort is not happenning correctly. please help me how to achieve in this case. Thanks


List < string > testList = new List < string >();
testList.add('12 hours');
testList.add('48 hours');
testList.add('24 hours');
testList.add('6 hours');
testList.add('72 hours');
testList.add('720 hours');
system.debug('before sort is '+testList); //before sort is (12 hours, 48 hours, 24 hours, 6 hours, 72 hours, 720 hours)
testList.sort();
system.debug('after sort is '+testList); // after sort is (12 hours, 24 hours, 48 hours, 6 hours, 72 hours, 720 hours
Hi All,
Please help me with my requirement

I am downloading a report data of a object through VFpage, i am getting a map<string, List<sobject>> from the controller and passing the same to vfpage to get the data, I have four columns column1, column2, column3, column4 where i have to diaplay the data, i have to display report in sorting order as column1(sort A-Z), column2(sort A-Z), column3(sort A-Z), column(A-Z).

Please help me how to achieved i tried to use order by while querying the record but it is it working only for one particular field.
BEst Regards,
Mohammad Yaseen
 
Hi All,

I have a requirement where i have created a custom button on the detail page of any record of a custom object. on click of the button a new window will be opeened with a VF page rendering as PDF. now my requirement is to download the page with out displaying the page. I mean on click of the button the VF page should be downloaded.

Please note the data is generated in the VF page based on the record id of the record which is being passed to page on click of the custom button.

BEst Regards,
Mohammad Yaseen
Hi all,

I have requirement where i have to get the id of a record and assign it to a variable in my extension on clicking a custom button i added in the detail page of object.

Please let me know how to achieve this. If sample code is available that will be great.

Best Regards,
Mohammad Yaseen
Hi All,

I have three master objects and two junction objects as below.
CSA, Analysis, system- master objects
AnalaysisCSA, AnalysisSystem - junction objects
the lnk is shown as below
CSA-->AnalysisCSA-->Analysis-->AnalysisSystem-->System
i have to retrieve CSA name, Analysis Name, SystemName, a field From System Through single query for conga composer queryid.

Please let me know how to build query for conga composer
 
Hi All,

I have three objects obj1, obj2, obj3 where obj2 is junction object for obj1 and obj2.

now my requirement is i have to retrive obj1 name from obj3 through query.

Please help me with sample query for the same. Thansk


Best Regards,
Mohammad Yaseen
 
Hi Gurus, 

I have this Javascript code that is suppose to save a form on to my custom object is Salesforce and then redirect the user to my second visualforce page, which is a "ÿou have successfully saved the form" page. 

However when I add the code to my VF page, the form doesnt save or get redirected.

Please if someone knows what is wrong with the code, please let me know.



My code for the save and redirection to second page:

<apex:actionFunction name="savefromJS" action="{!save}" />


<script>
    function saverecordandredirect(){
       savefromJS();
       window.location('/apex/ThankYouPage');
    }
</script>


<apex:commandButton value="Save it" onclick="saveandredirtect() ;"/>


 
Hi All,

Can you please help me with any sample code which will display records of account object on vfpage with pagination jquery grid(http://js-grid.com/demos/) having below options.
*sorting
*filtering
*with pagination buttons and page numbers

In the above i am having a controller will get the list of accounts(AccList) in constructor, i have to display 20 records per page. each next button of page number is clicked it should not go to controller all the processing should be done in jquery itself.

Please let me know if any possibility for the above. please refer the link for clear idea "http://js-grid.com/demos/"
Thanks in advance,
Mohammad Yaseen
 
Hi All,

on a vfpage i have a inputtext box and a insert button next to it. 

my requirement is when user types some text in the inputtextbox and presees insert button then a new row has to be added below with the text as outputtext. 

when the user again types some text in the input textbox and again pressed insert button then the previously added row should go down and the new row should be added with the text input 

Please let me know how to achieve. it will be more helpful if code can be shared for the same.

Best Regards,
Mohammad Yaseen.
Hi All,

I have a VFpage with some content on it and top i have two radio checkboxes(agree and disagree) and a button(submit).

Now my requirement is i have to disable the radio checkboxes and button when the page loads and have to enable the same when the user scrolls till end of the page(just to ensure he has read the entire content of page).


Please help me how to achieve this functionality and also please share if there any code for the same. Thanks.

BEst Regards,
Mohammad Yaseen
Hi All,

I have a custom object custObj with fields Question__c, answer__c, i am querying old records from database into a list oldRecsList

now i have a new List newRecsList i am getting from UI which doesnot have ids, now i have to compare two lists check if Question__c of old list and Question__c of new list are same if yes then have to check if answer__c are different. based on the criteria i have to insert new records which are not in database and update the records with changes in to old records, delete the old records if they are not in new list.

I have tried iterating two lists but was unable achieve may be i was unable to include some complex logics. here is the sameple code. please help me wha are all should be considered and where was i doing wrong. Thanks

for(custObj__c newRec :newRecsList )
            {
                for(custObj__c savedRec: oldRecsList)
                {
                    if(savedRec.Question__c ==newRec.Question__c && savedRec.answer__c!= newRec.answer__c)
                    {
                       savedRec.answer__c=newRec.answer__c;
                        ListtoUpdateRecs.add(savedRec);
                    }
                    else if(savedRec.question__c!=newRec.question__c)
                    {
                        ListtodeleteRecs.add(savedRec);
                    }
                    else
                    {
                        ListtoInsertRecs.add(newRec);
                    }
                }
            }
            update ListtoUpdateRecs;
            delete ListtodeleteRecs;
            insert ListtoInsertRecs;
Hi All,

I am downloading an excel report from VFpage i am having four columns header1, header2, header3, header4, i am having sample data as below. 

header1 header2 header3 header4
aaaa     aaaaaa  aaaaaaa aaaaaa
bbbb     bbbbbb  bbbbbbb bbbbbb
aaaa     aaaaaa  aaaaaaa aaaaaa
aaaa     aaaaaa  aaaaaab aaaaab
aaaa     aaaaaa  aaaaaab aaaaaa
aaaa     aaaaab  aaaaaab aaaaab

I need to sort as below. Please how can we achieve this. Please note that i am passing a map whcih holds the data. here is the format. 
map<header1,List < obj>> where obj contains header2, header3, header4. 

header1 header2 header3 header4
aaaa     aaaaaa  aaaaaaa aaaaaa
aaaa     aaaaaa  aaaaaaa aaaaaa
aaaa     aaaaaa  aaaaaab aaaaaa
aaaa     aaaaaa  aaaaaab aaaaab
aaaa     aaaaab  aaaaaab aaaaab
bbbb     bbbbbb  bbbbbbb bbbbbb

Please help me how to acheive this. Thanks
 
Hi All,

below i have a piece of code where i  need to sort the items correctly but sort is not happenning correctly. please help me how to achieve in this case. Thanks


List < string > testList = new List < string >();
testList.add('12 hours');
testList.add('48 hours');
testList.add('24 hours');
testList.add('6 hours');
testList.add('72 hours');
testList.add('720 hours');
system.debug('before sort is '+testList); //before sort is (12 hours, 48 hours, 24 hours, 6 hours, 72 hours, 720 hours)
testList.sort();
system.debug('after sort is '+testList); // after sort is (12 hours, 24 hours, 48 hours, 6 hours, 72 hours, 720 hours
Hi All,

I have three master objects and two junction objects as below.
CSA, Analysis, system- master objects
AnalaysisCSA, AnalysisSystem - junction objects
the lnk is shown as below
CSA-->AnalysisCSA-->Analysis-->AnalysisSystem-->System
i have to retrieve CSA name, Analysis Name, SystemName, a field From System Through single query for conga composer queryid.

Please let me know how to build query for conga composer
 
Hi All,

I have three objects obj1, obj2, obj3 where obj2 is junction object for obj1 and obj2.

now my requirement is i have to retrive obj1 name from obj3 through query.

Please help me with sample query for the same. Thansk


Best Regards,
Mohammad Yaseen
 
Hi All,

I have requirement where i have to update a field in an object using flow. please help me with procedure for the same. below is the exact requirement

in my org i have a object obj with fields FF(formula field), textField i have to update the value of the FF into textField using flow. can you please help me with step by step procedure for the same. Thanks

Best Regrads,
Mohammad Yaseen.
Hi All,

In my org I have three object obj1, obj2, obj3 and obj2 is junction object between obj1 and obj3. My requirement is i want a rollup summary field on obj1 which will calculate the minimim value of related obj3 field. 

Please help me how shalll i proceed in this case. Thanks

BEst Regards,
Mohammad Yaseen
Hi All,

In My org already recordtypes have been assigned with pagelayouts. 

Is there anyway that i can view which pagelayout is assigned to a particular recordtype.

Best Regards,
Mohammad Yaseen
Hi All,

I am new to salesforce development. Need all your help here.

I have a  scenario to write a trigger where while creating List of records in Account object it should check if there are any duplicates with reference to account name.
If exist then it should skip those records and insert the remaing records. 
so my requirement is no need to displayt any error. just have to skip the unfavourable records from trigger.new and save the favourable records in trigger.new alone. 

Please assist me here