• Harsh Singh 7
  • NEWBIE
  • 30 Points
  • Member since 2015

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 1
    Likes Given
  • 7
    Questions
  • 5
    Replies
We are trying to add logic to prevent duplicate items on orders.  It was suggested we use a Duplicate / Matching rule on the order item object.  Unfortunately the Visual Force page we have where the user enters items does not seem to use the Duplicate / Matching rule because we are still able to enter duplicates with no message or error.

Is there something that needs to be done to enable the Visual Force page to utilize the rules?

Dan
Please create the test class for below code

@RestResource(urlMapping='/Subscriber/*')
global with sharing class MyFirstISID
{
@HttpGet
global static list<string> doGet()
{
RestRequest req = RestContext.request;
RestResponse res = RestContext.response;
String strEncryptId = req.params.get('EncryptedSub_id');
Id decryptDataSub_id = Cipher.decryptData(String.valueof(strEncryptId ));
Account sampleJSON = [SELECT Id, Name,JSON__c FROM Account WHERE Name =: 'SUBSCRIBER' AND Id =: decryptDataSub_id ];

Object obj = JSON.deserializeUntyped(sampleJSON.JSONAttribute__c ); // converting JSON string into apex primitive data types.


}

return strRes;
}
the logic to fetch the node value from JSON using request JSON path from custom metadata and then will inject the value into the response node using the response JSON path from custom metadata
We have an Role object which has a looks up relation to case . The address object has a standard new button and has a Salesforce Classic Override on a visualforce page. The new button is working on classic but I am not able to find that on the related list of cases in communities. Is there any approach where I can create related object records(address records from case object record) through the VF page in community?
(Note:- I am using system admin profile)

Image for communities
We have a requirement to customize the standard sort order present on the knowledge component. Is there any way to modify the sort order of standard knowledge component? If yes please provide the solution.
If not possible then where can we get the standard knowledge lightning component code for reuse and modify it according to our requirement?

Step to Reproduce
Go to Knowledge
Click on 'Sort By' button
While doing integration of XYZ Payment Gateway with Lightning Salesforce.
Added Static resource of (say XYZ) called in my lightning component.

<ltng:require scripts="/resource/XYZAngular/angular-payments/lib/XYZ.js" />

it gives me below error 
It looks like XYZ.js is not being loaded from http://js.XYZ.com XYZ does not support serving XYZ.jsfrom your own domain

Please let me know how to resolve it 
ASAP.
 
 if(Trigger.isafter && Trigger.isupdate){
            for(Event objEve : Trigger.new){
                if(objEve.Description_RTA__c == Null ){
                break;
                }
                if(objEve.Description_RTA__c != Trigger.oldMap.get(objEve.Id).Description_RTA__c ){
                if(objEve.Description_RTA__c.Contains('<img') && objEve.Description_RTA__c != Null ){                    
                Attachment newattachment = new Attachment();   
                newattachment.Body = Blob.valueOf(objEve.Description_RTA__c);
                newattachment.Name = String.valueOf('image.jpg');
                newattachment.ParentId =objEve.Id; 
                buffer_Attac.add(newattachment);       
               }
                else if(objEve.Description_RTA__c != Null){    
                        Attachment newattachment = new Attachment();   
                        newattachment.Body = Blob.valueOf(objEve.Description_RTA__c);
                        newattachment.Name = String.valueOf('test.txt');
                        newattachment.ParentId =objEve.Id; 
                        buffer_Attac.add(newattachment);   
                       }
                 }       
            }     
     }
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------Issue-
On Event object their is no rich text area, so user wanted to have the rich text area, i have created the visual force page and add in the page layout of event.
I have also add the trigger on event object so when user make any changes in that visual force page than it will save in the attachment as a file text or a image jpg .
The issue is whenever user make any changes in the rich text area. than every time it is creating the new file and attached in the section, but this need to be stop and only one time it should added and next time they need to update than attachment.
Hint-
1. Either my removing the file
2. Deleting the file
 
I have one scenerio when in any record their are 10 check box now their are n number of records were i need to figure out the common check box so that i can used this common check box in visual force page.
Can any one tell me the logic of this scenerio.

Thanks
 
We are trying to add logic to prevent duplicate items on orders.  It was suggested we use a Duplicate / Matching rule on the order item object.  Unfortunately the Visual Force page we have where the user enters items does not seem to use the Duplicate / Matching rule because we are still able to enter duplicates with no message or error.

Is there something that needs to be done to enable the Visual Force page to utilize the rules?

Dan
I need to get the file whcih is attached in upload files(not attchments) types as file. I need to get the body, name and content type of the file in exteral system. How to query the files from saelsforce.

This is what I used for querying the attachments-it working perfctely. 
select Id,Name,ParentId,Body,ContentType,Parent.Id from attachment WHERE parentId != Null.

I want same for query the files. I have researched and found the "contendocumentLink" for this. but how to get the body and name in that. Please assist
I am currently trying to parse an XML response, however it does not seem to want to parse whats being returned, and im not sure if its because of the complexity of the response, or if im doing something wrong.

I am using HttpRequests to send requets to our api. 

Here is the xml the API responds with:
 
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <getGLBranchResponse xmlns="our end point is here">
      <getGLBranchResult>
        <Branch>
          <ID>
            <Value>int</Value>
            <Valid>boolean</Valid>
          </ID>
          <Code>
            <Value>string</Value>
            <Valid>boolean</Valid>
          </Code>
        </Branch>
        <BranchName>
          <Value>string</Value>
          <Valid>boolean</Valid>
        </BranchName>
        <Customer>
          <ID>
            <Value>int</Value>
            <Valid>boolean</Valid>
          </ID>
          <Code>
            <Value>string</Value>
            <Valid>boolean</Valid>
          </Code>
        </Customer>
        <DefaultWarehouse>
          <ID>
            <Value>int</Value>
            <Valid>boolean</Valid>
          </ID>
          <Code>
            <Value>string</Value>
            <Valid>boolean</Valid>
          </Code>
        </DefaultWarehouse>
        <MainBranch>
          <Value>boolean</Value>
          <Valid>boolean</Valid>
        </MainBranch>
        <Active>
          <Value>boolean</Value>
          <Valid>boolean</Valid>
        </Active>
      </getGLBranchResult>
    </getGLBranchResponse>
  </soap:Body>
</soap:Envelope>

I use Dom.Document doc = res.getBodyDocument(); to get the document from the HTTP response. 

When I call Dom.XMLNode rootele = doc.getRootElement(); and put it in a system.debug, it doesnt really make much sense, returns something like:
 
[13]|DEBUG|XMLNode[ELEMENT,Envelope,http://schemas.xmlsoap.org/soap/envelope/,null,[common.apex.api.dom.XmlNode$NamespaceDef@c2d03a7, common.apex.api.dom.XmlNode$NamespaceDef@59ff7f61, common.apex.api.dom.XmlNode$NamespaceDef@32f5bbfc],[XMLNode[ELEMENT,Body,http://schemas.xmlsoap.org/soap/envelope/,null,null, etc

when I call getChildElement on this, it returns null, everytime. I have tried calling getChildElement('Envelope',null)​, getChildElement('Body',null)​ and many others. Always returns null. Am i doing something wrong? 
The <apex:inputTextArea richtext="true"/> allows me to upload image by entering the image link:
User-added image

What I need is to be able to upload image from local folder like this:
User-added image


How can I add this to the inputTextArea?
  • September 16, 2015
  • Like
  • 0
I want to achieve one requirement that when Manager A logs in to his Org, then he should see only employees under him not under any other manager using lookup. Can someone help me to achieve it?