• ArchieTechie6
  • NEWBIE
  • 80 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 13
    Questions
  • 13
    Replies
Hello,

While navigating to a standard page from custom page - I am passing URL Parameters to fields on the Standard page.
I am using fieldID to achieve this and it works for all fields except for lookup fields. 

As mentioned in this blog http://www.interactiveties.com/blog/2010/button-override.php, lookup field can be populated based on ID and Value.
I am passing both ID and values.

Below is the snippet of my URL value: 
/500/e?00Na000000ArhgS=SampleProd&CF00Na000000ArhgS_lkid=a7Za0000000PB6eEAG&nooverride=1

For some reason, this does not populate the values in the lookup field. It should populate as "SampleProd"

Please suggest!
Hi All,
I have a scenario where I need to execute a SOQL query inside of "For" loop.
When I execute this, the query returns 4 results. But, the object "PendingApprovals" contains only last record. 
 
public list<Knowledge__kav> PendingApprovals {get;set;}
string kbid;                    
             for(Knowledge__kav KnwObj:knowledgeList)
             {
                 
                  if(setOfPendingArticle.contains(KnwObj.Id))
                  {
                      
                      kbid= KnwObj.Id;
                                     
                      PendingApprovals = [Select Id ,Title, 
                      Summary__c, LastModifiedDate , 
                                                     CreatedById ,PublishStatus                         
                                                       from Knowledge__kav 
                                                     where Id  = :kbId];
                                                             
                  }
           }
            
I have 4 values of kbId. So, PendingApprovals should contain 4 items. But, it returns only one(last value). 
How do i loop through 4 values of kbid? 

Also, please suggest if SOQL query can be executed inside of for loop like I am doing. 
Any other better way to achieve this? 

Thanks!
Hello All,

I have read from various documentation, threads that we can create Knowledge Article using Apex.
I have referred to this : https://developer.salesforce.com/docs/atlas.en-us.knowledge_dev.meta/knowledge_dev/knowledge_development_intro.htm

I want to create a KB Article by passing "Title" which is a mandatory field for KB creation. 
I am very new to Salesforce and I have referred record creation here - https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/dome_sobject_create.htm

Is it the same way to create article using apex code? 

Please suggest.
Hello All,

I want to fetch items which are pending approvals. For this, I am querying from ProcessInstance.
Once I get the Ids from ProcessInstance, I want to query fields from my object by passing these IDs.

Below is my code:
public List<ProcessInstance> draftKBIds          {get;set;}
public List<Knowledge__kav> pendingArticles  {get;set;}

//Below query returns expected results from ProcessInstance
draftKBIds  = [select Id from ProcessInstance where TargetObjectId IN(select Id from Knowledge__KAV where PublishStatus='Draft')];
//Knowledge__KAV is the name of my Knowledge Base Object.
 pendingArticles  = [Select id, Title
                                from Knowledge__KAV ​where id IN: draftKBIds ];

The above highlighted query returns error: 

 Invalid bind expression type of ProcessInstance for Id field of SObject Knowledge__kav

Please suggest where I am going wrong. 
Hello All, 

I want to fetch KB Articles which are "Submitted for Approval".

In PublishStatus - We only have two values - Draft and Published.

How to query articles which are in Draft and Submitted to Approval(These are displayed with lock Symbol).
 
SELECT PublishStatus FROM KnowledgeBase__kav

The above query doesnt return the status which explains that article is submitted for approvals.

Could anyone help me here?
We have an article management tab in salesforce, wherein we can see Draft/Published/Archived and articles AssignedTo me or anyone. 

User-added image

Can we add more options to customize this tab? 
I want to add articles in Queue to this tab. This will help me see what articles are to be approved by me. 

Please suggest

Thanks!
Can I add jQuery in formula field?
I have a standard page. I want to add a button or a formula field. When clicked on this, I want to check cursor position - Is this achievable? 

I tried adding javascript to formula field but doesnt allow. 
Any help is appreaciated! Thanks in advance. 
Hello All,

I want to know how to write Javascript in formula field. 
Something similar to this blog: https://sfdc-gyaan.rhcloud.com/2014/04/referencing-javascript-file-from-static-resources-in-formula-fields/

I have a formula field. When clicked on it, I want to perform an action using JS.
HYPERLINK("javascript:alert('Hello World! - Formula Field');var html_doc = document.getElementsByTagName('head')[0];var js = document.createElement('script');js.setAttribute('type','text/javascript');js.setAttribute('src','/resource/********/HelloJS');html_doc.appendChild(js);js.onload= function() { sayHelloFromAnotherJS(); }; ","_self")

And then, I get this error:

Error: Incorrect argument value for function 'HYPERLINK()'. Javascript is not allowed.
Can anyone help me here? 
Hello All, 
Below is my code to display details from an object. I am using "rendered" to render only when value  is not null. This code works fine. 
To show some spacing between rows, I am using <br/> after each outputText.

The problem is : If some value is null and its not rendered, still <br/> will be rendered and shows unwanted spacing between rows. 
I have added a screenshot of the sample format of UI which I am trying to achieve. 

<apex:dataTable value="{!Docs}" var="docs">
    <apex:column >
        <apex:outputText value="ID : {!docs.Id}" /><br /><br />
        <apex:outputText value="Title : {!docs.Title}"/><br /><br />
        <apex:outputText value="Article Body : {!docs.Body__c}"/> <br /><br />
        <apex:outputText value="Article Number :{!docs.Number}"/> <br />
    </apex:column>
</apex:dataTable>
User-added image


What I want to do : I want to display space between rows, without using <br/>

 
Hi All, 

In the Knowledge page layout, we have the option to add related list by drag and drop so that Approval History can be displayed. 

User-added image

We can include some more columns to this related list but they are limited.

User-added image

I want to add some more columns which are not listed in above screenshot - These fields exist in knowledge object and are my custom fields.
Is this achievable? 

 
 
Hi All,
I am querying some data from custom object and this will be retrieved by semicolon seperated data. 
Below is my code:
public class CustomController {
public string prodNames  {get;set;} 
public CustomController()

qryProd = [ Select id ,ProdNames from ProdObj];  
}
if(qryProd<>null)
{
 prodNames      = qryProd[0].ProdNames;
}
}
}

In my VF Page:  
console.log('{!prodNames}') --->  This displays output as : Product1;Product2;Product45;Product49;

<apex:outputText style="font-weight:bold" value="All Product Names" /><br />
               <ul>               
               <li><apex:outputText value="{!prodNames }"/></li>             
              </ul>
 

I want to display this in a bullet list using <li> 
  • Product1
  • Product2
  • Product45
  • Product49
Can anyone help me here?

Thanks!

 
Hi All,
 
I am new to salesforce and I need help with the code which I have attempted.

I am trying to fetch some fields from Salesforce Knowledge Standard Object. 
I have created a Controller and below is my code:
public class KBController {

 public list<Knowledge__kav> KBArticles {get;set;}
 
 public KBController (ApexPages.StandardController StdCtrller){
 
 this.KBArticles = new list<Knowledge__kav>();
 
 KBArticles = [Select articleNumber, Title from Knowledge__kav where PublishStatus='Online'];  
 
 }
 }

Below is the code in my markup: 
<apex:page showHeader="false" sidebar="false" standardController="Knowledge__kav" extensions="KBController">
<apex:form >
<apex:pageBlock >
<apex:pageBlockTable value="{!KBArticles}" var="articles">
                <apex:column value="{!articles.articleNumber}"/> 
                <apex:column value="{!articles.Title}"/> 
</apex:pageBlockTable>
</apex:pageBlock>
</apex:form>
</apex:page>

With this code, I am getting an error: 
Id value null is not valid for the Knowledge__kav standard controller 

Could anyone please suggest me here?

Thanks!
 
 
Hi All,

I am trying to fetch knowledge articles in my VF Page.

Below is my code: 
<apex:page standardController="Knowledge__kav">
   <apex:form >
        <apex:pageBlock >
            <apex:pageBlockTable value="{!listOfArticles}" var="details">
                <apex:column value="{!details.articleNumber}"/> 
                <apex:column value="{!details.Title}"/> 
                <apex:column value="{!details.UrlName}"/> 
                </apex:pageBlockTable>
        </apex:pageBlock>
    </apex:form>
</apex:page>

I am getting below error: 
 
Error: Unknown property 'Knowledge__kavStandardController.listOfArticles'

Can anyone guide me where I am going wrong? 

Thanks!
Hi All,
I have a scenario where I need to execute a SOQL query inside of "For" loop.
When I execute this, the query returns 4 results. But, the object "PendingApprovals" contains only last record. 
 
public list<Knowledge__kav> PendingApprovals {get;set;}
string kbid;                    
             for(Knowledge__kav KnwObj:knowledgeList)
             {
                 
                  if(setOfPendingArticle.contains(KnwObj.Id))
                  {
                      
                      kbid= KnwObj.Id;
                                     
                      PendingApprovals = [Select Id ,Title, 
                      Summary__c, LastModifiedDate , 
                                                     CreatedById ,PublishStatus                         
                                                       from Knowledge__kav 
                                                     where Id  = :kbId];
                                                             
                  }
           }
            
I have 4 values of kbId. So, PendingApprovals should contain 4 items. But, it returns only one(last value). 
How do i loop through 4 values of kbid? 

Also, please suggest if SOQL query can be executed inside of for loop like I am doing. 
Any other better way to achieve this? 

Thanks!
Hello All,

I want to fetch items which are pending approvals. For this, I am querying from ProcessInstance.
Once I get the Ids from ProcessInstance, I want to query fields from my object by passing these IDs.

Below is my code:
public List<ProcessInstance> draftKBIds          {get;set;}
public List<Knowledge__kav> pendingArticles  {get;set;}

//Below query returns expected results from ProcessInstance
draftKBIds  = [select Id from ProcessInstance where TargetObjectId IN(select Id from Knowledge__KAV where PublishStatus='Draft')];
//Knowledge__KAV is the name of my Knowledge Base Object.
 pendingArticles  = [Select id, Title
                                from Knowledge__KAV ​where id IN: draftKBIds ];

The above highlighted query returns error: 

 Invalid bind expression type of ProcessInstance for Id field of SObject Knowledge__kav

Please suggest where I am going wrong. 
Hello All,

I want to know how to write Javascript in formula field. 
Something similar to this blog: https://sfdc-gyaan.rhcloud.com/2014/04/referencing-javascript-file-from-static-resources-in-formula-fields/

I have a formula field. When clicked on it, I want to perform an action using JS.
HYPERLINK("javascript:alert('Hello World! - Formula Field');var html_doc = document.getElementsByTagName('head')[0];var js = document.createElement('script');js.setAttribute('type','text/javascript');js.setAttribute('src','/resource/********/HelloJS');html_doc.appendChild(js);js.onload= function() { sayHelloFromAnotherJS(); }; ","_self")

And then, I get this error:

Error: Incorrect argument value for function 'HYPERLINK()'. Javascript is not allowed.
Can anyone help me here? 
Hello All, 
Below is my code to display details from an object. I am using "rendered" to render only when value  is not null. This code works fine. 
To show some spacing between rows, I am using <br/> after each outputText.

The problem is : If some value is null and its not rendered, still <br/> will be rendered and shows unwanted spacing between rows. 
I have added a screenshot of the sample format of UI which I am trying to achieve. 

<apex:dataTable value="{!Docs}" var="docs">
    <apex:column >
        <apex:outputText value="ID : {!docs.Id}" /><br /><br />
        <apex:outputText value="Title : {!docs.Title}"/><br /><br />
        <apex:outputText value="Article Body : {!docs.Body__c}"/> <br /><br />
        <apex:outputText value="Article Number :{!docs.Number}"/> <br />
    </apex:column>
</apex:dataTable>
User-added image


What I want to do : I want to display space between rows, without using <br/>

 
Hi All,
I am querying some data from custom object and this will be retrieved by semicolon seperated data. 
Below is my code:
public class CustomController {
public string prodNames  {get;set;} 
public CustomController()

qryProd = [ Select id ,ProdNames from ProdObj];  
}
if(qryProd<>null)
{
 prodNames      = qryProd[0].ProdNames;
}
}
}

In my VF Page:  
console.log('{!prodNames}') --->  This displays output as : Product1;Product2;Product45;Product49;

<apex:outputText style="font-weight:bold" value="All Product Names" /><br />
               <ul>               
               <li><apex:outputText value="{!prodNames }"/></li>             
              </ul>
 

I want to display this in a bullet list using <li> 
  • Product1
  • Product2
  • Product45
  • Product49
Can anyone help me here?

Thanks!

 
Hi All,
 
I am new to salesforce and I need help with the code which I have attempted.

I am trying to fetch some fields from Salesforce Knowledge Standard Object. 
I have created a Controller and below is my code:
public class KBController {

 public list<Knowledge__kav> KBArticles {get;set;}
 
 public KBController (ApexPages.StandardController StdCtrller){
 
 this.KBArticles = new list<Knowledge__kav>();
 
 KBArticles = [Select articleNumber, Title from Knowledge__kav where PublishStatus='Online'];  
 
 }
 }

Below is the code in my markup: 
<apex:page showHeader="false" sidebar="false" standardController="Knowledge__kav" extensions="KBController">
<apex:form >
<apex:pageBlock >
<apex:pageBlockTable value="{!KBArticles}" var="articles">
                <apex:column value="{!articles.articleNumber}"/> 
                <apex:column value="{!articles.Title}"/> 
</apex:pageBlockTable>
</apex:pageBlock>
</apex:form>
</apex:page>

With this code, I am getting an error: 
Id value null is not valid for the Knowledge__kav standard controller 

Could anyone please suggest me here?

Thanks!
 
 
Hi All,

I am trying to fetch knowledge articles in my VF Page.

Below is my code: 
<apex:page standardController="Knowledge__kav">
   <apex:form >
        <apex:pageBlock >
            <apex:pageBlockTable value="{!listOfArticles}" var="details">
                <apex:column value="{!details.articleNumber}"/> 
                <apex:column value="{!details.Title}"/> 
                <apex:column value="{!details.UrlName}"/> 
                </apex:pageBlockTable>
        </apex:pageBlock>
    </apex:form>
</apex:page>

I am getting below error: 
 
Error: Unknown property 'Knowledge__kavStandardController.listOfArticles'

Can anyone guide me where I am going wrong? 

Thanks!
Hi,

What are the options to Integrate Salesforce with As400 system?
 
  1. Real Time - Show Real time data in Salesforce but, do not actually store the data. Due to data storage concerns.
  2. Daily batch upload data in Salesforce
Are there any middleware applications that already do this?

Regards,
N