• Gaurav Agnihotri 11
  • NEWBIE
  • 30 Points
  • Member since 2018

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 7
    Questions
  • 4
    Replies
I want to display a message when a button is invoked in VF page. 
 
I declared it as a public string:

public string broadcastMessage { get; set; }

I am updating the value in a button calling a class search()
if (oppSplits.size() > 0)
		{

			//oppSplitSize = true;
			if (oppSplits.size() <= 400)
			{
				OpportunityEdit newOppEdit = new OpportunityEdit();
				newOppEdits = newOppEdit.createOppEditList(oppSplits);
				newOppEditsSearch = newOppEdit.createOppEditList(oppSplits);

			}
			else
			{
				
				broadcastMessage = 'The record size is more than 400. Refine the Query to reduce the size';
				System.debug('broadcastmessage='+broadcastMessage);
			}
		}

the value is not updating in the VF page.

Not sure what I am doing wrong!


 
I am displaying a selection of options on the VF page :
<apex:column headervalue="VP Best/Likely/Worse">
                    <apex:outputpanel id="VP1" rendered="{!VP_View}">
                        <apex:outputtext value="{!oe.VP_best_Likely_Worst}"/>
                        <apex:selectlist id="Best2" value="{!oe.VP_best_Likely_Worst}" size="1" required="true">
                            <apex:selectoptions value="{!SelectBestLikelyWorse}" />
                        </apex:selectlist>
                    </apex:outputpanel>
                </apex:column>

Here is the controller:
public List<SelectOption> getSelectBestLikelyWorse()
	{
		List<SelectOption> options = new List<SelectOption> ();

		Schema.DescribeFieldResult fieldResult = Opportunity.Best_Likely_Worst__c.getDescribe();
		List<Schema.PicklistEntry> ple = fieldResult.getPicklistValues();
		options.add(new SelectOption('---Select---', '---Select---'));

		for (Schema.PicklistEntry f : ple)
		{
			options.add(new SelectOption(f.getLabel(), f.getValue()));
		}
		return options;
	}

However, I am unable to display the value on the field. 
I am unable to update the value of the custom lookup field on a VF page. 
the desired feature is to add the opportunity to the Service Request custom object by clicking "Associate Opportunity" Button
public class ServiceDeskCreateOpp
{

	public string oppRecordType { get; set; }
	public string oppName { get; set; }
	public date OppCloseDate { get; set; }
	public Id serviceDeskId;
	public Id OppAccountId;
	public List<account> SDAccount;
	public Id existingOpp;
	//private final ServiceDesk__c serviceDesk;
	public ServiceDeskCreateOpp(ApexPages.StandardController stdController)
	{
		//this.serviceDesk = (ServiceDesk__c) stdController.getRecord();


		serviceDeskId = apexpages.currentpage().getparameters().get('id');
		System.debug('serviceDeskId=' + serviceDeskId);
		List<ServiceDesk__c> newServiceDesk = [select Client_Company_Name_Organization__c, Opportunity__c from ServiceDesk__c where Id = :serviceDeskId];
		if (newServiceDesk.size() > 0)
		{
			OppAccountId = newServiceDesk[0].Client_Company_Name_Organization__c;
			existingOpp = newServiceDesk[0].Opportunity__c;
		}
		SDAccount = [select id, name from Account where id = :OppAccountId];
		if (SDAccount.size() > 0)
		{
			oppName = SDAccount[0].Name;
		}

		System.debug('OppAccountId=' + OppAccountId);
		System.debug('newServiceDesk=' + newServiceDesk);
		System.debug('oppName=' + oppName);

	}

	public PageReference OppAssociate()
	{
	 System.debug('test');
	 serviceDeskId = apexpages.currentpage().getparameters().get('id');
	 List<ServiceDesk__c> newServiceDesk = [select Client_Company_Name_Organization__c, Opportunity__c from ServiceDesk__c where Id = :serviceDeskId];
	 Id newPageOppId = newServiceDesk[0].Opportunity__c ;
     System.debug (newServiceDesk);
	 
	 if (newServiceDesk.size() > 0)
		{
			OppAccountId = newServiceDesk[0].Client_Company_Name_Organization__c;
			existingOpp = newServiceDesk[0].Opportunity__c;
		    System.debug('existingOpp ='+existingOpp );
		}
		if (existingOpp != null)
		{
			
			newpageOppId = existingOpp;
			
			opportunity newOppySD = new Opportunity();
			
			newOppySD.Id=newPageOppId;
			newOppySD.Service_Desk_Requests__c = serviceDeskId;

			update newOppySD;
		}
		
		ServiceDesk__c newServiceDesk1 = new ServiceDesk__c();
		System.debug('serviceDeskId=' + serviceDeskId + ' op.Id=' + newPageOppId);

		newServiceDesk1.Id = serviceDeskId;
		newServiceDesk1.Opportunity__c = newPageOppId;
		update newServiceDesk1;

				System.debug(System.Label.Opportunity_URL);
		PageReference pageRef = new PageReference(System.Label.Opportunity_URL + '?id=' + newPageOppId+'&sfdc.override=1');

		System.debug(pageRef);
		 return pageRef;
		 
	}

	Public PageReference OppCreate()
	{
		System.debug('in function');
		Opportunity op = new opportunity();
		Id newPageOppId = existingOpp;
		System.debug ('In the function'+newPageOppId);

		if (oppName != null && OppCloseDate != null && OppCloseDate != null)
		{


			//user ServiceDeskOwner = [select id from user where FirstName = 	'Jessica' and LastName ='	Jessica'];
			op.Name = oppName;
			System.debug(oppName);
			op.z_Date_Last_non_USD_Hist_Rate_Check__c = System.today();
			op.StageName = 'Suspect';
			op.CloseDate = OppCloseDate;
			System.debug(OppCloseDate);
			System.debug(SDAccount[0].Id);
			op.AccountId = SDAccount[0].Id;
			op.recordTypeId = [SELECT Id, Name, SobjectType FROM RecordType WHERE SobjectType = 'Opportunity' AND Name = :oppRecordType].Id;
			op.Service_Desk_Requests__c = serviceDeskId;
			op.OwnerId = UserInfo.getUserId();

			insert op;
			newPageOppId = op.Id;
		}
		else
		{
		 ApexPages.addmessage(new ApexPages.message(ApexPages.severity.WARNING,'Please enter value'));
		}
		ServiceDesk__c newServiceDesk = new ServiceDesk__c();
		System.debug('serviceDeskId=' + serviceDeskId + ' op.Id=' + newPageOppId);

		newServiceDesk.Id = serviceDeskId;
		newServiceDesk.Opportunity__c = newPageOppId;
		update newServiceDesk;


		//update newServiceDesk;

		System.debug(System.Label.Opportunity_URL);
		PageReference pageRef = new PageReference(System.Label.Opportunity_URL + '?id=' + newPageOppId+'&sfdc.override=1');

		System.debug(pageRef);
		 return pageRef;
	}

	public List<SelectOption> getSelectOpptyRecordType()
	{
		List<SelectOption> options = new List<SelectOption> ();


		options.add(new SelectOption('', ''));
		options.add(new SelectOption('Default', 'Default'));
		options.add(new SelectOption('Partner Services', 'Partner Services'));
		options.add(new SelectOption('SMB', 'SMB'));
		options.add(new SelectOption('SMB Client Renewal', 'SMB Client Renewal'));
		options.add(new SelectOption('Sub-Contracted Services', 'Sub-Contracted Services'));
		options.add(new SelectOption('Technical Project', 'Technical Project'));

		return options;
	}
	public ServiceDesk__c getOpportunity()
	{
		return[select Opportunity__r.name from ServiceDesk__c limit 1];
	}
}
and here's VF page:
<apex:page standardcontroller="ServiceDesk__c" extensions="ServiceDeskCreateOpp" doctype="html-5.0">
    <apex:form>

        <apex:pageblock id="AssociateOpty">
            <apex:pageMessages ></apex:pageMessages>
            <br /><br />
             <br /><br />
                <apex:commandbutton value="Associate Opportunity" action="{!OppAssociate}"> </apex:commandbutton>

           Choose an existing Opportunity Name :&nbsp;&nbsp; <apex:inputField value="{!ServiceDesk__c.Opportunity__c}"/>
            <br /><br />
            </apex:pageblock>
         <br /><br />
            <b>OR</b>
            <br /><br />
            <apex:pageblock id ="CreateOpty">
                <apex:pageMessages ></apex:pageMessages>
                <br /><br />
                <apex:commandbutton value="Create Opportunity" action="{!OppCreate}"> </apex:commandbutton>
                <br /><br />
            Create a new Opportunity:&nbsp;&nbsp; <apex:input value="{!oppName}" />
            <br /><br />
            Closed Date :&nbsp;&nbsp; <apex:input value="{!OppCloseDate}" type="date" />
            <br /><br />
            <apex:selectlist id="Best2" value="{!oppRecordType}" size="1" required="true">
            Opportunity Type:<apex:selectoptions value="{!SelectOpptyRecordType}" />
            </apex:selectlist>
            <br /><br />
            <br /><br />
            <br /><br />
            <br /><br />
            <br /><br />
            <br /><br />

            <table style="width:100%" border="1">
                <tr>
                    <th>Record Type Name</th>
                    <th>Description</th>
                </tr>
                <tr>
                    <td>Client Renewal</td>
                    <td>Use for all Client Renewal Opportunities including Baseline, Upsell, Cross-sell, or Uptick</td>

                </tr>
                <tr>
                    <td>Default</td>
                    <td>Use for Enterprise, Business Edition, CFS, and sales to Existing Clients. Do NOT use this for PiiQ.</td>
                </tr>

                <tr>
                    <td>Partner Services</td>
                    <td>
                        Use for partners bidding and winning services into CSOD without revenue.
                    </td>
                </tr>
                <tr>
                    <td>SMB</td>
                    <td>Use for SMB Opportunities only (SMB team-owned)</td>
                </tr>
                <tr>
                    <td>
                        SMB Client Renewal
                    </td>
                    <td>Renewal to be used by PiiQ and CFS sales teams</td>
                </tr>
                <tr>
                    <td>Sub-Contracted Services</td>
                    <td>Use for Partners Services sub-contracted back to CSOD</td>

                </tr>
                <tr>
                    <td>Technical Project</td>
                    <td>Used for Technical Projects and additional services</td>
                </tr>




            </table>
        </apex:pageblock>
    </apex:form>
</apex:page>

Any suggestions?
Hey Gurus, 
I am trying to create a test class for a non-static method in a class. The class is as follows:
public class ServiceDeskCreateOpp
{

	public string oppRecordType { get; set; }
	public string oppName { get; set; }
	public date OppCloseDate { get; set; }
	public Id serviceDeskId;
	public Id OppAccountId;
	public List<account> SDAccount;
	//private final ServiceDesk__c serviceDesk;
	public ServiceDeskCreateOpp(ApexPages.StandardController stdController)
	{
		//this.serviceDesk = (ServiceDesk__c) stdController.getRecord();
		id serviceDeskId = apexpages.currentpage().getparameters().get('id');
		System.debug('serviceDeskId='+serviceDeskId);
		List<ServiceDesk__c> newServiceDesk = [select Client_Company_Name_Organization__c from ServiceDesk__c where Id = :serviceDeskId];
		if (newServiceDesk.size() > 0)
		{
			 OppAccountId = newServiceDesk[0].Client_Company_Name_Organization__c;
		}
		SDAccount = [select id, name from Account where id = :OppAccountId];
		if (SDAccount.size()>0 )
		{
			oppName = SDAccount[0].Name;
		}
		System.debug('OppAccountId='+OppAccountId);
		System.debug('newServiceDesk='+newServiceDesk);
		System.debug('oppName='+oppName);
	}

	Public PageReference OppCreate()
	{

		Opportunity op = new opportunity();


		op.Name = oppName;
		System.debug(oppName);
		op.z_Date_Last_non_USD_Hist_Rate_Check__c = System.today();
		op.StageName = 'Suspect';
		op.CloseDate = OppCloseDate;
		System.debug(OppCloseDate);
		System.debug(SDAccount[0].Id);
		op.AccountId = SDAccount[0].Id;
		op.recordTypeId = [SELECT Id, Name, SobjectType FROM RecordType WHERE SobjectType = 'Opportunity' AND Name = :oppRecordType].Id;
		op.Service_Desk_Requests__c = serviceDeskId;
		insert op;

		System.debug(System.Label.Opportunity_URL);
		PageReference pageRef = new PageReference(System.Label.Opportunity_URL + '?id=' + Op.id + '&sfdc.override=1');

		System.debug(pageRef);

		return pageRef;
	}

	public List<SelectOption> getSelectOpptyRecordType()
	{
		List<SelectOption> options = new List<SelectOption> ();

		options.add(new SelectOption('Client Renewal', 'Client Renewal'));
		options.add(new SelectOption('Default', 'Default'));
		options.add(new SelectOption('Partner Services', 'Partner Services'));
		options.add(new SelectOption('SMB', 'SMB'));
		options.add(new SelectOption('SMB Client Renewal', 'SMB Client Renewal'));
		options.add(new SelectOption('Sub-Contracted Services', 'Sub-Contracted Services'));
		options.add(new SelectOption('Technical Project', 'Technical Project'));

		return options;
	}
}

 and test class:
@isTest
private class ServiceDeskCreateOpp_Test  
{

@TestSetup
	static void setup()
	{

        Account testAccount = TestDataFactory_Account.Execute();
		insert testAccount;

		ServiceDesk__c testServiceDesk = TestDataFactory_ServiceDesk.Execute();
		testServiceDesk.Client_Company_Name_Organization__c= testAccount.id;
		insert testServiceDesk;
		
		Opportunity testOpporutnity = TestDataFactory_Opportunity.Execute();
		testOpporutnity.AccountId =testAccount.Id;
		insert testOpporutnity;

		system.debug('testing class:Account' + testAccount);
		system.debug('testing class:Service Desk' + testServiceDesk);
		system.debug('testing class:Opportunity' + testOpporutnity);

	}

	static testMethod void testServiceDeskCreateOppy()
	{
	  Account newAcc = [Select Id, Name from Account];
	  ServiceDesk__c newSD = [select id from ServiceDesk__c];
	  Opportunity newOpp = [select id,Name from Opportunity];

	  	PageReference pageRef = Page.ServiceDeskCreateOpp;
		Test.setCurrentPage(pageRef);
		ApexPages.currentPage().getParameters().put('id', newSD.id);

		ServiceDeskCreateOpp newSDOppty = new ServiceDeskCreateOpp();

        newSDOppty.OppCreate();

	  //ServiceDeskCreateOpp newOppty = new ServiceDeskCreateOpp();
	  //newOppty.OppCreate();
	  //OppCreate.OppCreate(newSD.id);
//	  ServiceDeskCreateOpp


	}
}

I am getting an error message that  "Error    1    Constructor not defined: [ServiceDeskCreateOpp].<Constructor>()    C:\Users\gagnihotri\Documents\The Welkin Suite\Projects\FullSand-New\FullSand-New\src\classes\ServiceDeskCreateOpp_Test.cls    36    1  "

Not sure what am I doing wrong
  
 
trying to create a SOQL on the Master - Detail

Master: Opportunity
Detail: Opportunity_Split_Reporting_Lens__r
field : Opportunity_Name ( Id of opportunity)

I am able to go from child to parent 
select Opportunity_Account_Name__c from  Opportunity_Split_Reporting_Lens__c

How can i get child record from parent?
select name, (select name from Opportunity_Split_Reporting_Lens__r)  from Opportunity limit 5
Error message:
ERROR at Row:1:Column:32
Didn't understand relationship 'Opportunity_Split_Reporting_Lens__r' 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.
I want to display result from Opportunity class and custom class Opportunity_Split_Reporting_Lens__c  which is the child of Opportunity class.
For that I created a class OpporutnityEdit as a place holder:
public class OpporutnityEdit
 {
	public string oppName;
	public id oppId;
	public string accountName;
	public date closeDate;
	public string stage;
	public string forecast;
	public string totalARR_USD;
	public string oppSplitUser;
	public string totalSaleQuota_USD;
	public string commissionSplitPercentage;
	public string nextSeps;
	public string sub_SubTeamofSplit;
	public string best_Likely_Worst;
	public string rSDComments;
	public string aVP_VPComments;

	public list<OpporutnityEdit> createOppEditList( List<Opportunity_Split_Reporting_Lens__c> oppSplits)
	{
     list<OpporutnityEdit> newOppEdits = new list<OpporutnityEdit>();
		for (Opportunity_Split_Reporting_Lens__c newOppSplit: oppSplits)
			{
				OpporutnityEdit newOppEdit  = new OpporutnityEdit() ;
				newOppEdit.oppId =	newOppSplit.Opportunity_Name__r.Id ;
				newOppEdit.oppName = newOppSplit.Opportunity_Name__r.name;
				newOppEdit.accountName = newOppSplit.Opportunity_Account_Name__c;
				newOppEdit.closeDate = newOppSplit.Opportunity_Name__r.CloseDate;
				newOppEdit.stage = newOppSplit.Opportunity_Name__r.StageName;
				newOppEdit.forecast = newOppSplit.Opportunity_Name__r.Forecast__c;
				//newOppEdit.totalARR_USD = newOppSplit.Opportunity_Name__r.Total_ARR_USD__c;
				newOppEdit.oppSplitUser = newOppSplit.Split_User_Sub_Sub_Team_Picklist__c;
				//newOppEdit.totalSaleQuota_USD = newOppSplit.Total_Sale_USD__c;
				//newOppEdit.commissionSplitPercentage = newOppSplit.Commission_Split__c;
				newOppEdit.nextSeps = newOppSplit.Opportunity_Name__r.Next_Steps_Next_Steps_2__c;
				newOppEdit.sub_SubTeamofSplit = newOppSplit.Split_User_Sub_Sub_Team_Picklist__c;
				newOppEdit.best_Likely_Worst = newOppSplit.Opportunity_Name__r.Best_Likely_Worst__c;
				newOppEdit.rSDComments = newOppSplit.Opportunity_Name__r.RSD_Comments__c;
				newOppEdit.aVP_VPComments = newOppSplit.Opportunity_Name__r.AVP_VP_Comments__c;
				System.debug(newOppEdit) ;
				newOppEdits.add(newOppEdit);
			}
			System.debug('oppEdit in function');
			System.debug(newOppEdits) ;
			return(newOppEdits);
	} 

 }
In the controller class, I can call this class and populate the value based on some opportunity criteria:
public class OpportunityEditController
{
	public string searchString;
	public Date startDate { get; set; }
	public Date endDate { get; set; }
	public string subSubTeamOfSplit { get; set; }
	public List<Opportunity_Split_Reporting_Lens__c> oppSplits { get; set; }
	public List<OpporutnityEdit>newOppEdits { get; set; }
	public void search()
	{
		searchString = 'select  id, name,Opportunity_Name__r.Id,Opportunity_Name__r.name, Opportunity_Account_Name__c,Opportunity_Name__r.CloseDate, Opportunity_Name__r.StageName,Opportunity_Name__r.Forecast__c,Opportunity_Name__r.Total_ARR_USD__c, Split_User_Sub_Sub_Team_Picklist__c,Opp_Split_User__c,Total_Sale_USD__c,Commission_Split__c, Opportunity_Name__c,Opportunity_Name__r.Next_Steps_Next_Steps_2__c,Opportunity_Name__r.Best_Likely_Worst__c,Opportunity_Name__r.RSD_Comments__c,Opportunity_Name__r.AVP_VP_Comments__c from Opportunity_Split_Reporting_Lens__c where Opportunity_Name__r.Id != null';
		
		System.debug (startDate);
		System.debug (endDate);
		System.debug (subSubTeamOfSplit);
		System.debug (subSubTeamOfSplit.length());	

		//searchString = 'select name,Opportunity_Name__r.Id,Opportunity_Name__r.name, Opportunity_Account_Name__c,Opportunity_Name__r.CloseDate, Opportunity_Name__r.StageName,Opportunity_Name__r.Forecast__c,Opportunity_Name__r.Total_ARR_USD__c, Split_User_Sub_Sub_Team_Picklist__c,Opp_Split_User__c,Total_Sale_USD__c,Commission_Split__c, Opportunity_Name__c,Opportunity_Name__r.Next_Steps_Next_Steps_2__c from Opportunity_Split_Reporting_Lens__c where Opportunity_Name__r.Id != null';
		if (startDate != null)
		{
			searchString += ' AND (Opportunity_Name__r.CloseDate >: startDate)';
		}

		if (endDate != null)
		{
			searchString += ' AND (Opportunity_Name__r.CloseDate <: endDate)';
		}
		if (subSubTeamOfSplit != null && subSubTeamOfSplit.length()>0)
		{
			searchString += ' AND (Split_User_Sub_Sub_Team_Picklist__c =: subSubTeamOfSplit)';
		}

		searchString += ' Limit 1';
		
		System.debug(searchString);
		 
		oppSplits = Database.query(searchString);

		OpporutnityEdit newOppEdit = new OpporutnityEdit();
		newOppEdits  = newOppEdit.createOppEditList(oppSplits);

		System.debug(newOppEdits);
		System.debug(newOppEdits[0]);
		System.debug(newOppEdits[0].oppName);
		//System.debug(oppSplits);

	}
	public void save()
	{

	    System.debug(LoggingLevel.INFO,'Test');
		System.debug(LoggingLevel.INFO,oppSplits);
	    update(oppSplits);




	}


}

However, when I call the list of opporuntyEdit Values, I get an error message.
VF page
<apex:pageBlockTable value ="{!newOppEdits}" var="oe">
                  
                    <apex:column value ="{!oe.oppName}"></apex:column>
                       

                </apex:pageBlockTable>
Error message:
Error    4    Unknown property 'OpporutnityEdit.oppName'    

not sure why the property is unknown. it is defined in the class:
public class OpporutnityEdit
 {
    public string oppName;
    public id oppId;

Any suggestions?


 
I am trying to anonymize leads. I am updating the salesforce fields and then deleting the history of the field (.
public static String LeadGDPRAnonymizeFieldUpdate(Lead LeadTobeUpdated)
	{

		LeadTobeUpdated.FirstName = '**********';
		LeadTobeUpdated.LastName = '**********';
		LeadTobeUpdated.FirstNameLocal = '**********';
		LeadTobeUpdated.LastNameLocal = '**********';
		LeadTobeUpdated.MobilePhone = '**********';
		Return 'Success';
	}

and
public static String LeadGDPRDeleteFieldHistory(List<Id> sLeadID)
	{
		List<LeadHistory> leadHistory = new List<sObject> ();
		leadHistory.addAll([SELECT Id FROM LeadHistory WHERE LeadId IN :sLeadID]);
		Database.delete(leadHistory);

		return 'Success';

	}
When I call these functions in the main fuction:
        GDPRLeadUpdate(leadId);
        GDPRLeadDeleteHistoryOption(leadId);
THere are still values in lead field history.

Any thoughts!
Hey Gurus, 
I am trying to create a test class for a non-static method in a class. The class is as follows:
public class ServiceDeskCreateOpp
{

	public string oppRecordType { get; set; }
	public string oppName { get; set; }
	public date OppCloseDate { get; set; }
	public Id serviceDeskId;
	public Id OppAccountId;
	public List<account> SDAccount;
	//private final ServiceDesk__c serviceDesk;
	public ServiceDeskCreateOpp(ApexPages.StandardController stdController)
	{
		//this.serviceDesk = (ServiceDesk__c) stdController.getRecord();
		id serviceDeskId = apexpages.currentpage().getparameters().get('id');
		System.debug('serviceDeskId='+serviceDeskId);
		List<ServiceDesk__c> newServiceDesk = [select Client_Company_Name_Organization__c from ServiceDesk__c where Id = :serviceDeskId];
		if (newServiceDesk.size() > 0)
		{
			 OppAccountId = newServiceDesk[0].Client_Company_Name_Organization__c;
		}
		SDAccount = [select id, name from Account where id = :OppAccountId];
		if (SDAccount.size()>0 )
		{
			oppName = SDAccount[0].Name;
		}
		System.debug('OppAccountId='+OppAccountId);
		System.debug('newServiceDesk='+newServiceDesk);
		System.debug('oppName='+oppName);
	}

	Public PageReference OppCreate()
	{

		Opportunity op = new opportunity();


		op.Name = oppName;
		System.debug(oppName);
		op.z_Date_Last_non_USD_Hist_Rate_Check__c = System.today();
		op.StageName = 'Suspect';
		op.CloseDate = OppCloseDate;
		System.debug(OppCloseDate);
		System.debug(SDAccount[0].Id);
		op.AccountId = SDAccount[0].Id;
		op.recordTypeId = [SELECT Id, Name, SobjectType FROM RecordType WHERE SobjectType = 'Opportunity' AND Name = :oppRecordType].Id;
		op.Service_Desk_Requests__c = serviceDeskId;
		insert op;

		System.debug(System.Label.Opportunity_URL);
		PageReference pageRef = new PageReference(System.Label.Opportunity_URL + '?id=' + Op.id + '&sfdc.override=1');

		System.debug(pageRef);

		return pageRef;
	}

	public List<SelectOption> getSelectOpptyRecordType()
	{
		List<SelectOption> options = new List<SelectOption> ();

		options.add(new SelectOption('Client Renewal', 'Client Renewal'));
		options.add(new SelectOption('Default', 'Default'));
		options.add(new SelectOption('Partner Services', 'Partner Services'));
		options.add(new SelectOption('SMB', 'SMB'));
		options.add(new SelectOption('SMB Client Renewal', 'SMB Client Renewal'));
		options.add(new SelectOption('Sub-Contracted Services', 'Sub-Contracted Services'));
		options.add(new SelectOption('Technical Project', 'Technical Project'));

		return options;
	}
}

 and test class:
@isTest
private class ServiceDeskCreateOpp_Test  
{

@TestSetup
	static void setup()
	{

        Account testAccount = TestDataFactory_Account.Execute();
		insert testAccount;

		ServiceDesk__c testServiceDesk = TestDataFactory_ServiceDesk.Execute();
		testServiceDesk.Client_Company_Name_Organization__c= testAccount.id;
		insert testServiceDesk;
		
		Opportunity testOpporutnity = TestDataFactory_Opportunity.Execute();
		testOpporutnity.AccountId =testAccount.Id;
		insert testOpporutnity;

		system.debug('testing class:Account' + testAccount);
		system.debug('testing class:Service Desk' + testServiceDesk);
		system.debug('testing class:Opportunity' + testOpporutnity);

	}

	static testMethod void testServiceDeskCreateOppy()
	{
	  Account newAcc = [Select Id, Name from Account];
	  ServiceDesk__c newSD = [select id from ServiceDesk__c];
	  Opportunity newOpp = [select id,Name from Opportunity];

	  	PageReference pageRef = Page.ServiceDeskCreateOpp;
		Test.setCurrentPage(pageRef);
		ApexPages.currentPage().getParameters().put('id', newSD.id);

		ServiceDeskCreateOpp newSDOppty = new ServiceDeskCreateOpp();

        newSDOppty.OppCreate();

	  //ServiceDeskCreateOpp newOppty = new ServiceDeskCreateOpp();
	  //newOppty.OppCreate();
	  //OppCreate.OppCreate(newSD.id);
//	  ServiceDeskCreateOpp


	}
}

I am getting an error message that  "Error    1    Constructor not defined: [ServiceDeskCreateOpp].<Constructor>()    C:\Users\gagnihotri\Documents\The Welkin Suite\Projects\FullSand-New\FullSand-New\src\classes\ServiceDeskCreateOpp_Test.cls    36    1  "

Not sure what am I doing wrong
  
 
trying to create a SOQL on the Master - Detail

Master: Opportunity
Detail: Opportunity_Split_Reporting_Lens__r
field : Opportunity_Name ( Id of opportunity)

I am able to go from child to parent 
select Opportunity_Account_Name__c from  Opportunity_Split_Reporting_Lens__c

How can i get child record from parent?
select name, (select name from Opportunity_Split_Reporting_Lens__r)  from Opportunity limit 5
Error message:
ERROR at Row:1:Column:32
Didn't understand relationship 'Opportunity_Split_Reporting_Lens__r' 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.
I want to display result from Opportunity class and custom class Opportunity_Split_Reporting_Lens__c  which is the child of Opportunity class.
For that I created a class OpporutnityEdit as a place holder:
public class OpporutnityEdit
 {
	public string oppName;
	public id oppId;
	public string accountName;
	public date closeDate;
	public string stage;
	public string forecast;
	public string totalARR_USD;
	public string oppSplitUser;
	public string totalSaleQuota_USD;
	public string commissionSplitPercentage;
	public string nextSeps;
	public string sub_SubTeamofSplit;
	public string best_Likely_Worst;
	public string rSDComments;
	public string aVP_VPComments;

	public list<OpporutnityEdit> createOppEditList( List<Opportunity_Split_Reporting_Lens__c> oppSplits)
	{
     list<OpporutnityEdit> newOppEdits = new list<OpporutnityEdit>();
		for (Opportunity_Split_Reporting_Lens__c newOppSplit: oppSplits)
			{
				OpporutnityEdit newOppEdit  = new OpporutnityEdit() ;
				newOppEdit.oppId =	newOppSplit.Opportunity_Name__r.Id ;
				newOppEdit.oppName = newOppSplit.Opportunity_Name__r.name;
				newOppEdit.accountName = newOppSplit.Opportunity_Account_Name__c;
				newOppEdit.closeDate = newOppSplit.Opportunity_Name__r.CloseDate;
				newOppEdit.stage = newOppSplit.Opportunity_Name__r.StageName;
				newOppEdit.forecast = newOppSplit.Opportunity_Name__r.Forecast__c;
				//newOppEdit.totalARR_USD = newOppSplit.Opportunity_Name__r.Total_ARR_USD__c;
				newOppEdit.oppSplitUser = newOppSplit.Split_User_Sub_Sub_Team_Picklist__c;
				//newOppEdit.totalSaleQuota_USD = newOppSplit.Total_Sale_USD__c;
				//newOppEdit.commissionSplitPercentage = newOppSplit.Commission_Split__c;
				newOppEdit.nextSeps = newOppSplit.Opportunity_Name__r.Next_Steps_Next_Steps_2__c;
				newOppEdit.sub_SubTeamofSplit = newOppSplit.Split_User_Sub_Sub_Team_Picklist__c;
				newOppEdit.best_Likely_Worst = newOppSplit.Opportunity_Name__r.Best_Likely_Worst__c;
				newOppEdit.rSDComments = newOppSplit.Opportunity_Name__r.RSD_Comments__c;
				newOppEdit.aVP_VPComments = newOppSplit.Opportunity_Name__r.AVP_VP_Comments__c;
				System.debug(newOppEdit) ;
				newOppEdits.add(newOppEdit);
			}
			System.debug('oppEdit in function');
			System.debug(newOppEdits) ;
			return(newOppEdits);
	} 

 }
In the controller class, I can call this class and populate the value based on some opportunity criteria:
public class OpportunityEditController
{
	public string searchString;
	public Date startDate { get; set; }
	public Date endDate { get; set; }
	public string subSubTeamOfSplit { get; set; }
	public List<Opportunity_Split_Reporting_Lens__c> oppSplits { get; set; }
	public List<OpporutnityEdit>newOppEdits { get; set; }
	public void search()
	{
		searchString = 'select  id, name,Opportunity_Name__r.Id,Opportunity_Name__r.name, Opportunity_Account_Name__c,Opportunity_Name__r.CloseDate, Opportunity_Name__r.StageName,Opportunity_Name__r.Forecast__c,Opportunity_Name__r.Total_ARR_USD__c, Split_User_Sub_Sub_Team_Picklist__c,Opp_Split_User__c,Total_Sale_USD__c,Commission_Split__c, Opportunity_Name__c,Opportunity_Name__r.Next_Steps_Next_Steps_2__c,Opportunity_Name__r.Best_Likely_Worst__c,Opportunity_Name__r.RSD_Comments__c,Opportunity_Name__r.AVP_VP_Comments__c from Opportunity_Split_Reporting_Lens__c where Opportunity_Name__r.Id != null';
		
		System.debug (startDate);
		System.debug (endDate);
		System.debug (subSubTeamOfSplit);
		System.debug (subSubTeamOfSplit.length());	

		//searchString = 'select name,Opportunity_Name__r.Id,Opportunity_Name__r.name, Opportunity_Account_Name__c,Opportunity_Name__r.CloseDate, Opportunity_Name__r.StageName,Opportunity_Name__r.Forecast__c,Opportunity_Name__r.Total_ARR_USD__c, Split_User_Sub_Sub_Team_Picklist__c,Opp_Split_User__c,Total_Sale_USD__c,Commission_Split__c, Opportunity_Name__c,Opportunity_Name__r.Next_Steps_Next_Steps_2__c from Opportunity_Split_Reporting_Lens__c where Opportunity_Name__r.Id != null';
		if (startDate != null)
		{
			searchString += ' AND (Opportunity_Name__r.CloseDate >: startDate)';
		}

		if (endDate != null)
		{
			searchString += ' AND (Opportunity_Name__r.CloseDate <: endDate)';
		}
		if (subSubTeamOfSplit != null && subSubTeamOfSplit.length()>0)
		{
			searchString += ' AND (Split_User_Sub_Sub_Team_Picklist__c =: subSubTeamOfSplit)';
		}

		searchString += ' Limit 1';
		
		System.debug(searchString);
		 
		oppSplits = Database.query(searchString);

		OpporutnityEdit newOppEdit = new OpporutnityEdit();
		newOppEdits  = newOppEdit.createOppEditList(oppSplits);

		System.debug(newOppEdits);
		System.debug(newOppEdits[0]);
		System.debug(newOppEdits[0].oppName);
		//System.debug(oppSplits);

	}
	public void save()
	{

	    System.debug(LoggingLevel.INFO,'Test');
		System.debug(LoggingLevel.INFO,oppSplits);
	    update(oppSplits);




	}


}

However, when I call the list of opporuntyEdit Values, I get an error message.
VF page
<apex:pageBlockTable value ="{!newOppEdits}" var="oe">
                  
                    <apex:column value ="{!oe.oppName}"></apex:column>
                       

                </apex:pageBlockTable>
Error message:
Error    4    Unknown property 'OpporutnityEdit.oppName'    

not sure why the property is unknown. it is defined in the class:
public class OpporutnityEdit
 {
    public string oppName;
    public id oppId;

Any suggestions?