Hi Risaha, What exactly is the issue faced by you? Are you trying to to define a composite key on a salesforce object. In salesforce one cannot define composite keys as one can define in oracle or MsSQL but you can provide "Unique and Required" attribute to one column and required attrinute on other columns and then write triggers or validation rule to make them behave as a composite key. Does this answer your query , if you do let me know I can give other suggestions, Thanks and regards,
Accually without use of triggers and validation rules i need to create composite key by use of concatenate 2 fields.can u help me to concatenate 2 fileds into 1.
Though there is no direct method of creating composite Key in SFDc but you can use a formula field which concatenates 2 fields which are your candidate keys.
i got a error "Compile Error: Initial term of field expression must be a concrete SObject: LIST<InsAmount__c> at line 366 column 29" by above code.pls help me
List<InsAmount__c> premiumList = [SELECT Id, ProductMaster__r.ProductId__c, PlanMaster__r.PlanCd__c , GenderName__c, Age__c, YearlyPremName__c, ResidenceName__c, PetName__c, DogTypeName__c, CatTypeName__c, OthersName__c, DaysName__c, TravelPurposeName__c, TravelAreaName__c, TravelDays__c, PetAge__c, KidsAge__c FROM InsAmount__c WHERE ProductMaster__r.ProductId__c IN :productIdList AND PlanMaster__r.PlanCd__c IN :planCodeList];
wrapList = new List<productIdPlanCodeWrapper>(); for(Integer i=0; i<productIdList.size(); i++){ wrapList.add(new productIdPlanCodeWrapper(productIdList[i],planCodeList[i]));
//error in this line String prodplan=premiumList.ProductMaster__r.ProductId__c + premiumList.PlanMaster__r.PlanCd__c; Map<String,productIdPlanCodeWrapper> mapProd = new Map<String,productIdPlanCodeWrapper>(); for(Integer nPlan=0; nPlan<productPlanList.size(); nPlan++){ mapProd.put(prodplan,wrapList[nPlan]); }
What exactly is the issue faced by you?
Are you trying to to define a composite key on a salesforce object.
In salesforce one cannot define composite keys as one can define in oracle or MsSQL but you can provide "Unique and Required" attribute to one column and required attrinute on other columns and then write triggers or validation rule to make them behave as a composite key.
Does this answer your query , if you do let me know I can give other suggestions,
Thanks and regards,
Accually without use of triggers and validation rules i need to create composite key by use of concatenate 2 fields.can u help me to concatenate 2 fileds into 1.
Though there is no direct method of creating composite Key in SFDc but you can use a formula field which concatenates 2 fields which are your candidate keys.
ya it is has relationship
i got a error "Compile Error: Initial term of field expression must be a concrete SObject: LIST<InsAmount__c> at line 366 column 29" by above code.pls help me
List<InsAmount__c> premiumList = [SELECT Id, ProductMaster__r.ProductId__c,
PlanMaster__r.PlanCd__c , GenderName__c, Age__c,
YearlyPremName__c, ResidenceName__c, PetName__c,
DogTypeName__c, CatTypeName__c, OthersName__c,
DaysName__c, TravelPurposeName__c, TravelAreaName__c,
TravelDays__c, PetAge__c, KidsAge__c
FROM InsAmount__c
WHERE ProductMaster__r.ProductId__c IN :productIdList
AND PlanMaster__r.PlanCd__c IN :planCodeList];
// for (Integer nIdx = 0; nIdx < planCodeList.size(); nIdx++) {
wrapList = new List<productIdPlanCodeWrapper>();
for(Integer i=0; i<productIdList.size(); i++){
wrapList.add(new productIdPlanCodeWrapper(productIdList[i],planCodeList[i]));
//error in this line
String prodplan=premiumList.ProductMaster__r.ProductId__c + premiumList.PlanMaster__r.PlanCd__c;
Map<String,productIdPlanCodeWrapper> mapProd = new Map<String,productIdPlanCodeWrapper>();
for(Integer nPlan=0; nPlan<productPlanList.size(); nPlan++){
mapProd.put(prodplan,wrapList[nPlan]);
}