• Pedro Paiva
  • NEWBIE
  • 15 Points
  • Member since 2018

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 6
    Questions
  • 3
    Replies
It is possible to use the Role picklist values (which are dinamycally set by the user) from the OpportunityContactRole standard object in a new Custom Object ? I was thinking in having a custom object with a text field named: Role__c and in a Visualforce page having a SelectList with SelectOptions to use the picklist retrieving by the apex controller, but my list is blank:

This is my Apex Controller:
 
public class OppContactRoleController  {

	public List<OppContactRole__c> oppContactRoles {get; private set;}
	public List<SelectOption> pickListValuesList {get; set;}
	public String strSelected  {get;set;}

	public OppContactRoleController(ApexPages.StandardController stdController) {
		Id oppId = stdController.getId();
		strSelected = 'None';
        oppContactRoles = (oppId == null) ? new List<OppContactRole__c>() : 
            [SELECT Id, Role__c, isPrimary__c,Contact__c,Contact__r.Name,Opportunity__c FROM OppContactRole__c WHERE Opportunity__c = :oppId];
		List<SelectOption> pickListValuesList= new List<SelectOption>();
		Schema.DescribeFieldResult fieldResult = OpportunityContactRole.Role.getDescribe();
		List<Schema.PicklistEntry> ple = fieldResult.getPicklistValues();
		for( Schema.PicklistEntry pickListVal : ple){
			//pickListValuesList.add(pickListVal.getLabel());
			pickListValuesList.add( new SelectOption(pickListVal.getLabel(), pickListVal.getLabel()));
		}
		System.debug('[OppContactRoleController] :: pickListValuesList '+pickListValuesList);  
	}

	public List<SelectOption> getItems(){
		return this.pickListValuesList;
	}

	public PageReference customSave() {
		System.debug('[OppContactRoleController] :: custom saver');
		try {
            upsert(oppContactRoles);
        } catch(System.DMLException e) {
            ApexPages.addMessages(e);
            return null;
        }
        //  After successful Save, navigate to the default view page
        //PageReference redirectSuccess = new ApexPages.StandardController(Opportunity).view();
        return null;
	}

}

And this is my VF page:
 
<apex:page standardController="Opportunity"  extensions="OppContactRoleController">
    <apex:form >
        <apex:pageBlock >
            <apex:pageMessages />
            <apex:pageBlockButtons >
                <apex:commandButton value="Save" action="{!customSave}"/>
            </apex:pageBlockButtons>
            <apex:pageBlockTable value="{!oppContactRoles}" var="ocr">
                <apex:column value="{!ocr.Contact__r.Name}"/>
                <apex:column headerValue="Role">
                    <apex:selectList value="{!ocr.Role__c}">
                        <apex:selectOptions value="{!items}"/>
                    </apex:selectList>
                </apex:column>
                <apex:column headerValue="Primary">
                    <apex:inputField value="{!ocr.isPrimary__c}"/>
                </apex:column>
            </apex:pageBlockTable>      
        </apex:pageBlock>
    </apex:form>
</apex:page>
Is there a different way to do this and what i'm doing wrong here ? 

Thank for any help in advance.
 
Hi, i am struggling to properly show the modifiedTime got from the Google Drive API in a more human readable way.

My first tough was to first convert the field (modifiedTime) into DateTime object, but i am having issues with the format.

This is the date i am getting from the API : 2018-03-21T18:49:58.867Z  and i would like to show it in a more human readable way, maybe like this: 21 March 2018, 6:49 pm

I tried to do this: 
String modifiedTime = String.valueOf(mapResultFile.get('modifiedTime'));
Datetime dt = Datetime.parse(modifiedTime);

// OR

String format = 'yyyy-MM-dd\'T\'HH:mm:ss.SSS\'Z\'';
DateTime dt = new DateTime();
dt.format(format);
But without success, i searched if Apex has something like SimpleDateFormat like Java to try something like this, but couldn't find some good example of it in Apex.

Any help would be appreciate, thanks in advance.
 
Hello, 

I am trying to retrieve the Billing Document Line Items via SOQL to avoid calling the SOQL inside a loop.  But i cannot find a relationship field beetween Billing Document and Billing Document Line Item.

For Example: 
List<Id> listBillingDocumentIds = getTheIds();
List <fferpcore__BillingDocument__c> billingDocuments = new List<fferpcore__BillingDocument__c>([Select Id, Name , (Select Id, Name From fferpcore__BillingDocumentLineItem__c) From fferpcore__BillingDocument__c Where Id IN: listBillingDocumentIds]);

Please any help would be appreciate it.

Thanks in advance

 
Hi, i would like to know if i can use the google drive api through rest api integration using only a lightning component without a VF page.

I watched this video: https://www.youtube.com/watch?v=rPgH5bnIn7Y abd this https://www.youtube.com/watch?v=0gRS8JWKIFI abd both use a VF page for the redirect uri authorized in google api. But would i need to use the VF page or how can i put the redirect to be a record page (Accounts) because the URL change depending on the account record.

Thanks in advance, i will appreciate any help :)
I built a lightning component from where i call to a external URL using window.location.href = 'someurl'. But i don't know if that is a good practice in Salesforce Lightning Experience. I also tried with sforce but i would need to add it through connection.js and apex.js and from the lightning component itself i can't. (Sorry for my bad english, i am not a native english speaker)

Thanks in advance :)
Hello everyone, i would like to call the functionality of conga composer api (upload a template from my computer and merge create the pdf with contact object information) directly with the parameters &DS7=13 and using a local template, i was thinking of doing it as a button. But my problem is that i couldn't find much information about how to use the conga composer api in the official documentation. Could someone please provide me with some useful information on how to do that ? 

Thanks in advance.
Hello everyone, i would like to call the functionality of conga composer api (upload a template from my computer and merge create the pdf with contact object information) directly with the parameters &DS7=13 and using a local template, i was thinking of doing it as a button. But my problem is that i couldn't find much information about how to use the conga composer api in the official documentation. Could someone please provide me with some useful information on how to do that ? 

Thanks in advance.
Hi, i am struggling to properly show the modifiedTime got from the Google Drive API in a more human readable way.

My first tough was to first convert the field (modifiedTime) into DateTime object, but i am having issues with the format.

This is the date i am getting from the API : 2018-03-21T18:49:58.867Z  and i would like to show it in a more human readable way, maybe like this: 21 March 2018, 6:49 pm

I tried to do this: 
String modifiedTime = String.valueOf(mapResultFile.get('modifiedTime'));
Datetime dt = Datetime.parse(modifiedTime);

// OR

String format = 'yyyy-MM-dd\'T\'HH:mm:ss.SSS\'Z\'';
DateTime dt = new DateTime();
dt.format(format);
But without success, i searched if Apex has something like SimpleDateFormat like Java to try something like this, but couldn't find some good example of it in Apex.

Any help would be appreciate, thanks in advance.
 
Hi, i would like to know if i can use the google drive api through rest api integration using only a lightning component without a VF page.

I watched this video: https://www.youtube.com/watch?v=rPgH5bnIn7Y abd this https://www.youtube.com/watch?v=0gRS8JWKIFI abd both use a VF page for the redirect uri authorized in google api. But would i need to use the VF page or how can i put the redirect to be a record page (Accounts) because the URL change depending on the account record.

Thanks in advance, i will appreciate any help :)
Hello everyone, i would like to call the functionality of conga composer api (upload a template from my computer and merge create the pdf with contact object information) directly with the parameters &DS7=13 and using a local template, i was thinking of doing it as a button. But my problem is that i couldn't find much information about how to use the conga composer api in the official documentation. Could someone please provide me with some useful information on how to do that ? 

Thanks in advance.