• Kamran-Rao
  • NEWBIE
  • 75 Points
  • Member since 2009

  • Chatter
    Feed
  • 3
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 10
    Questions
  • 19
    Replies

I have a custom object Media_Campaign__c which is carrying the OpportunityID of its parent Opportunity. Multiple MediaCampaigns can exist for a single opportunity. Also in my Contract, there is a field Opportunity_Id__c that carries the Opportunity ID of the Opportunity respective to that Contract.

 

My simple objective is to get only those rows from Media_Campaign__c whose corresponding opportunities have been converted into Contracts in a given dates.

 

What I do is, get Opportunity_Id__c from Contract between mentioned date like following:

select Opportunity_Id__c FROM CONTRACT WHERE CreatedDate > 2009-04-21T00:00:00.000Z --Works Fine

 

Then I use above query (it returns me Opp Ids against those contracts that have been converted to contract in a given time) as criteria in main query as following

 

select id, Opportunity__c from Media_Campaign__c
Where Opportunity__c in (select Opportunity_Id__c 
                                        FROM CONTRACT WHERE CreatedDate > 2009-04-21T00:00:00.000Z
)
 
I am getting this error when I write the following query:
Cannot use a foreign key for outer field for semi join at line

 

Can somebody help me in reactifying this query. It is pretty simple in Oracle and SQLServer. But I am tired off trying in SOQL.

 

Rao

Message Edited by Kamran-Rao on 07-30-2009 04:09 AM

Hi,

 

Can somebody help me in tranlating an SQL query in SOQL. Here is the query:

 

Select Opportunity.Id
FROM Opportunity
inner join Contract
on Opportunity.Id = Contract.Opportunity_Id__c

 

I have modified this query and it works fine, following is the modified query:

 

Select Id FROM Opportunity
Where Id in (select Opportunity_Id__c from Contract).

 

Now I need to put this query in another sub query on the same pattern and it gives me an error:

 

select Id FROM Media_Campaign__c
where Id in (Select Opportunity_Media_Campaign__c FROM Contract_Campaign__c )

and OPPORTUNITY__C in (Select Id FROM Opportunity

                                        Where Id in (select Opportunity_Id__c from Contract)) 

 

Error: Nesting of semi Joins subselects is not supported:

 

Here is the respective sql pseudo translation of above query that is givnig me the error.

 

select mc.mediaCapaignID, cc.contractCampaignID
from mediaCamp__c mc
left outer join contractCampaign__c cc
on mc.mediaCapaignID == cc.contractCampaignID
where mc.opportunityID in
 (select opp.opportunityID
 from opportunity opp
 inner join contract con
 on opp.opportunityID = con.opportunityID
 where con.RegionID = 'Fr'

 

Thanking you in anticipatioin. 

 

 

Regards,

Rao

Message Edited by Kamran-Rao on 07-20-2009 04:40 AM
Message Edited by Kamran-Rao on 07-20-2009 05:12 AM

<script> function getValue () { var myString = 'Test Value'; return myString; } </script> <apex:pageBlockTable value="{!myData}" var="aMyData" id="MyData"> <apex:column headerValue="My Custom Value"> <!--getValue() is my supposed javascript function that will return me the value -> <apex:outputField value="{!$getValue ();}"/> </apex:column> </apex:pageBlockTable>

 

I want to get some value placed in the 'value' attribute of my apex:outputFiled/apex:inputFiled through a javascript. Is it possible?
Following is the code for what i want to do (this code will not work, just to explain what I want to do)

 

Regards,

Rao

 

 

Message Edited by Kamran-Rao on 06-30-2009 04:59 AM

I have developed and added an attachment list on Opportunity and Contracts. I want an auto-genrated email to be

sent with two conditions:

 

1- IF the attached file's name start with 'PRF'.
2- Then I will sent the email to the ID after making a search for 'createdByID' for a record on condition of that contract/opp number in one of my custom objects.

 

How can I do that? Any idea please.

 

Regards,
Rao

I need the complete URL of my VF page in controller class (apex class). I have tried the the following solution but to of no use:

 

string x = ApexPages.currentPage();
srting y = ApexPages.currentPage().getURL();

 

Neither of the above methods are giving me the exact URL (e.g., https://c.cs2.visual.force.com/apex/MasterDetail?contractID=2009050010&bu=Media) of the current page that I need to send in an autogenerated email.

 

Regards,
Rao

I have an <apex:fieldHidden id="abc" /> on my VF form. I set a value in this field on onSubmit of form. But I am unable to get to way to get this value in my apex class.

 

Any help please.

 

Regards,
Rao

I am working on History Tracking for one of my custom object and want it to be displayed in a customized fashion. I made two page blocks; 1st page block displays the items in grid with a link in first column as History (rerendered the 2nd page block on its click). In 2nd page block I created a Apex:pageBlockTable to display CreatedBy, CreatedDate, Field, OldValue, NewValue. This 2nd page block displays the History respective to the item clicked in the 1st page block.

 

Problem:

Everything works as supposed only when I exclude the Field column. If I put the field column in my 2nd page block, pageblock is not refreshed and nothing is displayed.

<apex:form id="pixelReqForm"> <apex:pageBlock title="Pixel Request Form (PRF)" id="PixReqForm"><br></br> <apex:pageBlockTable value="{!PixelReq}" var="aPixelReq" id="pixelReqTable"> <apex:column headerValue="History" id="hisTrack"> <apex:commandLink value="History" reRender="pixelReqHisTable"> <apex:param name="pixelReqID" value="{!aPixelReq.id}"/> </apex:commandLink> </apex:column> <apex:column headerValue="Delete" id="isDeleteColumn"> <apex:inputCheckbox value="{!aPixelReq.isDeleted__c}" id="isDelete"/> </apex:column> <apex:column headerValue="Agency"> <apex:inputField value="{!aPixelReq.Agency__c}"/> </apex:column> </apex:pageBlockTable> </apex:pageBlock> <apex:pageBlock title="Pixel Request Form (PRF)" id="pixelReqHistBlock"><br></br> <apex:pageBlockTable value="{!PixReqHistory}" var="aHistory" id="pixelReqHisTable"> <apex:column headerValue="Created By" id="createdBy"> <apex:outputField value="{!aHistory.CreatedById}"/> </apex:column> <apex:column headerValue="Changed Field" id="changedField"> <apex:outputField value="{!aHistory.FIELD}"/> </apex:column> </apex:pageBlockTable> </apex:pageBlock> <apex:pageBlock title="PRF History Tracking" id="histIFrame"> </apex:form> </apex:page> =============================== Controller: ... List <PixelReqForm__History> pixReqHist; public List<PixelReqForm__History> getPixReqHistory() { pixReqHist = [Select Id, IsDeleted, ParentId, CreatedById, CreatedDate, Field, OldValue, NewValue FROM PixelReqForm__History where PARENTID = :ApexPages.currentPage().getParameters().get('pixelReqID') order by createdDate desc]; return pixReqHist; } ...

 

 

Regards,
Rao

I am new to visualForce and working on a custom object development that will be associated with contract. I am looking for a step-by-step tutorial that can make my Master-Detail concept clear e.g., I want to develop a master-detail page such that my master page will be a grid that will display the contacts in my SF system as a link. When the user will click on any of the link on the same page in detail page block, details of the clicked contact should open.

 

Can someone please refer me to such a tutorial or sample code that can solve my problem?

 

Thanks,

Rao

We are in a very complicated situation. We have a custom object 'xyz' linked with the contracts. When user deletes some record with ID (e.g., system generated SF ID is 'a1ZR00000008ko6') and then creates a new record in xyz custom object associated with the same contract. SF system assigns the same ID (ID of the previously deleted record) to the newly created record on non-deterministic or intermittent basis. But whenever this scenario happens it creates a lot of mess with hours of backtracking for us. Does someone has an idea on what algorithm basis SF generates unique ID’s, is there any possibility of their duplication? 

Has this problem ever happened to somebody or any such know issue is there? Is this really possible? any comments that can help us.

 

Regards,

Rao

Hi,

 

I have a multi line editor and the first column of the editor is a commandLink named Show Detail. My specific

requirement is that when user clicks on the Show Detail, link another page with the link "https://cs2.salesforce.com/apex/TestPage?id=a1ZR00000008koK" should open with in the current page in some page block or some form.

 

Can someone help me please.

 

Regards,
Rao

I have a custom object Media_Campaign__c which is carrying the OpportunityID of its parent Opportunity. Multiple MediaCampaigns can exist for a single opportunity. Also in my Contract, there is a field Opportunity_Id__c that carries the Opportunity ID of the Opportunity respective to that Contract.

 

My simple objective is to get only those rows from Media_Campaign__c whose corresponding opportunities have been converted into Contracts in a given dates.

 

What I do is, get Opportunity_Id__c from Contract between mentioned date like following:

select Opportunity_Id__c FROM CONTRACT WHERE CreatedDate > 2009-04-21T00:00:00.000Z --Works Fine

 

Then I use above query (it returns me Opp Ids against those contracts that have been converted to contract in a given time) as criteria in main query as following

 

select id, Opportunity__c from Media_Campaign__c
Where Opportunity__c in (select Opportunity_Id__c 
                                        FROM CONTRACT WHERE CreatedDate > 2009-04-21T00:00:00.000Z
)
 
I am getting this error when I write the following query:
Cannot use a foreign key for outer field for semi join at line

 

Can somebody help me in reactifying this query. It is pretty simple in Oracle and SQLServer. But I am tired off trying in SOQL.

 

Rao

Message Edited by Kamran-Rao on 07-30-2009 04:09 AM

Hi,

 

Can somebody help me in tranlating an SQL query in SOQL. Here is the query:

 

Select Opportunity.Id
FROM Opportunity
inner join Contract
on Opportunity.Id = Contract.Opportunity_Id__c

 

I have modified this query and it works fine, following is the modified query:

 

Select Id FROM Opportunity
Where Id in (select Opportunity_Id__c from Contract).

 

Now I need to put this query in another sub query on the same pattern and it gives me an error:

 

select Id FROM Media_Campaign__c
where Id in (Select Opportunity_Media_Campaign__c FROM Contract_Campaign__c )

and OPPORTUNITY__C in (Select Id FROM Opportunity

                                        Where Id in (select Opportunity_Id__c from Contract)) 

 

Error: Nesting of semi Joins subselects is not supported:

 

Here is the respective sql pseudo translation of above query that is givnig me the error.

 

select mc.mediaCapaignID, cc.contractCampaignID
from mediaCamp__c mc
left outer join contractCampaign__c cc
on mc.mediaCapaignID == cc.contractCampaignID
where mc.opportunityID in
 (select opp.opportunityID
 from opportunity opp
 inner join contract con
 on opp.opportunityID = con.opportunityID
 where con.RegionID = 'Fr'

 

Thanking you in anticipatioin. 

 

 

Regards,

Rao

Message Edited by Kamran-Rao on 07-20-2009 04:40 AM
Message Edited by Kamran-Rao on 07-20-2009 05:12 AM

<script> function getValue () { var myString = 'Test Value'; return myString; } </script> <apex:pageBlockTable value="{!myData}" var="aMyData" id="MyData"> <apex:column headerValue="My Custom Value"> <!--getValue() is my supposed javascript function that will return me the value -> <apex:outputField value="{!$getValue ();}"/> </apex:column> </apex:pageBlockTable>

 

I want to get some value placed in the 'value' attribute of my apex:outputFiled/apex:inputFiled through a javascript. Is it possible?
Following is the code for what i want to do (this code will not work, just to explain what I want to do)

 

Regards,

Rao

 

 

Message Edited by Kamran-Rao on 06-30-2009 04:59 AM

I need the complete URL of my VF page in controller class (apex class). I have tried the the following solution but to of no use:

 

string x = ApexPages.currentPage();
srting y = ApexPages.currentPage().getURL();

 

Neither of the above methods are giving me the exact URL (e.g., https://c.cs2.visual.force.com/apex/MasterDetail?contractID=2009050010&bu=Media) of the current page that I need to send in an autogenerated email.

 

Regards,
Rao

I have an <apex:fieldHidden id="abc" /> on my VF form. I set a value in this field on onSubmit of form. But I am unable to get to way to get this value in my apex class.

 

Any help please.

 

Regards,
Rao

I am working on History Tracking for one of my custom object and want it to be displayed in a customized fashion. I made two page blocks; 1st page block displays the items in grid with a link in first column as History (rerendered the 2nd page block on its click). In 2nd page block I created a Apex:pageBlockTable to display CreatedBy, CreatedDate, Field, OldValue, NewValue. This 2nd page block displays the History respective to the item clicked in the 1st page block.

 

Problem:

Everything works as supposed only when I exclude the Field column. If I put the field column in my 2nd page block, pageblock is not refreshed and nothing is displayed.

<apex:form id="pixelReqForm"> <apex:pageBlock title="Pixel Request Form (PRF)" id="PixReqForm"><br></br> <apex:pageBlockTable value="{!PixelReq}" var="aPixelReq" id="pixelReqTable"> <apex:column headerValue="History" id="hisTrack"> <apex:commandLink value="History" reRender="pixelReqHisTable"> <apex:param name="pixelReqID" value="{!aPixelReq.id}"/> </apex:commandLink> </apex:column> <apex:column headerValue="Delete" id="isDeleteColumn"> <apex:inputCheckbox value="{!aPixelReq.isDeleted__c}" id="isDelete"/> </apex:column> <apex:column headerValue="Agency"> <apex:inputField value="{!aPixelReq.Agency__c}"/> </apex:column> </apex:pageBlockTable> </apex:pageBlock> <apex:pageBlock title="Pixel Request Form (PRF)" id="pixelReqHistBlock"><br></br> <apex:pageBlockTable value="{!PixReqHistory}" var="aHistory" id="pixelReqHisTable"> <apex:column headerValue="Created By" id="createdBy"> <apex:outputField value="{!aHistory.CreatedById}"/> </apex:column> <apex:column headerValue="Changed Field" id="changedField"> <apex:outputField value="{!aHistory.FIELD}"/> </apex:column> </apex:pageBlockTable> </apex:pageBlock> <apex:pageBlock title="PRF History Tracking" id="histIFrame"> </apex:form> </apex:page> =============================== Controller: ... List <PixelReqForm__History> pixReqHist; public List<PixelReqForm__History> getPixReqHistory() { pixReqHist = [Select Id, IsDeleted, ParentId, CreatedById, CreatedDate, Field, OldValue, NewValue FROM PixelReqForm__History where PARENTID = :ApexPages.currentPage().getParameters().get('pixelReqID') order by createdDate desc]; return pixReqHist; } ...

 

 

Regards,
Rao

I am new to visualForce and working on a custom object development that will be associated with contract. I am looking for a step-by-step tutorial that can make my Master-Detail concept clear e.g., I want to develop a master-detail page such that my master page will be a grid that will display the contacts in my SF system as a link. When the user will click on any of the link on the same page in detail page block, details of the clicked contact should open.

 

Can someone please refer me to such a tutorial or sample code that can solve my problem?

 

Thanks,

Rao

We are in a very complicated situation. We have a custom object 'xyz' linked with the contracts. When user deletes some record with ID (e.g., system generated SF ID is 'a1ZR00000008ko6') and then creates a new record in xyz custom object associated with the same contract. SF system assigns the same ID (ID of the previously deleted record) to the newly created record on non-deterministic or intermittent basis. But whenever this scenario happens it creates a lot of mess with hours of backtracking for us. Does someone has an idea on what algorithm basis SF generates unique ID’s, is there any possibility of their duplication? 

Has this problem ever happened to somebody or any such know issue is there? Is this really possible? any comments that can help us.

 

Regards,

Rao

Hi,

 

I have a multi line editor and the first column of the editor is a commandLink named Show Detail. My specific

requirement is that when user clicks on the Show Detail, link another page with the link "https://cs2.salesforce.com/apex/TestPage?id=a1ZR00000008koK" should open with in the current page in some page block or some form.

 

Can someone help me please.

 

Regards,
Rao

Hi Everybody,

 

I have a custom object. Through Create --> Object, I have checked the option of History Tracking for Object and some of the Fields. Then from the Layouts of the object I have add the History Tracking list to my custom object page also. Now that I have done that all as mentioned in the Help, I am surprised that where to find the tracking logs. Where the user should go to find tracked history to audit the changes on a particular record.

 

Thanks & Regards,
Shakespeare