pse.RateCardMatcherItemglobal abstract with sharing class RateCardMatcherItem implements RateCardMatcher.MatcherItem A pse.RateCardMatcherItem is used by the pse.RateCardMatchingService to match rate cards to records. Methods
getRecordglobal SObject getRecord() Get the record that the pse.RateCardMatcherItem represents. Return ValueReturns the sobject that the RateCardMatcherItem represents. Sample Code//Note: This sample code is for demonstration purposes only. It is not intended for //use in a production environment, is not guaranteed against defects or errors, and //is in no way optimized or streamlined. pse__Resource_Request__c aResourceRequest = [SELECT Id, Name FROM pse__Resource_Request__c LIMIT 1]; //set the record RateCardMatcherItem matcherItem = new RateCardMatcherItem(); matcherItem.setRecord(aResourceRequest); //get the record pse__Resource_Request__c result = (pse__Resource_Request__c)matcherItem.getRecord(); System.assertEquals(aResourceRequest, result); getRecordIdglobal Id getRecordId() Get the Id of the record that the pse.RateCardMatcherItem represents. Return ValueReturns the Id of the record that the RateCardMatcherItem represents. Sample Code//Note: This sample code is for demonstration purposes only. It is not intended for //use in a production environment, is not guaranteed against defects or errors, and //is in no way optimized or streamlined. pse__Resource_Request__c aResourceRequest = [SELECT Id, Name FROM pse__Resource_Request__c LIMIT 1]; //set the record pse.RateCardMatcherItem matcherItem = new pse.RateCardMatcherItem(); matcherItem.setRecord(aResourceRequest); //get the record Id Id result = matcherItem.getRecordID(); System.assertEquals(aResourceRequest.Id, result); setRecordglobal void setRecord(SObject record) Sets the record that the pse.RateCardMatcherItem represents. Input Parameters
Sample Code//Note: This sample code is for demonstration purposes only. It is not intended for //use in a production environment, is not guaranteed against defects or errors, and //is in no way optimized or streamlined. pse__Resource_Request__c aResourceRequest = [SELECT Id, Name FROM pse__Resource_Request__c LIMIT 1]; //set the record RateCardMatcherItem matcherItem = new RateCardMatcherItem(); matcherItem.setRecord(aResourceRequest); //get the record pse__Resource_Request__c result = (pse__Resource_Request__c)matcherItem.getRecord(); System.assertEquals(aResourceRequest, result); getAccountIdglobal Id getAccountId() Get the Id of the Account that the pse.RateCardMatcherItem represents. Return ValueReturns the Id of the Account that the RateCardMatcherItem represents. Sample Code//Note: This sample code is for demonstration purposes only. It is not intended for //use in a production environment, is not guaranteed against defects or errors, and //is in no way optimized or streamlined. Account anAccount = [SELECT Id, Name FROM Account LIMIT 1]; //set Account pse.RateCardMatcherItem matcherItem = new pse.RateCardMatcherItem(); matcherItem.setAccountID(anAccount.Id); //get the Account Id Id result = matcherItem.getAccountId(); System.assertEquals(anAccount.Id, result); setAccountIdglobal void setAccountId(Id accountId) Sets the Account Id that the pse.RateCardMatcherItem represents. Input Parameters
Sample Code//Note: This sample code is for demonstration purposes only. It is not intended for //use in a production environment, is not guaranteed against defects or errors, and //is in no way optimized or streamlined. Account anAccount = [SELECT Id, Name FROM Account LIMIT 1]; //set Account pse.RateCardMatcherItem matcherItem = new pse.RateCardMatcherItem(); matcherItem.setAccountID(anAccount.Id); //get the Account Id Id result = matcherItem.getAccountId(); System.assertEquals(anAccount.Id, result); getRegionIdglobal Id getRegionId() Get the Id of the Region that the pse.RateCardMatcherItem represents. Return ValueReturns the Id of the Region the RateCardMatcherItem represents. Sample Code//Note: This sample code is for demonstration purposes only. It is not intended for //use in a production environment, is not guaranteed against defects or errors, and //is in no way optimized or streamlined. pse__Region__c aRegion = [SELECT Id, Name FROM pse__Region__c LIMIT 1]; //set the region Id pse.RateCardMatcherItem matcherItem = new pse.RateCardMatcherItem(); matcherItem.setRegionId(aRegion.Id); //get the region Id Id result = matcherItem.getRegionId(); System.assertEquals(aRegion.Id, result); setRegionIdglobal void setRegionId(Id regionId) Sets the Region Id that the pse.RateCardMatcherItem represents. Input Parameters
Sample Code//Note: This sample code is for demonstration purposes only. It is not intended for //use in a production environment, is not guaranteed against defects or errors, and //is in no way optimized or streamlined. pse__Region__c aRegion = [SELECT Id, Name FROM pse__Region__c LIMIT 1]; //set the region Id pse.RateCardMatcherItem matcherItem = new pse.RateCardMatcherItem(); matcherItem.setRegionId(aRegion.Id); //get the region Id Id result = matcherItem.getRegionId(); System.assertEquals(aRegion.Id, result); getRegionIdChainglobal String getRegionIdChain() Get the regionIdChain that the pse.RateCardMatcherItem represents. Return ValueReturns the regionIdChain that the RateCardMatcherItem represents. Sample Code//Note: This sample code is for demonstration purposes only. It is not intended for //use in a production environment, is not guaranteed against defects or errors, and //is in no way optimized or streamlined. pse__Region__c aRegion = [SELECT Id, Name, pse__Region_ID_Chain__c FROM pse__Region__c LIMIT 1]; //set the region Id chain pse.RateCardMatcherItem matcherItem = new pse.RateCardMatcherItem(); matcherItem.setRegionIdChain(aRegion.pse__Region_ID_Chain__c); //get the region Id chain String result = matcherItem.getRegionIdChain(); System.assertEquals(aRegion.pse__Region_ID_Chain__c, result); setRegionIdChainglobal void setRegionIdChain(String regionIdChain) Sets the regionIdChain that the pse.RateCardMatcherItem represents. Input Parameters
Sample Code//Note: This sample code is for demonstration purposes only. It is not intended for //use in a production environment, is not guaranteed against defects or errors, and //is in no way optimized or streamlined. pse__Region__c aRegion = [SELECT Id, Name, pse__Region_ID_Chain__c FROM pse__Region__c LIMIT 1]; //set the region Id chain pse.RateCardMatcherItem matcherItem = new pse.RateCardMatcherItem(); matcherItem.setRegionIdChain(aRegion.pse__Region_ID_Chain__c); //get the region Id chain String result = matcherItem.getRegionIdChain(); System.assertEquals(aRegion.pse__Region_ID_Chain__c, result); getPracticeIdglobal Id getPracticeId() Get the PracticeId that the pse.RateCardMatcherItem represents. Return ValueReturns the PracticeId that the RateCardMatcherItem represents. Sample Code//Note: This sample code is for demonstration purposes only. It is not intended for //use in a production environment, is not guaranteed against defects or errors, and //is in no way optimized or streamlined. pse__Practice__c aPractice = [SELECT Id, Name FROM pse__Practice__c LIMIT 1]; //set the Practice Id pse.RateCardMatcherItem matcherItem = new pse.RateCardMatcherItem(); matcherItem.setPracticeId(aPractice.Id); //get the Practice Id Id result = matcherItem.getPracticeId(); System.assertEquals(aPractice.Id, result); setPracticeIdglobal void setPracticeId(Id practiceId) Sets the PracticeId that the pse.RateCardMatcherItem represents. Input Parameters
Sample Code//Note: This sample code is for demonstration purposes only. It is not intended for //use in a production environment, is not guaranteed against defects or errors, and //is in no way optimized or streamlined. pse__Practice__c aPractice = [SELECT Id, Name FROM pse__Practice__c LIMIT 1]; //set the Practice Id pse.RateCardMatcherItem matcherItem = new pse.RateCardMatcherItem(); matcherItem.setPracticeId(aPractice.Id); //get the Practice Id Id result = matcherItem.getPracticeId(); System.assertEquals(aPractice.Id, result); getPracticeIdChainglobal String getPracticeIdChain() Get the practiceIdChain that the pse.RateCardMatcherItem represents. Return ValueReturns the practiceIdChain that the RateCardMatcherItem represents. Sample Code//Note: This sample code is for demonstration purposes only. It is not intended for //use in a production environment, is not guaranteed against defects or errors, and //is in no way optimized or streamlined. pse__Practice__c aPractice = [SELECT Id, Name, pse__Practice_ID_Chain__c FROM pse__Practice__c LIMIT 1]; //set the Practice Id Chain pse.RateCardMatcherItem matcherItem = new pse.RateCardMatcherItem(); matcherItem.setPracticeIdChain(aPractice.pse__Practice_ID_Chain__c); //get the Practice Id Chain String result = matcherItem.getPracticeIdChain(); System.assertEquals(aPractice.pse__Practice_ID_Chain__c, result); setPracticeIdChainglobal void setPracticeIdChain(String practiceIdChain) Sets the practiceIdChain that the pse.RateCardMatcherItem represents. Input Parameters
Sample Code//Note: This sample code is for demonstration purposes only. It is not intended for //use in a production environment, is not guaranteed against defects or errors, and //is in no way optimized or streamlined. pse__Practice__c aPractice = [SELECT Id, Name, pse__Practice_ID_Chain__c FROM pse__Practice__c LIMIT 1]; //set the Practice Id Chain pse.RateCardMatcherItem matcherItem = new pse.RateCardMatcherItem(); matcherItem.setPracticeIdChain(aPractice.pse__Practice_ID_Chain__c); //get the Practice Id Chain String result = matcherItem.getPracticeIdChain(); System.assertEquals(aPractice.pse__Practice_ID_Chain__c, result); getGroupIdglobal Id getGroupId() Get the groupId that the pse.RateCardMatcherItem represents. Return ValueReturns the groupId that the RateCardMatcherItem represents. Sample Code//Note: This sample code is for demonstration purposes only. It is not intended for //use in a production environment, is not guaranteed against defects or errors, and //is in no way optimized or streamlined. pse__Grp__c aGroup = [SELECT Id, Name FROM pse__Grp__c LIMIT 1]; //set the Group Id pse.RateCardMatcherItem matcherItem = new pse.RateCardMatcherItem(); matcherItem.setGroupId(aGroup.Id); //get the Group Id Id result = matcherItem.getGroupId(); System.assertEquals(aGroup.Id, result); setGroupIdglobal void setGroupId(Id groupId) Sets the groupId that the pse.RateCardMatcherItem represents. Input Parameters
Sample Code//Note: This sample code is for demonstration purposes only. It is not intended for //use in a production environment, is not guaranteed against defects or errors, and //is in no way optimized or streamlined. pse__Grp__c aGroup = [SELECT Id, Name FROM pse__Grp__c LIMIT 1]; //set the Group Id pse.RateCardMatcherItem matcherItem = new pse.RateCardMatcherItem(); matcherItem.setGroupId(aGroup.Id); //get the Group Id Id result = matcherItem.getGroupId(); System.assertEquals(aGroup.Id, result); getGroupIdChainglobal String getGroupIdChain() Get the groupIdChain that the pse.RateCardMatcherItem represents. Return ValueReturns the groupIdChain that the RateCardMatcherItem represents. Sample Code//Note: This sample code is for demonstration purposes only. It is not intended for //use in a production environment, is not guaranteed against defects or errors, and //is in no way optimized or streamlined. pse__Grp__c aGroup = [SELECT Id, Name, pse__Group_ID_Chain__c FROM pse__Grp__c LIMIT 1]; //set the Group Id Chain pse.RateCardMatcherItem matcherItem = new pse.RateCardMatcherItem(); matcherItem.setGroupIdChain(aGroup.pse__Group_ID_Chain__c); //get the Group Id Chain String result = matcherItem.getGroupIdChain(); System.assertEquals(aGroup.pse__Group_ID_Chain__c, result); setGroupIdChainglobal void setGroupIdChain(String groupIdChain) Sets the groupIdChain that the pse.RateCardMatcherItem represents. Input Parameters
Sample Code//Note: This sample code is for demonstration purposes only. It is not intended for //use in a production environment, is not guaranteed against defects or errors, and //is in no way optimized or streamlined. pse__Grp__c aGroup = [SELECT Id, Name, pse__Group_ID_Chain__c FROM pse__Grp__c LIMIT 1]; //set the Group Id Chain pse.RateCardMatcherItem matcherItem = new pse.RateCardMatcherItem(); matcherItem.setGroupIdChain(aGroup.pse__Group_ID_Chain__c); //get the Group Id Chain String result = matcherItem.getGroupIdChain(); System.assertEquals(aGroup.pse__Group_ID_Chain__c, result); getRoleglobal String getRole() Get the role that the pse.RateCardMatcherItem represents. Return ValueReturns the role that the RateCardMatcherItem represents. Sample Code//Note: This sample code is for demonstration purposes only. It is not intended for //use in a production environment, is not guaranteed against defects or errors, and //is in no way optimized or streamlined. pse__Assignment__c assignment = [SELECT Id, Name, pse__Role__c FROM pse__Assignment__c LIMIT 1]; //set the role pse.RateCardMatcherItem matcherItem = new pse.RateCardMatcherItem(); matcherItem.setRole(assignment.pse__Role__c); //get the role String result = matcherItem.getRole(); System.assertEquals(assignment.pse__Role__c, result); setRoleglobal void setRole(String role) Sets the role that the pse.RateCardMatcherItem represents. Input Parameters
Sample Code//Note: This sample code is for demonstration purposes only. It is not intended for //use in a production environment, is not guaranteed against defects or errors, and //is in no way optimized or streamlined. pse__Assignment__c assignment = [SELECT Id, Name, pse__Role__c FROM pse__Assignment__c LIMIT 1]; //set the role pse.RateCardMatcherItem matcherItem = new pse.RateCardMatcherItem(); matcherItem.setRole(assignment.pse__Role__c); //get the role String result = matcherItem.getRole(); System.assertEquals(assignment.pse__Role__c, result); getCurrencyIsoCodeglobal String getCurrencyIsoCode() Get the currencyIsoCode that the pse.RateCardMatcherItem represents. Return ValueReturns the currencyIsoCode that the RateCardMatcherItem represents. Sample Code//Note: This sample code is for demonstration purposes only. It is not intended for //use in a production environment, is not guaranteed against defects or errors, and //is in no way optimized or streamlined. You need to provide some sample code setCurrencyIsoCodeglobal void setCurrencyIsoCode(String currencyIsoCode) Sets the currencyIsoCode that the pse.RateCardMatcherItem represents. Input Parameters
Sample Code//Note: This sample code is for demonstration purposes only. It is not intended for //use in a production environment, is not guaranteed against defects or errors, and //is in no way optimized or streamlined. You need to provide some sample code getStartDateglobal Date getStartDate() Get the startDate of the pse.RateCardMatcherItem. Return ValueReturns the startDate of the RateCardMatcherItem. Sample Code//Note: This sample code is for demonstration purposes only. It is not intended for //use in a production environment, is not guaranteed against defects or errors, and //is in no way optimized or streamlined. Date startDate = Date.today(); //set the start date pse.RateCardMatcherItem matcherItem = new pse.RateCardMatcherItem(); matcherItem.setStartDate(startDate); //get the start date Date result = matcherItem.getStartDate(); System.assertEquals(startDate, result); setStartDateglobal void setStartDate(Date startDate) Set the startDate for the pse.RateCardMatcherItem. Input Parameters
Sample Code//Note: This sample code is for demonstration purposes only. It is not intended for //use in a production environment, is not guaranteed against defects or errors, and //is in no way optimized or streamlined. Date startDate = Date.today(); //set the start date pse.RateCardMatcherItem matcherItem = new pse.RateCardMatcherItem(); matcherItem.setStartDate(startDate); //get the start date Date result = matcherItem.getStartDate(); System.assertEquals(startDate, result); getProjectOpportunityDiscountRateglobal Decimal getProjectOpportunityDiscountRate() Get the projectOpportunityDiscountRate of the pse.RateCardMatcherItem. Return ValueReturns the projectOpportunityDiscountRate of the RateCardMatcherItem. Sample Code//Note: This sample code is for demonstration purposes only. It is not intended for //use in a production environment, is not guaranteed against defects or errors, and //is in no way optimized or streamlined. Decimal discount = 50.0; //set the discount pse.RateCardMatcherItem matcherItem = new pse.RateCardMatcherItem(); matcherItem.setProjectOpportunityDiscountRate(discount); //get the discount Decimal result = matcherItem.getProjectOpportunityDiscountRate(); System.assertEquals(discount, result); setProjectOpportunityDiscountRateglobal void setProjectOpportunityDiscountRate(Decimal projectOpportunityDiscountRate) Set the projectOpportunityDiscountRate for the pse.RateCardMatcherItem. Input Parameters
Sample Code//Note: This sample code is for demonstration purposes only. It is not intended for //use in a production environment, is not guaranteed against defects or errors, and //is in no way optimized or streamlined. Decimal discount = 50.0; //set the discount pse.RateCardMatcherItem matcherItem = new pse.RateCardMatcherItem(); matcherItem.setProjectOpportunityDiscountRate(discount); //get the discount Decimal result = matcherItem.getProjectOpportunityDiscountRate(); System.assertEquals(discount, result); getProjectOpportunityDiscountLimitAmountglobal Decimal getProjectOpportunityDiscountLimitAmount() Get the projectOpportunityDiscountLimitAmount of the pse.RateCardMatcherItem. Return ValueReturns the projectOpportunityDiscountLimitAmount of the RateCardMatcherItem. Sample Code//Note: This sample code is for demonstration purposes only. It is not intended for //use in a production environment, is not guaranteed against defects or errors, and //is in no way optimized or streamlined. Decimal discountLimit = 50.0; //set the discount limit pse.RateCardMatcherItem matcherItem = new pse.RateCardMatcherItem(); matcherItem.setProjectOpportunityDiscountLimitAmount(discount); //get the discount limit Decimal result = matcherItem.getProjectOpportunityDiscountLimitAmount(); System.assertEquals(discountLimit, result); setProjectOpportunityDiscountLimitAmountglobal void setProjectOpportunityDiscountLimitAmount(Decimal projectOpportunityDiscountLimitAmount) Set the projectOpportunityDiscountLimitAmount for the pse.RateCardMatcherItem. Input Parameters
Sample Code//Note: This sample code is for demonstration purposes only. It is not intended for //use in a production environment, is not guaranteed against defects or errors, and //is in no way optimized or streamlined. Decimal discountLimit = 50.0; //set the discount limit pse.RateCardMatcherItem matcherItem = new pse.RateCardMatcherItem(); matcherItem.setProjectOpportunityDiscountLimitAmount(discount); //get the discount limit Decimal result = matcherItem.getProjectOpportunityDiscountLimitAmount(); System.assertEquals(discountLimit, result); getRateCardSetIdglobal Id getRateCardSetId() Get the rateCardSetId of the pse.RateCardMatcherItem. Return ValueReturns the rateCardSetId of the RateCardMatcherItem. Sample Code//Note: This sample code is for demonstration purposes only. It is not intended for //use in a production environment, is not guaranteed against defects or errors, and //is in no way optimized or streamlined. pse__Rate_Card_Set__c rateCardSet = [SELECT Id, Name FROM pse__Rate_Card_Set__c LIMIT 1]; //set the ratecard Id set pse.RateCardMatcherItem matcherItem = new pse.RateCardMatcherItem(); matcherItem.setRateCardSetId(rateCardSet.Id); //get the ratecard Id set Id result = matcherItem.getRateCardSetId(); System.assertEquals(rateCardSet.Id, result); setRateCardSetIdglobal void setRateCardSetId(Id rateCardSetId) Set the rateCardSetId for the pse.RateCardMatcherItem. Input Parameters
Sample Code//Note: This sample code is for demonstration purposes only. It is not intended for //use in a production environment, is not guaranteed against defects or errors, and //is in no way optimized or streamlined. pse__Rate_Card_Set__c rateCardSet = [SELECT Id, Name FROM pse__Rate_Card_Set__c LIMIT 1]; //set the ratecard Id set pse.RateCardMatcherItem matcherItem = new pse.RateCardMatcherItem(); matcherItem.setRateCardSetId(rateCardSet.Id); //get the ratecard Id set Id result = matcherItem.getRateCardSetId(); System.assertEquals(rateCardSet.Id, result); getUseDatedResourceBillRatesglobal Boolean getUseDatedResourceBillRates() Get the value of the boolean that indicates whether or not dated resource bill rate cards should be used for the pse.RateCardMatcherItem. Return ValueReturns true if dated resource bill rate cards should be used. Sample Code//Note: This sample code is for demonstration purposes only. It is not intended for //use in a production environment, is not guaranteed against defects or errors, and //is in no way optimized or streamlined. //set to use dated resource rate bill ratecards pse.RateCardMatcherItem matcherItem = new pse.RateCardMatcherItem(); matcherItem.setUseDatedResourceBillRates(true); //get if the matcher should use dated resource rate bill ratecards Boolean result = matcherItem.getUseDatedResourceBillRates(); System.assertEquals(true, result); setUseDatedResourceBillRatesglobal void setUseDatedResourceBillRates(Boolean useDatedResourceBillRates) Set the value of the boolean that indicates whether or not dated resource bill rate cards should be used for the pse.RateCardMatcherItem. Input Parameters
Sample Code//Note: This sample code is for demonstration purposes only. It is not intended for //use in a production environment, is not guaranteed against defects or errors, and //is in no way optimized or streamlined. //set to use dated resource rate bill ratecards pse.RateCardMatcherItem matcherItem = new pse.RateCardMatcherItem(); matcherItem.setUseDatedResourceBillRates(true); //get if the matcher should use dated resource rate bill ratecards Boolean result = matcherItem.getUseDatedResourceBillRates(); System.assertEquals(true, result); getUseDatedResourceCostRatesglobal Boolean getUseDatedResourceCostRates() Get the value of the boolean that indicates whether or not dated resource cost rate cards should be used for the pse.RateCardMatcherItem. Return ValueReturns true if dated resource cost rate cards should be used. Sample Code//Note: This sample code is for demonstration purposes only. It is not intended for //use in a production environment, is not guaranteed against defects or errors, and //is in no way optimized or streamlined. //set to use dated resource rate cost ratecards pse.RateCardMatcherItem matcherItem = new pse.RateCardMatcherItem(); matcherItem.setUseDatedResourceCostRates(true); //get if the matcher should use dated resource rate cost ratecards Boolean result = matcherItem.getUseDatedResourceCostRates(); System.assertEquals(true, result); setUseDatedResourceCostRatesglobal void setUseDatedResourceCostRates(Boolean useDatedResourceCostRates) Set the value of the boolean that indicates whether or not dated resource cost rate cards should be used for the pse.RateCardMatcherItem. Input Parameters
Sample Code//Note: This sample code is for demonstration purposes only. It is not intended for //use in a production environment, is not guaranteed against defects or errors, and //is in no way optimized or streamlined. //set to use dated resource rate cost ratecards pse.RateCardMatcherItem matcherItem = new pse.RateCardMatcherItem(); matcherItem.setUseDatedResourceCostRates(true); //get if the matcher should use dated resource rate cost ratecards Boolean result = matcherItem.getUseDatedResourceCostRates(); System.assertEquals(true, result); onMatchglobal abstract void onMatch(pse__Rate_Card__c rateCard, pse.RateCardMatchingService.DatedResourceRateType rateCardType) Behavior to perform once a matched rate card has been found. Input Parameters
Sample Code//Note: This sample code is for demonstration purposes only. It is not intended for //use in a production environment, is not guaranteed against defects or errors, and //is in no way optimized or streamlined. pse__Rate_Card__c rateCard = [SELECT Id, Name, pse__Dated_Resource_Rate_Type__c FROM pse__Rate_Card__c LIMIT 1]; pse.RateCardMatchingService.RateCardType ratetype = pse.RateCardMatchingService.getDatedResourceRateType(rateCard); pse.RateCardMatcherItem matcherItem = new pse.RateCardMatcherItem(); matcherItem.onMatch(rateCard, ratetype); Boolean result = matcherItem.isDirty(); System.assertEquals(true, result); Sample Code
//Note: This sample code is for demonstration purposes only. It is not intended for
//use in a production environment, is not guaranteed against defects or errors, and
//is in no way optimized or streamlined.
public with sharing class MatcherItemExample extends pse.RateCardMatcherItem {
private Boolean isDirty = false;
public override void onMatch(
pse__Rate_Card__c rateCard,
pse.RateCardMatchingService.RateCardType rateCardType
) {
if(rateCard == null)
{
onNoMatch(rateCardType);
}
if(rateCard.Name == 'MatchedName')
{
isDirty = true
pse__Assignment__c assignment = (pse__Assignment__c) getRecord();
assignment.pse__Rate_Card__c = rateCard.Id
}
}
public override void onNoMatch(pse.RateCardMatchingService.RateCardType rateCardType)
{
pse__Assignment__c assignment = (pse__Assignment__c) getRecord();
if(rateCardType == pse.RateCardMatchingService.RateCardType.FIXED_RATE){
assignment.pse__Rate_Card__c = null;
}
}
public override Boolean isDirty()
{
return isDirty;
}
}
onNoMatchglobal abstract void onNoMatch(pse.RateCardMatchingService.DatedResourceRateType rateCardType) Behavior to perform if a matched rate card is not found. Input Parameters
Sample Code//Note: This sample code is for demonstration purposes only. It is not intended for //use in a production environment, is not guaranteed against defects or errors, and //is in no way optimized or streamlined. pse.RateCardMatcherItem matcherItem = new pse.RateCardMatcherItem(); matcherItem.onNoMatch(RateCardMatchingService.RateCardType.DATED_RATE_BILL); Boolean result = matcherItem.isDirty(); System.assertEquals(true, result); Sample Code
//Note: This sample code is for demonstration purposes only. It is not intended for
//use in a production environment, is not guaranteed against defects or errors, and
//is in no way optimized or streamlined.
public with sharing class MatcherItemExample extends pse.RateCardMatcherItem {
private Boolean isDirty = false;
public override void onMatch(
pse__Rate_Card__c rateCard,
pse.RateCardMatchingService.RateCardType rateCardType
) {
if(rateCard == null)
{
onNoMatch(rateCardType);
}
if(rateCard.Name == 'MatchedName')
{
isDirty = true
pse__Assignment__c assignment = (pse__Assignment__c) getRecord();
assignment.pse__Rate_Card__c = rateCard.Id
}
}
public override void onNoMatch(pse.RateCardMatchingService.RateCardType rateCardType)
{
pse__Assignment__c assignment = (pse__Assignment__c) getRecord();
if(rateCardType == pse.RateCardMatchingService.RateCardType.FIXED_RATE){
assignment.pse__Rate_Card__c = null;
}
}
public override Boolean isDirty()
{
return isDirty;
}
}
isDirtyglobal abstract Boolean isDirty() Indicates if the rateCardMatcherItem has been modified. Return ValueReturns true if the rateCardMatcherItem has been modified. Sample Code
//Note: This sample code is for demonstration purposes only. It is not intended for
//use in a production environment, is not guaranteed against defects or errors, and
//is in no way optimized or streamlined.
public with sharing class MatcherItemExample extends pse.RateCardMatcherItem {
private Boolean isDirty = false;
public override void onMatch(
pse__Rate_Card__c rateCard,
pse.RateCardMatchingService.RateCardType rateCardType
) {
if(rateCard == null)
{
onNoMatch(rateCardType);
}
if(rateCard.Name == 'MatchedName')
{
isDirty = true
pse__Assignment__c assignment = (pse__Assignment__c) getRecord();
assignment.pse__Rate_Card__c = rateCard.Id
}
}
public override void onNoMatch(pse.RateCardMatchingService.RateCardType rateCardType)
{
pse__Assignment__c assignment = (pse__Assignment__c) getRecord();
if(rateCardType == pse.RateCardMatchingService.RateCardType.FIXED_RATE){
assignment.pse__Rate_Card__c = null;
}
}
public override Boolean isDirty()
{
return isDirty;
}
}
|