• Dhruv Khattar 8
  • NEWBIE
  • 25 Points
  • Member since 2017

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

I'm creating a REST API that an external system needs to post notifications to.

The notifications contain some sensitive data so it would like to authenticate to the REST API but their system can only handle basic authentication using a username and password... no handshakes, no requesting/storing/exchanging of tokens and not even a Client ID and Password. (That is the authentication mechanism that I use to post requests to their system as well).

Is there any means to do that with Salesforce? Publicly exposed API is not an option, nor is username-password based oAuth2. Any reasonable workarounds?

Thanks y'all!

I want to create a schedulable APEX class that fetches data from an external system using their REST API. For the other system, the developer needs to create an app, and enter an authorized URL for my "app".

How does one get a URL to my Apex class that his app can redirect to?

Thanks for your help!

1. I created a visualforce page
2. I created a component to contain some logic
3. I created a wrapper class to contain an instance of object and some related attributes, so that I could fetch and print a list of those objects in a dataTable/apex:repeat

Then, within the visualforce component:
4. I created a checkbox to rerender the page
5. Based on the selected value, it shows/hides the column containing the <apex:input> tag that references an integer attribute within the wrapper class

Behavior:
On checking/unchecking the checkbox, the presence of the <apex:input> tag referencing a wrapper class member causes the visualforce to crash

The same situation doesn't arise if the <apex:input> exists within the page itself, or if the <apex:input> is replaced with <apex:inputText>

Code sample available here: http://sfdummy.blogspot.com/2017/01/apexinput-in-visualforce-components.html

Appreciate any thoughts!

I want to create a schedulable APEX class that fetches data from an external system using their REST API. For the other system, the developer needs to create an app, and enter an authorized URL for my "app".

How does one get a URL to my Apex class that his app can redirect to?

Thanks for your help!

1. I created a visualforce page
2. I created a component to contain some logic
3. I created a wrapper class to contain an instance of object and some related attributes, so that I could fetch and print a list of those objects in a dataTable/apex:repeat

Then, within the visualforce component:
4. I created a checkbox to rerender the page
5. Based on the selected value, it shows/hides the column containing the <apex:input> tag that references an integer attribute within the wrapper class

Behavior:
On checking/unchecking the checkbox, the presence of the <apex:input> tag referencing a wrapper class member causes the visualforce to crash

The same situation doesn't arise if the <apex:input> exists within the page itself, or if the <apex:input> is replaced with <apex:inputText>

Code sample available here: http://sfdummy.blogspot.com/2017/01/apexinput-in-visualforce-components.html

Appreciate any thoughts!

Currently I have a working page which lists items from one object.  I am trying to update this to group by two objects.  Details below:

 

 

Current APEX class code:

 

public class projectTracking
{
  private List<Project_Billing_Item__c> projects;
  public List<Project_Billing_Item__c> getProjects()

    {
      projects = [ SELECT Project__c, Name, Employee__c, Description_of_Work__c,   Hours_Worked__c, Date__c 
						FROM Project_Billing_Item__c 
							WHERE Employee__c = :Userinfo.getUserId()  
            ];
			
      return projects;
    }
}


Current VisualFoce code:

 

<apex:page controller="projectTracking" showHeader="true" renderAs="html">

<apex:sectionHeader title="My Projects" subtitle="{!$User.FirstName} {!$User.LastName}"/>
<p/>

<apex:form >
<apex:pageBlock title="List of current billing items" id="pageBlock">
<apex:pageMessages ></apex:pageMessages>
<apex:pageBlockTable value="{!projects}" var="proj" rendered="{!NOT(ISNULL(projects))}">
<apex:column value="{!proj.Project__c}"></apex:column>
<apex:column value="{!proj.Name}"></apex:column>
<apex:column value="{!proj.Description_of_Work__c}"></apex:column>
<apex:column value="{!proj.Hours_Worked__c}"></apex:column>
<apex:column value="{!proj.Date__c}"></apex:column>
</apex:pageBlockTable>
</apex:pageBlock>
</apex:form>

</apex:page>

 

Produces the following rendered VisualForce page:

 

VisualForcePage

 

 

What I am trying to do now is group all the Project Billing Items by Project on the VisualForce page.  Currently I have updated the APEX class with the correct SOQL Query w/ Left Outer Join to group the results accordingly.  APEX class code below:

 

 

 

public class projectTracking
{
  private List<Project_Billing_Item__c> projects;
  public List<Project_Billing_Item__c> getProjects()

    {
      projects = [ SELECT Name, 
					(SELECT Project__c, Name, Employee__c, Description_of_Work__c, Hours_Worked__c, Date__c 
							FROM Project_Billing_Items__r 
									WHERE Employee__c = :Userinfo.getUserId()) 
					FROM Project__c
            ];
			
      return projects;
    }
}

 

I am not sure where to start with the VisualForce code though.  How do I update that to reference the List which is referencing two custom objects?   Thanks for the help and let me know if I can provide any additional information!