• Dominic Sebastian
  • NEWBIE
  • 10 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 8
    Questions
  • 4
    Replies
Hi I would like
ISSUES:

1.THe issue now is that it convert the id of the page to the required SOQL syntax.
2.Find a link to each of the object created.



// In the controller SafetyAuditController

  @RemoteAction

   global static string searchProject(string sSiteId){

       

       // id myId1 = UserInfor.getUserId();

       // system.debug(myId1);

         

        Site__c Site1 = [Select Id, Name , Project__c, Project__r.Name,Site_Master__r.Name, Site_Master__r.Id From Site__c where Site_Master__r.Id = :sSiteId LIMIT 4];

             
         
         

             

       

        return Site1.Project__r.Name; // here I am only displaying the name I must also                                                                     // display the id.

         

    }

// In the angular Javascript

// the app.service

 this.SearchProject = function(siteId){

            var deferred = $q.defer();

 

             

            Visualforce.remoting.Manager.invokeAction('SafetyAuditController.searchProject', siteId, function(retVal, e) {  

                $rootScope.$apply(function() {

                    deferred.resolve(retVal.lSite[0]);

                });

            }, {escape:true} );

 

            return deferred.promise;

        };

//the function  search Project

         var promiseProjects = SiteSvc.searchProject($scope.siteId);
        promiseProjects.then( function ProjectSearch(retVal){
            
            console.log(retVal);
            $scope.searchProj =[ { name : retval} ]
            
        });
 

// on the Visualforce page, which I should also display the id

   <div ng-controller = "ProjectSearch">
        <select ng-model = "Projectname">
            <option ng-repeat="Search in searchProj" > {{Search.name}}</option>
            
        </select>
            
        </div>
the Site Master object is the lookup relationship with the site object hence I need to fetch the site master id to process the query.
to display dynamically the drop down of the id and name in angular JS. Please let me know how here is the code.
Hi I would like to display dynamically the drop down of the id and name in angular JS. Please let me know how here is the code.
// In the controller SafetyAuditController
  @RemoteAction
    global static string searchProject(string sSiteId){
        
       // id myId1 = UserInfor.getUserId();
       // system.debug(myId1);
        
        Site__c Site1 = [Select Id, Name , Project__c, Project__r.Name,Site_Master__r.Name, Site_Master__r.Id From Site__c where Site_Master__r.Id = :sSiteId LIMIT 4];
            
        
        
            
      
        return Site1.Project__r.Name; // here I am only displaying the name I must also                                                                     // display the id.
        
    }
// In the angular Javascript 
// the app.service
 this.SearchProject = function(siteId){
            var deferred = $q.defer();

            
            Visualforce.remoting.Manager.invokeAction('SafetyAuditController.searchProject', siteId, function(retVal, e) {   
                $rootScope.$apply(function() {
                    deferred.resolve(retVal.lSite[0]);
                });
            }, {escape:true} );

            return deferred.promise;
        };
//the function  search Project

 var promiseProjects = SiteSvc.searchProject($scope.siteId);
        promiseProjects.then( function (retVal){
            
            console.log(retVal);
            $scope.searchProj =[ { name : retval} ]
            
        });

// on the Visualforce page, which I should also display the id
  <div ng-controller = "Ctrl_SafetyAuditSection">
                
               <p>
                    You have selected:{{searchProj}}
               </p>
               <div dropdown-select = "searchProj"
                    dropdown-model="searchProj"
                    dropdown-item-label="text">
                   
               </div>
        </div>
the Site Master object is the lookup relationship with the site object hence I need to fetch the site master id to process the query.

thanks

<apex:repeat>
<apex:pageBlockTable id="pbt" value="{!mapStateLicense}" var="key" styleClass="licenseTable" columnsWidth="55px,90px,110px,90px,157px,135px !important">
               <!-- <apex:commandButton value="Add licenses" action="{!insertStateRecords}" style="margin-left: 9px!important;margin-top: -50px !important;position: absolute;"/>-->
                <apex:column headerValue="State" value="{!mapStateLicense[key].locationState}" styleClass="stateHead" style="width:55px !important; text-align:center;"/>                
                <apex:column headerValue="License No.">
                    <apex:inputText value="{!mapStateLicense[key].licenseNo}" styleClass="inputLicenseNo" onchange="checkChange()" onClick="clearThis();" style="width:63px!important;text-align:center;"/>                </apex:column>
                <apex:column headerValue="Licensed Since">
                    <apex:inputText id="licenseSince" value="{!mapStateLicense[key].licensedSince}" styleClass="inputLicensedSince" onchange="checkChange()" onClick="clearThis();" onFocus="DatePicker.pickDate(true, this, false);" style="width:100px;text-align:center;"/>
                </apex:column>
                <apex:column headerValue="Expiration">
                    <apex:inputText id="expiration" value="{!mapStateLicense[key].expiration}" styleClass="inputExpiration" onchange="checkChange()" onClick="clearThis();" onFocus="DatePicker.pickDate(true, this, false);" style="width:68px!important;text-align:center;"/>
                </apex:column> 
                <apex:column headerValue="Type">
                    <apex:inputText title="{!mapStateLicense[key].type}" value="{!mapStateLicense[key].type}" styleClass="inputType" onchange="checkChange()" onClick="clearThis();" style="width:126px!important;text-align:center; display:inline; word-wrap:break-word!important;"/>
                </apex:column>
                <apex:column headerValue="YTD Contract Value Completed">
                    <apex:inputText value="{!mapStateLicense[key].ytdContact}" onchange="checkChange()" styleClass="inputYTDContact" onClick="clearThis();" style="width:115px!important;text-align:center;"/>
                </apex:column>                        
            </apex:pageBlockTable>
           <apex:messages id="apexError" styleClass="message" style="margin-bottom: -29px!important;"/>
            <div class="errorMessages" style="margin: 9px 0 -20px -7px!important;font-size: 12px !important;"> </div>
            <br/><br/>
            <apex:outputLabel value="Year Registered with Nexius" style="font-size: 13px;font-weight:bold;">
                <apex:inputText value="{!currentYear}" style="width: 45px !important;font-weight: bold;text-align: center;position: absolute\9;margin-top: -2px\9 !important; margin-left: 8px\9 !important;" disabled="true" size="4" onchange="checkChange()" onClick="clearThis();" />
            </apex:outputLabel>
            
           
            <apex:pageBlockTable value="{!mapPriorContracts}" var="key" id="contract" styleClass="priorContractTable" columnsWidth="100px,92px, 92px, 111px !important">
                <apex:column headerValue="Contract Value" value="{!mapPriorContracts[key].state}"/>
                <apex:column headerValue="YTD">
                    <apex:inputText value="{!mapPriorContracts[key].yearToDate}" styleClass="inputYTD" onchange="checkChange()" onClick="clearThis();" style="text-align:center; width:62px!important;"/>
                </apex:column>
                <apex:column headerValue="Last Year">
                    <apex:inputText id="lastYear" value="{!mapPriorContracts[key].lastYear}" styleClass="inputLastYr" onchange="checkChange()" onClick="clearThis();" style="text-align:center; width:59px!important;"/>
                </apex:column> 
                <apex:column headerValue="Two Years Ago">
                    <apex:inputText value="{!mapPriorContracts[key].twoYearsAgo}" styleClass="inputTwoYrsAgo" onchange="checkChange()" onClick="clearThis();" style="text-align:center; width:84px!important;"/>
                </apex:column>
                <apex:column headerValue="Work Description">
                    <apex:inputText title="{!mapPriorContracts[key].workDescription}" styleClass="inputDescription" onchange="checkChange()" onClick="clearThis();" value="{!mapPriorContracts[key].workDescription}" style="text-align:center; width:221px!important;" />
                </apex:column> 
            </apex:pageBlockTable>
</apex:repeat>
I need to create a button where in after clicking it the user can create an additional table.

Please help.
public String isNationwideProvider {get; set;}

public PageReference BankReference(){
          List<Account> lstSite1 = [SELECT Id, NationwideProvider__c FROM Account WHERE Id =:this.pathI];
     if(isNationwideProvider.equals('Yes')){ //ERROR IS HERE
            return gotoBankReference();
         //System.debug('error');
        }
        else if(isNationwideProvider.equals('No')){ //ERROR IS HERE
                 if (lstSite1.size() > 0){        

                return gotoBankReference();
                     }
              else{
                 ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.ERROR, 'Must upload a document');
                  ApexPages.addMessage(myMsg);
                System.debug('*** currentFile.Name.substringAfterLast ***'+ myMsg);
                 return null;
                }
                
             }
I get the following error Non-void method might not return a value or might have statement after a return statement. on the "//ERROR IS HERE"
please help me to solve this. Thanks.
trigger NegotiationDetails on NegotiationLogDetails__c (after insert) {

  Set<Id> NegotiationLogset = new Set<Id>();
  List<StatusLog__c> NegotiationLoglist = [Select Id, Original__c,Response__c,Final__c from StatusLog__c where  Id In : NegotiationLogset];

 
    for (NegotiationLogDetails__c  NegotiationLogDetalstrigger : trigger.new)
    {
     
      
        if(NegotiationLogDetalstrigger.IsFinal__c == true)
        {
          //StatusLog__c nl = nls.get(NegotiationLogDetalstrigger.Id);
      
          NegotiationLoglist.Original__c = NegotiationLogDetalstrigger.Original__c;
          NegotiationLoglist.Response__c = NegotiationLogDetalstrigger.Response__c;
          NegotiationLoglist.Final__c    = NegotiationLogDetalstrigger.Final__c;
     
   
       }
     //nls.add(nl);
    }
    // insert nl;

}
I have created certain records for the Object Popeye. 
The Records are getting displayed on the Salesforce page but not on the Site.com page.


   <apex:page controller="PopeyeController" showHeader="false">
<apex:sectionHeader title="Popeye Portal" />
<apex:outputLink value="{!$Site.Prefix}/secur/logout.jsp" >Logout</apex:outputLink>
    <p>
    Last updated date 12/17/2013
    </p>
     <apex:pageblock >
     <apex:pageMessages ></apex:pageMessages>
     </apex:pageblock>
<apex:repeat value="{!Quotelist1}" var="section">

    <h3>{!section.Name}</h3>
    <ul>
        <apex:repeat value="{!section.Items__r}" var="item">
        <li><a href="{!URLFOR($Page.PopeyePortalItem, null,[Id = item.Id])}">{!item.Name}</a></li>
        </apex:repeat>
    </ul>
  
</apex:repeat>

</apex:page>
While executing the login for a portal at Site.com. The login portal will reditrct to another page. The problem that I am dealing with is that, the page to which it's redirected needs the User. Id in order for it to process.  I have used the "ApexPages.currentPage().getParameters().get('Id')". In order to fetch it. But somehow, it'snot working.

global class SiteMiniMouseController{
    global String username {get; set;}
    global String password {get; set;}

    global PageReference login() {       
        String startUrl = System.currentPageReference().getParameters().get('start');
       String PageId= UserInfo.getUserId() ;
  
        String pageUrl = '/apex/MickeyMouse?id=PageId';
               
        if (startURL != '' && startUrl != NULL && startUrl != 'null') {
             pageUrl = startUrl;
            // pageUrL = PageId;
        }
       
        System.debug('pageURL: ' + pageURL);
       
        PageReference page =  Site.login(username, password, pageUrl);
        if (page == null ) {
            System.debug('Invalid username or password!');
        }
        return page;
    }
    global SiteMiniMouseController(){}
}
I have created the VF and the apex page. However, based on thr link https://developer.salesforce.com/forums/ForumsMain?id=906F0000000AbeXIAS
I cannot give a homepage component because, It won't allow me to write a javascript on the HTML area at the home page component. I created a VF page with the javescript added to it. I would like to know if there is a way to override the accept/reject layout. 
While executing the login for a portal at Site.com. The login portal will reditrct to another page. The problem that I am dealing with is that, the page to which it's redirected needs the User. Id in order for it to process.  I have used the "ApexPages.currentPage().getParameters().get('Id')". In order to fetch it. But somehow, it'snot working.

global class SiteMiniMouseController{
    global String username {get; set;}
    global String password {get; set;}

    global PageReference login() {       
        String startUrl = System.currentPageReference().getParameters().get('start');
       String PageId= UserInfo.getUserId() ;
  
        String pageUrl = '/apex/MickeyMouse?id=PageId';
               
        if (startURL != '' && startUrl != NULL && startUrl != 'null') {
             pageUrl = startUrl;
            // pageUrL = PageId;
        }
       
        System.debug('pageURL: ' + pageURL);
       
        PageReference page =  Site.login(username, password, pageUrl);
        if (page == null ) {
            System.debug('Invalid username or password!');
        }
        return page;
    }
    global SiteMiniMouseController(){}
}