• AK_Smith
  • NEWBIE
  • 75 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 33
    Questions
  • 41
    Replies
Hello! I need and advice. 
According to our users, we have some draining battery issues on our iPads. 
After we switched to the Salesforce mobile battery discharges faster (30% - 50% faster).
I have a feeling that it could be because we have 2 lightning pages full of LWC. We even tried to hide them and users reported that subjectively battery discharges slower.

Could it be something in our code? 
Hi!
I have aura component 
<aura:component  implements="flexipage:availableForRecordHome,force:hasRecordId,lightning:actionOverride" access="global">
    
    <aura:attribute name="PATEST" type="CTPHARMA__Activity__c" />
    <aura:handler name="init" value="{!this}" action="{!c.init}" />  
     <div style="background-color:white">
    <lightning:flow aura:id="PATEST" onstatuschange="{!c.gotoURL}"/>
    </div>
</aura:component>

and controller 
({
    init : function (component) {
        // Find the component whose aura:id is "flowData"
        var flow = component.find("PATEST");
        // In that component, start your flow. Reference the flow's Unique Name.
        flow.startFlow("PATEST");
    },
gotoURL : function (component, event, helper) {
         if(event.getParam("status") === "FINISHED") {
      var outputVariables = event.getParam("outputVariables");
      var outputVar;
      for(var i = 0; i < outputVariables.length; i++) {
         outputVar = outputVariables[i];
         if(outputVar.name === "redirect") {
            var urlEvent = $A.get("e.force:navigateToSObject");
            urlEvent.setParams({
               "recordId": outputVar.value,
               "isredirect": "true"
            });
            urlEvent.fire();
         }}}}
})

onstatuschange="{!c.gotoURL}" works perfectly fine inside desktop Salesforce but on mobile, it is not. It just returns to the first screen of the flow.
Is there any way to redirect to the created with the flow record inside the mobile app?
Hello! 
We want to display a list of birthdays to the lightning home page. 
I think I need to use the VF page.
Need to display user photo, name, date

And I need to filter only users with birthdays in the next 5 days
Hello!
We need to send an outlook appointment when a record is created using the record fields as values for text header and dates of the appointment

Is there any solution or existing app for that? 
Hello!
I have 2 objects PA__c and journal__c

I need to create a new record on object stat__c and write results to the fields.

stat__c .Field1__c. If there any journal__c created within 30 min after first PA__c (datetime field Start_date__c) than Field1__c = yes
stat__c .Field2__c. If there any journal__c created within 8 hours  after last PA__c (datetime field Start_date__c) than Field2__c = yes

The trigger should be schedulable 
Hi! 
Is there any way to automatically post to chatter message on the weekly basis with the list of users who have birthdays this week (name and date)? 
Hello! 
I need to show on the VF page (table) results of the 3 SOQL requests:

I have 2 objects: Users and related SyncLog__c

I need to see on the table
First column: Users list
Second column: Is there records created before 10 AM YES/NO
Third column: Is there records created after 6 PM YES/NO



 
Hi!
Today I found the Trailbed Early Adopter badge on my page.
How did I get it and цhat other types exist?
Hello!
I need to create a button that will update checkbox IsTarget__c on Contact if OwnerId = User.Id
Hello! 
Please help me with my VF page.
i need to update <p> from the CTPHARMA__Activity__c.SF1_Status__c (text formula) until y < 6 && z && u != "Win32" returns true
 
<apex:page standardController="CTPHARMA__Activity__c" id="page" docType="html-5.0">
<style>
.good{
text-align:center;
background-color: MediumSeaGreen;
font-weight: bold;
color: white;
}
.bad{
text-align:center;
background-color: Tomato;
font-weight: bold;
color: white;
}

.ugly{
text-align:center;
background-color: LightGray;
}


</style>
  
    <apex:form styleClass="{!if(CTPHARMA__Activity__c.SF1_Status__c == 'Подтвержден территориально','good',if(CTPHARMA__Activity__c.SF1_Status__c == 'Не подтвержден территориально','bad','ugly'))} ">

<p id="text"></p>

    </apex:form>
    
    
    <script>
    myFunction();
    function myFunction(){
    var x = {!CTPHARMA__Activity__c.SF1_Status__c};
    var y = {!CTPHARMA__Activity__c.SF1_Attempts__c};
    var z = {!CTPHARMA__Activity__c.SF1_Request_geo__c};
    var u = window.navigator.platform;
    
    do{
    
    document.getElementById("text").innerHTML = x;
     } 
     while (y < 6 && z && u != "Win32")
     }
     
    </script>
 
</apex:page>

 
Hello i need only to reload frame with VF page.
I use <apex:commandButton value="Check" id="checkBtn" oncomplete="window.location.reload( true );"/>, but it reloads parrent page inside the visual forece page, how to fix it?
How to reload/rerender VF Page frame by if condition. 
If CTPHARMA__Activity__c.SF1_Status__c contains ‘in progress ’ than refresh page else do nothing 
 
​<apex:page standardController="CTPHARMA__Activity__c" id="page" docType="html-5.0">
<style>
.good{
text-align:center;
background-color: MediumSeaGreen;
font-weight: bold;
color: white;
}
.bad{
text-align:center;
background-color: Tomato;
font-weight: bold;
color: white;
}

.ugly{
text-align:center;
background-color: LightGray;
}


</style>
  
    <apex:form styleClass="{!if(CTPHARMA__Activity__c.SF1_Status__c == 'Подтвержден территориально','good',if(CTPHARMA__Activity__c.SF1_Status__c == 'Не подтвержден территориально','bad','ugly'))} ">
<apex:outputText value="{!CTPHARMA__Activity__c.SF1_Status__c}" />
    </apex:form>
</apex:page>



 
Hello!
Is it possible to align text in the middle of VF page frame in SF1?  If my frame is to narrow  i get result like on the screen (green stripe)

Is it possible to align it on top of the frame?
User-added image
 
<apex:page standardController="CTPHARMA__Activity__c" id="page" docType="html-5.0">
<style>
.good{
text-align:center;
background-color: MediumSeaGreen;
font-weight: bold;
color: white;
}
.bad{
text-align:center;
background-color: Tomato;
font-weight: bold;
color: white;
}

.ugly{
text-align:center;
background-color: LightGray;
}


</style>
  
    <apex:form styleClass="{!if(CTPHARMA__Activity__c.SF1_Status__c == 'Подтвержден территориально','good',if(CTPHARMA__Activity__c.SF1_Status__c == 'Не подтвержден территориально','bad','ugly'))} ">
<apex:outputText value="{!CTPHARMA__Activity__c.SF1_Status__c}" />
    </apex:form>
</apex:page>




 
Hello! Please hellp me to fix my code to get user agent 
 
<apex:page standardController="CTPHARMA__Activity__c" id="page">

<script>
agent()
function agent() {
    var u = window.navigator.userAgent;
       document.getElementById('page:form:A').value  = 1;
       }
</script>




<apex:form id="form" >

<apex:inputField id="A"  value="{!CTPHARMA__Activity__c.SF1_UA__c}" /> 

</apex:form>



</apex:page>

 
Hello!
Is it possible to show force:showToast alert on VF page with only javascript?
Hello!
Is it possibe to send toast message in SF1 from visualforce page using Script? 
Hello!
Is it possible to use standart alerts like on screen below from the Visualforce page in SF1? 

User-added image
Hello! I trying to add +1 to field with the code below. But did not succeed
 
<script>
       plus()
        var a = {!Activity__c.SF1_Attempts__c};
        function plus(){
        document.getElementById('page:form:Attempts').value = a + 1;
        }

</script>


Attempts : <apex:inputField id="Attempts" value="{!Activity__c.SF1_Attempts__c}" />

 
Hello! how to run skript only if checkbox Project__c.check__c is checked
 
<script>
        var int=self.setInterval(function(){callActionFunction()},200);
        function callActionFunction(){
            ActionFunctionName();
        }

</script>

 
Hello! I have a problem with the visualforce page below. I use it in the Salesforce1. After the action="{!save}" VF page closes but the parent page stays the same with the olв values. How to re render/reload it automatically?
 
<apex:page standardController="Project__c" id="page" docType="html-5.0">
<script>
geoFindMe()
function geoFindMe() {
  var output = document.getElementById("out");

  if (!navigator.geolocation){
    output.innerHTML = "<p>Geolocation is not supported by your browser</p>";
    return;
  }

  function success(position) {
    var latitude  = position.coords.latitude;
    var longitude = position.coords.longitude;

    document.getElementById('page:form:lati').value = latitude.toString().replace(".",",")  ;
    document.getElementById('page:form:long').value = longitude.toString().replace(".",",")  ; 
    document.getElementById('page:form:SF1').checked = true;

   
  };

  function error() {
    output.innerHTML = "Unable to retrieve your location";
  };

  navigator.geolocation.getCurrentPosition(success, error);
}
</script>

<script>
function reload(){
sforce.one.back(true);
}
</script>

   <script>
        var int=self.setTimeout(function(){callActionFunction()},200);
        function callActionFunction(){
            ActionFunctionName();
        }

</script>

<apex:form id="form">

  <div style="display:none;"></div>
latitude :<apex:inputField id="lati"  value="{!Project__c.l__c}" /> <br></br>
longitude :<apex:inputField id="long" value="{!Project__c.ll__c}" />
<apex:inputField id="SF1" value="{!Project__c.SF1__c}" />

        <apex:actionFunction action="{!save}" name="ActionFunctionName"/>
                     
                     
                     
</apex:form>

</apex:page>

 
Hello! I need and advice. 
According to our users, we have some draining battery issues on our iPads. 
After we switched to the Salesforce mobile battery discharges faster (30% - 50% faster).
I have a feeling that it could be because we have 2 lightning pages full of LWC. We even tried to hide them and users reported that subjectively battery discharges slower.

Could it be something in our code? 
Hello!
We need to send an outlook appointment when a record is created using the record fields as values for text header and dates of the appointment

Is there any solution or existing app for that? 
Hi! 
Is there any way to automatically post to chatter message on the weekly basis with the list of users who have birthdays this week (name and date)? 
Hello!
I need to create a button that will update checkbox IsTarget__c on Contact if OwnerId = User.Id
Hello! 
Please help me with my VF page.
i need to update <p> from the CTPHARMA__Activity__c.SF1_Status__c (text formula) until y < 6 && z && u != "Win32" returns true
 
<apex:page standardController="CTPHARMA__Activity__c" id="page" docType="html-5.0">
<style>
.good{
text-align:center;
background-color: MediumSeaGreen;
font-weight: bold;
color: white;
}
.bad{
text-align:center;
background-color: Tomato;
font-weight: bold;
color: white;
}

.ugly{
text-align:center;
background-color: LightGray;
}


</style>
  
    <apex:form styleClass="{!if(CTPHARMA__Activity__c.SF1_Status__c == 'Подтвержден территориально','good',if(CTPHARMA__Activity__c.SF1_Status__c == 'Не подтвержден территориально','bad','ugly'))} ">

<p id="text"></p>

    </apex:form>
    
    
    <script>
    myFunction();
    function myFunction(){
    var x = {!CTPHARMA__Activity__c.SF1_Status__c};
    var y = {!CTPHARMA__Activity__c.SF1_Attempts__c};
    var z = {!CTPHARMA__Activity__c.SF1_Request_geo__c};
    var u = window.navigator.platform;
    
    do{
    
    document.getElementById("text").innerHTML = x;
     } 
     while (y < 6 && z && u != "Win32")
     }
     
    </script>
 
</apex:page>

 
Hello! Please hellp me to fix my code to get user agent 
 
<apex:page standardController="CTPHARMA__Activity__c" id="page">

<script>
agent()
function agent() {
    var u = window.navigator.userAgent;
       document.getElementById('page:form:A').value  = 1;
       }
</script>




<apex:form id="form" >

<apex:inputField id="A"  value="{!CTPHARMA__Activity__c.SF1_UA__c}" /> 

</apex:form>



</apex:page>

 
Hello!
Is it possible to show force:showToast alert on VF page with only javascript?
Hello!
Is it possibe to send toast message in SF1 from visualforce page using Script?