• sweta singh 58
  • NEWBIE
  • 0 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 2
    Likes Given
  • 4
    Questions
  • 4
    Replies
Hi All,
Is there a way to trim and get the browser, so that to stamp it on User object.

Using 'LoginFlow_UserAgent' variable of Login Flow :- I am getting a Browser String. But end goal is to check if the browser used is 'Edge version 77' or greater. I know using "Contains" I can check which browser used . But in order to stamp it to a custom Browser field on User, I would need to Trim it and the browser string is not consistent.

I am getting below using different browsers:- 

Edge - Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.87 Safari/537.36 Edg/80.0.361.48

Chrome - Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.116 Safari/537.36

IE - Mozilla/5.0 (Windows NT 6.3; WOW64; Trident/7.0; rv:11.0) like Gecko

Thanks,
Sweta
Hi, sorry if this is a stupid/repetitive question, but I am unable to find appropriate solution for this. 

I need to skip all the validations on save command button  but
html-novalidate="true"
html-novalidate=”novalidate” at form level or button level does not work.
Also, immediate="true" at command button level is not working.

I also referred to - Nothing works :(
https://wdcigroup.net/salesforce-visualforce-commandbutton-to-bypass-validationrequired-fields/
https://www.biswajeetsamal.com/blog/immediate-true-is-not-working-on-custom-buttons-with-html5-doctype-in-visualforce-page/

<apex:page standardController="opportunityLineItem"  extensions="opportunityassetcontroller"  id="page1" tabstyle="opportunitylineitem"  sidebar="TRUE" lightningStylesheets="true" docType="html-5.0">
    <apex:slds /> 
    <body class = "slds-scope">
        <apex:form html-novalidate="novalidate"  >
            <apex:pageMessages />
            <apex:pageBlock id="block0" rendered="{!if(NoSubstituteOLIAvail,true,false)}">
                <div align="center" draggable="false">
                <apex:commandButton value="Close" styleclass="slds-button slds-button--brand" action="{!Close}" immediate="true"/>
                    </div>
                </apex:pageBlock>
            <apex:pageBlock id="block1" title="Details" rendered="{!if(NoSubstituteOLIAvail,false,true)}">
                <apex:pageBlockButtons location="bottom">
                    <apex:commandButton value="Close" styleclass="slds-button slds-button--brand"  action="{!Close}" />
                    <apex:commandButton value="Search" styleclass="slds-button slds-button--brand" action="{!getOliDetails}" />
                </apex:pageBlockButtons>
                <apex:pageBlockSection columns="2" id="sec1" title="Opportunity Information" collapsible="false">
                    <apex:inputField value="{!newopptyLineItem.opportunityid}" />
                </apex:pageBlockSection>
            </apex:pageBlock>
            <br/>
            <br/>
            <apex:pageBlock id="block2" title="Opportunity Product Details" rendered="{!getolidetails}" >
                <apex:pageBlockButtons location="bottom">
                    <apex:commandButton value="Save" styleclass="slds-button slds-button--brand"  action="{!doSave}" />
                    <apex:commandButton value="Cancel" styleclass="slds-button slds-button--brand" action="{!Close}" immediate="true"/>
                </apex:pageBlockButtons>
                <apex:pageblockTable value="{!wrapperSelectedOli}" var="wrap" rendered="{!getolidetails}" id="alloli"  >   
                    <apex:variable value="{!0}" var="cnt"/> 
                    <apex:column headerValue="Select">
                        <apex:outputPanel rendered="{!wrap.isSelected}">
                            <input type="radio" checked="true"/>
                        </apex:outputPanel>
                        <apex:outputPanel rendered="{!NOT(wrap.isSelected)}" >
                            <apex:actionSupport action="{!selectOli}" event="onclick" reRender="alloli" >
                                <input type ="radio"/>
                                <apex:param name="index" value="{!cnt}"/>
                                <apex:param name="olid"  value="{!wrap.Oliselect.id}"/>
                            </apex:actionSupport>
                        </apex:outputPanel>
                        <apex:variable var="cnt" value="{!cnt+1}"/> 
                    </apex:column>
                    <apex:column value="{!wrap.Oliselect.name}"/>
                    <apex:column value="{!wrap.Oliselect.Ready_For_Service_Date__c}"/>
                    <apex:column value="{!wrap.Oliselect.End_Contract_Date__c}"/>
                    <apex:column value="{!wrap.Oliselect.UnitPrice}"/>
                    <apex:column value="{!wrap.Oliselect.Initial_Cost__c}"/>
                    <apex:column value="{!wrap.Oliselect.Opportunity.account.name}"/>
                </apex:pageblockTable>
            </apex:pageBlock>
        </apex:form>
    </body>
</apex:page>



 
Hi,

How can I redirect to a visualforce page from a field on Opportunity Line Item. (It should not be a button/Link)

Thanks,
Sweta
Hi All,

There is a junction object on Account & Contact. For some Profile there should be read/edit/delete permission but for some profile, only the Account Team Member & Account Owner should be able to read/edit/delete

Thanks,
Sweta
Hi, sorry if this is a stupid/repetitive question, but I am unable to find appropriate solution for this. 

I need to skip all the validations on save command button  but
html-novalidate="true"
html-novalidate=”novalidate” at form level or button level does not work.
Also, immediate="true" at command button level is not working.

I also referred to - Nothing works :(
https://wdcigroup.net/salesforce-visualforce-commandbutton-to-bypass-validationrequired-fields/
https://www.biswajeetsamal.com/blog/immediate-true-is-not-working-on-custom-buttons-with-html5-doctype-in-visualforce-page/

<apex:page standardController="opportunityLineItem"  extensions="opportunityassetcontroller"  id="page1" tabstyle="opportunitylineitem"  sidebar="TRUE" lightningStylesheets="true" docType="html-5.0">
    <apex:slds /> 
    <body class = "slds-scope">
        <apex:form html-novalidate="novalidate"  >
            <apex:pageMessages />
            <apex:pageBlock id="block0" rendered="{!if(NoSubstituteOLIAvail,true,false)}">
                <div align="center" draggable="false">
                <apex:commandButton value="Close" styleclass="slds-button slds-button--brand" action="{!Close}" immediate="true"/>
                    </div>
                </apex:pageBlock>
            <apex:pageBlock id="block1" title="Details" rendered="{!if(NoSubstituteOLIAvail,false,true)}">
                <apex:pageBlockButtons location="bottom">
                    <apex:commandButton value="Close" styleclass="slds-button slds-button--brand"  action="{!Close}" />
                    <apex:commandButton value="Search" styleclass="slds-button slds-button--brand" action="{!getOliDetails}" />
                </apex:pageBlockButtons>
                <apex:pageBlockSection columns="2" id="sec1" title="Opportunity Information" collapsible="false">
                    <apex:inputField value="{!newopptyLineItem.opportunityid}" />
                </apex:pageBlockSection>
            </apex:pageBlock>
            <br/>
            <br/>
            <apex:pageBlock id="block2" title="Opportunity Product Details" rendered="{!getolidetails}" >
                <apex:pageBlockButtons location="bottom">
                    <apex:commandButton value="Save" styleclass="slds-button slds-button--brand"  action="{!doSave}" />
                    <apex:commandButton value="Cancel" styleclass="slds-button slds-button--brand" action="{!Close}" immediate="true"/>
                </apex:pageBlockButtons>
                <apex:pageblockTable value="{!wrapperSelectedOli}" var="wrap" rendered="{!getolidetails}" id="alloli"  >   
                    <apex:variable value="{!0}" var="cnt"/> 
                    <apex:column headerValue="Select">
                        <apex:outputPanel rendered="{!wrap.isSelected}">
                            <input type="radio" checked="true"/>
                        </apex:outputPanel>
                        <apex:outputPanel rendered="{!NOT(wrap.isSelected)}" >
                            <apex:actionSupport action="{!selectOli}" event="onclick" reRender="alloli" >
                                <input type ="radio"/>
                                <apex:param name="index" value="{!cnt}"/>
                                <apex:param name="olid"  value="{!wrap.Oliselect.id}"/>
                            </apex:actionSupport>
                        </apex:outputPanel>
                        <apex:variable var="cnt" value="{!cnt+1}"/> 
                    </apex:column>
                    <apex:column value="{!wrap.Oliselect.name}"/>
                    <apex:column value="{!wrap.Oliselect.Ready_For_Service_Date__c}"/>
                    <apex:column value="{!wrap.Oliselect.End_Contract_Date__c}"/>
                    <apex:column value="{!wrap.Oliselect.UnitPrice}"/>
                    <apex:column value="{!wrap.Oliselect.Initial_Cost__c}"/>
                    <apex:column value="{!wrap.Oliselect.Opportunity.account.name}"/>
                </apex:pageblockTable>
            </apex:pageBlock>
        </apex:form>
    </body>
</apex:page>



 
I'm looking for a way to add a static text message above the standard edit/create new opportunity page layout.  The business case for this is to provide instructions/tips for opportunity creation, right where the opportunity is being created.  I'm able to add my text to the standard layouts, but just can't get it to appear on the edit/create page.  Here is as far as i've been able to get - and this just gets me the standard create page with none of my text anywhere on the screen.
 
<apex:page standardController="Opportunity" action="{!create}"> 
<apex:pageblock title="Help"> Fill in all the known details of this opportunity, including contacts, billing information and when you think the deal will close by.<br/> 
***If you are creating a new opportunity, your initial stage CANNOT be Closed - Pending, Closed - Submitted or Closed - Booked. You must start from a lower stage and then shift to a closed Stage after initial creation.<p/> 
<apex:detail inlineEdit="True" relatedList="true"/> 
</apex:pageBlock> 
<apex:detail />
​</apex:page>

 
Hi,
I need a test code for this pagereference method ..its with for loops and if conditions..so help me to findout this.
Thanks in advance.
public PageReference Del (){
        Integer dmlrows = Limits.getLimitDMLRows();
        Integer curdmlrows = Limits.getDMLRows(); 
        Integer remainingdmlrows = dmlrows - curdmlrows;
        
        Integer indexVal = Integer.valueof(system.currentpagereference().getparameters().get('index'));  
        
        if (newRFPProdList.get(indexVal - 1).id!=null)
            delRFPProdList.add(newRFPProdList.get(indexVal - 1));
        
        Id prodid = newRFPProdList.get(indexVal - 1).Product__c;  
        system.debug('selectedprodid'+prodid);
        try{
        delete [select ID from rfp_question__c where rfp__c = :rfpID and product__c =: prodid];
        remainingdmlrows = dmlrows - curdmlrows;
        
        newprd.remove(indexVal - 1);
        newRFPProdList.remove(indexVal - 1);
        
        if(delRFPProdList.size()>0)
            delete delRFPProdList;
        delRFPProdList.clear();
        }
        catch (Exception e) {
          String  message  = '[ PACRES ] Exception: ' + e.getMessage() + '; line: ' + e.getLineNumber() ;
            //ApexPages.addMessage(message);
            ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.FATAL, '[ PACRES ] Exception: ' + e.getMessage() ));
            exceptionMessages += message + '\n\n';
        }
        return null;
    }
I researched a lot and didn't find any solutions, so far I only can add VF pages to record Detail page. I saw there was a Salesforce idea posted for long time  https://success.salesforce.com/ideaview?id=08730000000Br8CAAS , but it seems Salesforce still doesn't support this.

So is it possible to add visualforce page on record Edit page now?
I'm looking for a way to add a static text message above the standard edit/create new opportunity page layout.  The business case for this is to provide instructions/tips for opportunity creation, right where the opportunity is being created.  I'm able to add my text to the standard layouts, but just can't get it to appear on the edit/create page.  Here is as far as i've been able to get - and this just gets me the standard create page with none of my text anywhere on the screen.
 
<apex:page standardController="Opportunity" action="{!create}"> 
<apex:pageblock title="Help"> Fill in all the known details of this opportunity, including contacts, billing information and when you think the deal will close by.<br/> 
***If you are creating a new opportunity, your initial stage CANNOT be Closed - Pending, Closed - Submitted or Closed - Booked. You must start from a lower stage and then shift to a closed Stage after initial creation.<p/> 
<apex:detail inlineEdit="True" relatedList="true"/> 
</apex:pageBlock> 
<apex:detail />
​</apex:page>

 
I researched a lot and didn't find any solutions, so far I only can add VF pages to record Detail page. I saw there was a Salesforce idea posted for long time  https://success.salesforce.com/ideaview?id=08730000000Br8CAAS , but it seems Salesforce still doesn't support this.

So is it possible to add visualforce page on record Edit page now?