• cjcindc
  • NEWBIE
  • 0 Points
  • Member since 2013

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 1
    Replies
I have a visualforce page with an html form.  The form is a post method, has 2 hidden inputs and is targeted to an apex:iframe.  I can't figure out how to get the form to auto-post to eliminate an extra click (submit button) for my users.  The <body onload> does not appear to be working. I'm probably doing it all wrong.  Thanks in advance for your thoughts/input.

<apex:page controller="myController" tabStyle="Contact" showHeader="true" sidebar="true" >
    <html >
        <body onload="document.myForm.submit()" >
            <form action="{!sessionLink}"  method="post" id="myForm" name="myForm" target="myFrame" >
                <input type="hidden" name="X-BEARER-TOKEN" value="{!bearerToken}" />
                <input type="hidden" name="X-REFRESH-TOKEN" value="{!refreshToken}" />
                <center ><input type="submit" name="submit" value="initiate {!vendor} session" /></center>
            </form>
        </body>
    </html>

Hi,

 

I have an inherited trigger in which I want to conditionally set the subject of a new task depending the value of a picklist field.  For some reason the trigger cannot read the picklist value... it's not blank, and never is, it actually has a default value.  Below is the significant snippet of the trigger.  The troublesome picklist field is name Initial_Lead_Type__c.  When I try to set my task subject directly to the picklist value, it ends up blank.  Any ideas?  Thanks in Advance.

 

trigger GuestCard_Sharing on Guest_Card__c (before insert, before update, after insert, after update)
{
if (Trigger.IsAfter)
{
.
.
.
if (Trigger.IsInsert)
{
Id leadrtid = [select id from Recordtype where SObjectType = 'Task' and Name = 'Pilot Lead Process' limit 1].id;
list<Task> newtasks = new list<Task>();
for (Guest_Card__c gc : Trigger.new)
{
//Only create Task for non-Leased GCs owned by real Users
if ((gc.Status__c != 'Leased')
&& (gc.Initial_Lead_Type__c != 'Email')
&& (((String)gc.OwnerId).substring(0,3) == '005'))
{
newtasks.add(new Task(
OwnerId = gc.OwnerId,
RecordtypeId = leadrtid,
AVB_Type__c = 'Lead Pursuit Process',

Subject_Sub_Category__c = gc.Initial_Lead_Type__c,

ActivityDate = system.today(),
AVB_Associate_First_Last_Name__c = gc.AVB_Associate__c,
WhatId = gc.Id
));
}
} //end for gc : trigger.new

if (newtasks.size() > 0)
insert newtasks;
}
.
.
.
}

 

I have a visualforce page with an html form.  The form is a post method, has 2 hidden inputs and is targeted to an apex:iframe.  I can't figure out how to get the form to auto-post to eliminate an extra click (submit button) for my users.  The <body onload> does not appear to be working. I'm probably doing it all wrong.  Thanks in advance for your thoughts/input.

<apex:page controller="myController" tabStyle="Contact" showHeader="true" sidebar="true" >
    <html >
        <body onload="document.myForm.submit()" >
            <form action="{!sessionLink}"  method="post" id="myForm" name="myForm" target="myFrame" >
                <input type="hidden" name="X-BEARER-TOKEN" value="{!bearerToken}" />
                <input type="hidden" name="X-REFRESH-TOKEN" value="{!refreshToken}" />
                <center ><input type="submit" name="submit" value="initiate {!vendor} session" /></center>
            </form>
        </body>
    </html>