• Ronen Slifkin
  • NEWBIE
  • 25 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 5
    Questions
  • 12
    Replies
Hello All ,  I know how to add a lightning component created via developer console to a VF page.

My question is , is there a way to a component created via Lightning App Builder to a VF Page ?

Thank you all

Hello all, 
I have a problem in a vf page that's reside in a Site.
in the page I'm adding a static resource

<apex:includeScript value="{!URLFOR($Resource.SiteEssentials)}" />

in this js  file I want to access controller vars like this

var a = {!randomNumber};

I'm getting an error when loading the page - Uncaught SyntaxError: Unexpected token ! in the js file

if I put the same line in the vf page itself , all is ok.

I hope someone can help me figure if this can be achived.

TIA
Ronen

 

Hello all

lets take this for example for a vf page 

apex:page standardController="Contact" extensions="vf_ContactsUpdateFieldSetsController" showHeader="false" sidebar="false"

 I want to be able to set the standartController with a changing value so this page would be dynamic and serve various objects.... and not just Contact

I also need to be able to use : contact = (Contact)controller.getRecord(); ----------> in a dynamic way so I can still can get the values from the screen
 

is there a way to achive that ? maybe by using only the extensions ? but how can I get the values of the fields in the screen ?

 

Any help or direction would be appriciated

background behind that need:
I would like to display a fieldset on that page , but the fieldset can be once from Contact , or any other Object.

 

 

TIA
 

I didn't copied all of the code of the trigger only the line that's doesn't get updated .. the task is created with all the data except WhoID.
In the debug maptoContact.get(t.WhatId) returns the Id of the wanted contact..

what is wrong here ?

trigger Task_BeforeInsertUpdateDelete on Task (before delete, before insert, before update)
{

trigger Task_BeforeInsertUpdateDelete on Task (before delete, before insert, before update)

{

 

    for(Task t : Trigger.new)

    {
           t.WhoId = maptoContact.get(t.WhatId);

    }
}

 

Describing the goal:
We have a need to send an email to an external email address (which we did) but we also wants salesforce to add a task for this action.

We managed to do this from a  send an email  button in the following way  (you can see in the image)


Screen after we pressed send an email button


The problem is that we can't reproduce this behavior with apex code.
we tried this with the code below : The Email sent but Task not created 

[ Please be advised - we do not want to use message.setTargetObjectId() becuase we don't want to send an email to the contact ]

List<string> toList = new List<string>();
Messaging.SingleEmailMessage message = new Messaging.SingleEmailMessage();
toList.add('any@external.email');
message.setUseSignature(false);
message.setSaveAsActivity(true);
message.setSubject('Any subject);
message.setHtmlBody('any Body');
message.setWhatId('00111000007dqTk'); //  THIS IS AN ID OF THE SIMPSON'S FAMILY
message.setToAddresses(toList);
Messaging.sendEmail(message);

Hello all, 
I have a problem in a vf page that's reside in a Site.
in the page I'm adding a static resource

<apex:includeScript value="{!URLFOR($Resource.SiteEssentials)}" />

in this js  file I want to access controller vars like this

var a = {!randomNumber};

I'm getting an error when loading the page - Uncaught SyntaxError: Unexpected token ! in the js file

if I put the same line in the vf page itself , all is ok.

I hope someone can help me figure if this can be achived.

TIA
Ronen

 

Hello all

lets take this for example for a vf page 

apex:page standardController="Contact" extensions="vf_ContactsUpdateFieldSetsController" showHeader="false" sidebar="false"

 I want to be able to set the standartController with a changing value so this page would be dynamic and serve various objects.... and not just Contact

I also need to be able to use : contact = (Contact)controller.getRecord(); ----------> in a dynamic way so I can still can get the values from the screen
 

is there a way to achive that ? maybe by using only the extensions ? but how can I get the values of the fields in the screen ?

 

Any help or direction would be appriciated

background behind that need:
I would like to display a fieldset on that page , but the fieldset can be once from Contact , or any other Object.

 

 

TIA
 

I didn't copied all of the code of the trigger only the line that's doesn't get updated .. the task is created with all the data except WhoID.
In the debug maptoContact.get(t.WhatId) returns the Id of the wanted contact..

what is wrong here ?

trigger Task_BeforeInsertUpdateDelete on Task (before delete, before insert, before update)
{

trigger Task_BeforeInsertUpdateDelete on Task (before delete, before insert, before update)

{

 

    for(Task t : Trigger.new)

    {
           t.WhoId = maptoContact.get(t.WhatId);

    }
}

 

Describing the goal:
We have a need to send an email to an external email address (which we did) but we also wants salesforce to add a task for this action.

We managed to do this from a  send an email  button in the following way  (you can see in the image)


Screen after we pressed send an email button


The problem is that we can't reproduce this behavior with apex code.
we tried this with the code below : The Email sent but Task not created 

[ Please be advised - we do not want to use message.setTargetObjectId() becuase we don't want to send an email to the contact ]

List<string> toList = new List<string>();
Messaging.SingleEmailMessage message = new Messaging.SingleEmailMessage();
toList.add('any@external.email');
message.setUseSignature(false);
message.setSaveAsActivity(true);
message.setSubject('Any subject);
message.setHtmlBody('any Body');
message.setWhatId('00111000007dqTk'); //  THIS IS AN ID OF THE SIMPSON'S FAMILY
message.setToAddresses(toList);
Messaging.sendEmail(message);