function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Marco antonio Vidal RamosMarco antonio Vidal Ramos 

Hello friends I'm new to Salesforce and as a tego developer I doubt, How can I fill out a form in VF from FOR

I want to show the information I get from the for but I do not know how to display it on a visualforce page, thank you for your prompt response and help friends. 

    public void VisualDatos(){
               for (Producto_de_Promociones__c ProdProm : [SELECT Promocion__r.Id, Promocion__r.Name, Promocion__r.Vigencia_Desde__c, Promocion__r.Vigencia_Hasta__c, 
                                        Promocion__r.Canal__c, NOMBRE_DE_PRODUCTO_BASE__C, ESTATUS__C, NOMBRE_PRODUCTO_PROMOCIONAL__C, PROMOCION__C, Name,     Cajas_de_promocion__c, Rango__c,
                                        Nombre_de_producto_Base__r.Name, Nombre_de_producto_Base__r.ProductCode
                                        FROM Producto_de_Promociones__c
                                        Where  ESTATUS__C = 'Activo'
                                        And Promocion__r.Vigencia_Desde__c <= TODAY and Promocion__r.Vigencia_Hasta__c >= TODAY]){
                                            
           for(OpportunityLineItem op : [Select id, name, PricebookEntryId, Quantity, Producto_Promocional__c From OpportunityLineItem where OpportunityId = '00641000009Pquj' and Productcode = :ProdProm.Nombre_de_producto_Base__r.ProductCode]){
                        OpportunityLineItem  rLine = new OpportunityLineItem (
                           Producto_Promocional__c = true,
                        TotalPrice = Decimal.valueOf('00.00'),
                        Quantity = ProdProm.Rango__c*op.Quantity,
                        PriceBookEntryId = op.PricebookEntryId,
                        OpportunityID = '00641000009Pquj');
                        Insert rLine;
           }
       }//Fin del For producto de PRomociones        

    }
Alba RivasAlba Rivas
Hi Marco Antonio,

If you want to show a list of products, maybe the standard listview could do the work for you. I notice that here you are inserting some opportunity lines too, maybe a visualforce page for doing that task is what you are looking for?

It seems you are spanish, same as me. Feel free to contact me on my email and I can kindly help you with this.

alba.azconarivas@gmail.com

Regards.