• Kevin Kim 9
  • NEWBIE
  • 20 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 9
    Questions
  • 14
    Replies
I am currently trying to get a field (picklist) from one record in opportunities and make whatever the user picks as the default value for another field in accounts. Is this possible and if it is, what is the best way to do so? 
I want to let users add values to the picklist if it is not already on there by choosing an "other" option. New to VF and Apex and need help.
I am looking to build a dynamic picklist where users can add a field when they click the "Other" option instead of the admin going back to set the picklist values. 
We are trying to expedite our project processes. Each project has a couple different tasks associated with it so we thought having a barcode associated with each task so all we have to do is scan the barcode to log time spent, instead of our employees having to login and manually put in all their hours. Any thoughts?
global class shipmentHandler{
    webservice static void copyPPtoSP(String strRecId){
        list<Shipment_Product__c> lstSP = new list <Shipment_Product__c>();

        List<ProjectProduct__c> lstPP = [Select Id
        , Quantity__c
        , Line_Description__c
        , List_Price__c
        , Product__c
        , Sales_Price__c
        , Total_Price__c
        , Unit__c
        , Project__c
        from ProjectProduct__c
        where Project__c =: strRecId];

        if(lstPP != null && !lstPP.isEmpty()){
            Shipment__c objShipment = new Shipment__c();
            objShipment.Name = lstPP[0].Project_r.Name;
            objShipment.Project__c = lstPP[0].Project__c;
            insert objShipment;

            for(ProjectProduct__c objO : lstPP){
                Shipment_Product__c objProd = new Shipment_Product__c();
                objProd.Name = objO.Name;
                objProd.Product__c = objO.Product__c;
                objProd.List_Price__c = objO.List_Price__c;
                objProd.Sales_Price__c = objO.Sales_Price__c;
                objProd.Quantity__c = objO.Quantity__c;
                objProd.Line_Description__c = objO.Line_Description__c;
                objProd.Unit__c = objO.Unit__c;
                objProd.ShipmentLookup__c = objShipment.Id;
                lstSP.add(objProd);
            }
        }
        if(!lstSP.isEmpty()){
            insert lstSP;
        }
    }
}
I'm basically trying to copy over the project products to the shipment custom object I made. They will be stored in Shipment products. But I keep getting an error: 

"No such column 'Project__c' on entity 'ProjectProduct__c'. If you are attempting to use a custom field, be sure to append the '__c' after the custom field name. Please reference your WSDL or the describe call for the appropriate names."

Need help. Please.
 
I want to copy over field values from my opportunites (both standard and custom). How can I do that using apex? Or would it be easier to use a flow? 
I've created a button with this java script:
{!REQUIRESCRIPT("/soap/ajax/30.0/connection.js")} 
{!REQUIRESCRIPT("/soap/ajax/30.0/apex.js")} 
sforce.apex.execute("buttonHandler","copyOLItoPP",{id:"{!Opportunity.Id}"}); 
location.reload();

but I keep getting this error whenever I try to click it:
{faultcode:'soapenv:Client; faultstring:'No such parameter id defined for operation. please check the WSDL for the service.'}
I am trying to copy over my opportunity products to a custom object (projects) by clicking a button. What does the code look like for that? I am very new to salesforce apex coding. 
I was wondering if anyone had any previously done apex code that works already and I can try to implement it. If not, if you could send me in the right direction when it comes to writing apex code to do this. Thanks.
We are trying to expedite our project processes. Each project has a couple different tasks associated with it so we thought having a barcode associated with each task so all we have to do is scan the barcode to log time spent, instead of our employees having to login and manually put in all their hours. Any thoughts?
I am looking to build a dynamic picklist where users can add a field when they click the "Other" option instead of the admin going back to set the picklist values. 
We are trying to expedite our project processes. Each project has a couple different tasks associated with it so we thought having a barcode associated with each task so all we have to do is scan the barcode to log time spent, instead of our employees having to login and manually put in all their hours. Any thoughts?
I've created a button with this java script:
{!REQUIRESCRIPT("/soap/ajax/30.0/connection.js")} 
{!REQUIRESCRIPT("/soap/ajax/30.0/apex.js")} 
sforce.apex.execute("buttonHandler","copyOLItoPP",{id:"{!Opportunity.Id}"}); 
location.reload();

but I keep getting this error whenever I try to click it:
{faultcode:'soapenv:Client; faultstring:'No such parameter id defined for operation. please check the WSDL for the service.'}
I am trying to copy over my opportunity products to a custom object (projects) by clicking a button. What does the code look like for that? I am very new to salesforce apex coding.